Richard,<br><br>The only FreeBSD system I got access to doesn't seem to support a distinct thread ID access method.  Below is a patch that you can use as a workaround.<br><br>It uses process ID in lieu of thread ID.  This primarily affects log statements.  The only area where it will affect performance is with CPU affinity - all threads will be assigned the same CPU - unless getpid() actually returns a thread ID on those systems.<br>
<br>Let me know if this gets you going or if you you find a better solution.<br><br>Thanks<br>Russ<br><br>Index: s_util/include/s_thread.h<br>===================================================================<br>RCS file: /usr/cvsroot/sfeng/ims/sfsnort/sfips/src/s_util/include/s_thread.h,v<br>
retrieving revision 1.37<br>diff -u -B -b -r1.37 s_thread.h<br>--- s_util/include/s_thread.h   26 Nov 2008 18:53:44 -0000      1.37<br>+++ s_util/include/s_thread.h   22 May 2009 15:22:24 -0000<br>@@ -39,7 +39,8 @@<br> #include "s_types.h"<br>
 #include "s_cpuclock.h"<br> <br>-static ALWAYS_INLINE pid_t s_gettid(void) { return syscall(__NR_gettid); }<br>+//static ALWAYS_INLINE pid_t s_gettid(void) { return syscall(__NR_gettid); }<br>+static ALWAYS_INLINE pid_t s_gettid(void) { return getpid(); }<br>
 <br> SO_PUBLIC int s_set_affinity(int cpu);<br><br><div class="gmail_quote">On Thu, May 7, 2009 at 6:53 PM, Richard Bejtlich <span dir="ltr"><<a href="mailto:taosecurity@...11827...">taosecurity@...11827...</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Thu, May 7, 2009 at 5:49 PM, Russ Combs <<a href="mailto:rcombs@...846....1935...">rcombs@...1935...</a>> wrote:<br>

> After installing the uuid libs, configure still couldn't find them.  (It<br>
> could find the header, but not the actual lib.)<br>
><br>
> configure:19250: checking for uuid_generate in -luuid<br>
> configure:19285: gcc -o conftest  -g -fno-strict-aliasing<br>
> -fvisibility=hidden  -I/usr/local/include/lua51 -fno-strict-aliasing<br>
> -I/usr/local/include  -L/usr/local/lib/lua51 -L/usr/lib conftest.c -luuid<br>
> -lm -lpthread -lrt  >&5<br>
> /usr/bin/ld: cannot find -luuid<br>
> Try this:<br>
><br>
> export LDFLAGS="-L/usr/local/lib"<br>
><br>
> and then configure.<br>
><br>
> Russ<br>
<br>
</div>Thanks Rmkml and Russ!  I got the following to work until I had to<br>
"make" (shown later)<br>
<br>
fbsd7# setenv CPPFLAGS "-I/usr/local/lib"<br>
fbsd7# setenv LDFLAGS "-L/usr/local/lib"<br>
<br>
fbsd7# pkg_add -r bison<br>
<br>
fbsd7# ./configure --prefix=/usr/local/snortsp-3.0.0b3 --with-uuid-lib=e2fs<br>
<br>
Then I encountered a new error:<br>
<br>
fbsd7# make && make install<br>
make  all-recursive<br>
Making all in src<br>
Making all in s_util<br>
Making all in include<br>
Making all in libsbpf<br>
/bin/sh ../../../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H<br>
-I. -I../../.. -I../../.. -I../../../src/s_util/libsbpf/bpf<br>
-I../../../src/s_util/libsbpf/net -I../../../src/s_util<br>
-I../../../src/s_util/include -I../../../src/data_source<br>
-I../../../src/data_source/daq -I../../../src/data_source/decode<br>
-I../../../src/data_source/flow -I../../../src/platform<br>
-I../../../src/comms -I../../../src/analysis -I../../../src/output<br>
-I.. -I/usr/local/include/lua51  -I/usr/local/lib<br>
<div class="im">-I/usr/local/include/lua51 -fno-strict-aliasing -I/usr/local/include<br>
</div>-Wall  -DBUILDING_SO -Dyylval=s_bpf_lval -g -fno-strict-aliasing<br>
-fvisibility=hidden -O2 -MT libsbpf_la-s_bpf_filter.lo -MD -MP -MF<br>
.deps/libsbpf_la-s_bpf_filter.Tpo -c -o libsbpf_la-s_bpf_filter.lo<br>
`test -f 'bpf/s_bpf_filter.c' || echo './'`bpf/s_bpf_filter.c<br>
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../..<br>
-I../../../src/s_util/libsbpf/bpf -I../../../src/s_util/libsbpf/net<br>
-I../../../src/s_util -I../../../src/s_util/include<br>
-I../../../src/data_source -I../../../src/data_source/daq<br>
-I../../../src/data_source/decode -I../../../src/data_source/flow<br>
-I../../../src/platform -I../../../src/comms -I../../../src/analysis<br>
-I../../../src/output -I.. -I/usr/local/include/lua51 -I/usr/local/lib<br>
<div class="im">-I/usr/local/include/lua51 -fno-strict-aliasing -I/usr/local/include<br>
</div>-Wall -DBUILDING_SO -Dyylval=s_bpf_lval -g -fno-strict-aliasing<br>
-fvisibility=hidden -O2 -MT libsbpf_la-s_bpf_filter.lo -MD -MP -MF<br>
.deps/libsbpf_la-s_bpf_filter.Tpo -c bpf/s_bpf_filter.c  -fPIC -DPIC<br>
-o .libs/libsbpf_la-s_bpf_filter.o<br>
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../..<br>
-I../../../src/s_util/libsbpf/bpf -I../../../src/s_util/libsbpf/net<br>
-I../../../src/s_util -I../../../src/s_util/include<br>
-I../../../src/data_source -I../../../src/data_source/daq<br>
-I../../../src/data_source/decode -I../../../src/data_source/flow<br>
-I../../../src/platform -I../../../src/comms -I../../../src/analysis<br>
-I../../../src/output -I.. -I/usr/local/include/lua51 -I/usr/local/lib<br>
<div class="im">-I/usr/local/include/lua51 -fno-strict-aliasing -I/usr/local/include<br>
</div>-Wall -DBUILDING_SO -Dyylval=s_bpf_lval -g -fno-strict-aliasing<br>
-fvisibility=hidden -O2 -MT libsbpf_la-s_bpf_filter.lo -MD -MP -MF<br>
.deps/libsbpf_la-s_bpf_filter.Tpo -c bpf/s_bpf_filter.c -o<br>
libsbpf_la-s_bpf_filter.o >/dev/null 2>&1<br>
mv -f .deps/libsbpf_la-s_bpf_filter.Tpo .deps/libsbpf_la-s_bpf_filter.Plo<br>
/bin/sh ../../../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H<br>
-I. -I../../.. -I../../.. -I../../../src/s_util/libsbpf/bpf<br>
-I../../../src/s_util/libsbpf/net -I../../../src/s_util<br>
-I../../../src/s_util/include -I../../../src/data_source<br>
-I../../../src/data_source/daq -I../../../src/data_source/decode<br>
-I../../../src/data_source/flow -I../../../src/platform<br>
-I../../../src/comms -I../../../src/analysis -I../../../src/output<br>
-I.. -I/usr/local/include/lua51  -I/usr/local/lib<br>
<div class="im">-I/usr/local/include/lua51 -fno-strict-aliasing -I/usr/local/include<br>
</div>-Wall  -DBUILDING_SO -Dyylval=s_bpf_lval -g -fno-strict-aliasing<br>
-fvisibility=hidden -O2 -MT libsbpf_la-s_gencode.lo -MD -MP -MF<br>
.deps/libsbpf_la-s_gencode.Tpo -c -o libsbpf_la-s_gencode.lo `test -f<br>
'bpf/s_gencode.c' || echo './'`bpf/s_gencode.c<br>
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../..<br>
-I../../../src/s_util/libsbpf/bpf -I../../../src/s_util/libsbpf/net<br>
-I../../../src/s_util -I../../../src/s_util/include<br>
-I../../../src/data_source -I../../../src/data_source/daq<br>
-I../../../src/data_source/decode -I../../../src/data_source/flow<br>
-I../../../src/platform -I../../../src/comms -I../../../src/analysis<br>
-I../../../src/output -I.. -I/usr/local/include/lua51 -I/usr/local/lib<br>
<div class="im">-I/usr/local/include/lua51 -fno-strict-aliasing -I/usr/local/include<br>
</div>-Wall -DBUILDING_SO -Dyylval=s_bpf_lval -g -fno-strict-aliasing<br>
-fvisibility=hidden -O2 -MT libsbpf_la-s_gencode.lo -MD -MP -MF<br>
.deps/libsbpf_la-s_gencode.Tpo -c bpf/s_gencode.c  -fPIC -DPIC -o<br>
.libs/libsbpf_la-s_gencode.o<br>
In file included from bpf/s_gencode.c:62:<br>
../../../src/s_util/include/s_thread.h:36:26: error: linux/unistd.h:<br>
No such file or directory<br>
In file included from bpf/s_gencode.c:62:<br>
../../../src/s_util/include/s_thread.h: In function 's_gettid':<br>
../../../src/s_util/include/s_thread.h:42: error: '__NR_gettid'<br>
undeclared (first use in this function)<br>
../../../src/s_util/include/s_thread.h:42: error: (Each undeclared<br>
identifier is reported only once<br>
../../../src/s_util/include/s_thread.h:42: error: for each function it<br>
appears in.)<br>
*** Error code 1<br>
<br>
Stop in /usr/local/src/snortsp-3.0.0b3/src/s_util/libsbpf.<br>
*** Error code 1<br>
<br>
Stop in /usr/local/src/snortsp-3.0.0b3/src/s_util.<br>
*** Error code 1<br>
<br>
Stop in /usr/local/src/snortsp-3.0.0b3/src.<br>
*** Error code 1<br>
<br>
Stop in /usr/local/src/snortsp-3.0.0b3.<br>
*** Error code 1<br>
<br>
Stop in /usr/local/src/snortsp-3.0.0b3.<br>
<br>
Anyone recognize that?<br>
<br>
Thank you,<br>
<font color="#888888"><br>
Richard<br>
</font></blockquote></div><br>