Interesting S... if it doesn't implement pthread_atfork(), then there's actually no 
safe way to run on FreeBSD...  I'll dump the text from the man page at the bottom - it 
makes for interesting reading!

It's easy enough to #ifdef that stuff out - it's all self contained.  I can fix it in 
the cvs easily too.  You won't be any worse off than you were previously...

But - can you check a couple of things for me re FreeBSD?

1. If you fork() does it copy memory or is it shared?

2. What level of POSIX threads does FreeBSD support? (pthreads_atfork() is part of 
POSIX Threads Extension (1003.1c-1995) - it's even available in Solaris for ghu's 
sake...)


-----Burton



DESCRIPTION
       pthread_atfork registers handler functions to be called just before and
       just  after a new process is created with fork(2).  The prepare handler
       will be called from the parent process, just before the new process  is
       created.  The  parent  handler  will be called from the parent process,
       just before fork(2) returns. The child handler will be called from  the
       child process, just before fork(2) returns.

       One  or  several of the three handlers prepare, parent and child can be
       given as NULL, meaning that no handler needs to be called at the corre-
       sponding point.

       pthread_atfork  can  be called several times to install several sets of
       handlers. At fork(2) time, the prepare  handlers  are  called  in  LIFO
       order (last added with pthread_atfork, first called before fork), while
       the parent and child handlers are called in FIFO  order  (first  added,
       first called).

       To understand the purpose of pthread_atfork, recall that fork(2) dupli-
       cates the whole memory space, including mutexes in their current  lock-
       ing  state,  but only the calling thread: other threads are not running
       in the child process.  The mutexes are not usable after  the  fork  and
       must be initialized with pthread_mutex_init in the child process.  This
       is a limitation of the current implementation and might or might not be
       present in future versions.



---------- Original Message ----------------------------------
From: Stanley Hopcroft <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date:  Mon, 14 Jul 2003 12:15:05 +1000

>Dear Ladies and Gentlemen,
>
>I am writing to report that ntop-2.2c fails to compile on FreeBSD 
>4.8-RELEASE
>
>(probably all the 4-x branch since the POSIX thread 
>implementation has not changed AFAIK, and ntop 2.2 would formerly 
>compile on 4.7-RELEASE).
>
>I am not sure if 2.2c is intended for *BSD systems; it may well have 
>been targetted at NPTL systems (Red Hat 8 and 9) but if so, the failure 
>is
>
>pc09011> gmake
>cd . && /bin/sh ./missing --run echo 
>
>gmake  all-recursive
>gmake[1]: Entering directory 
>`/usr/home/anwsmh/build/ntop-2.2c/ntop/ntop'
>cd . && /bin/sh ./missing --run echo 
>
>Making all in .
>gmake[2]: Entering directory 
>`/usr/home/anwsmh/build/ntop-2.2c/ntop/ntop'
>cd . && /bin/sh ./missing --run echo 
>
>/usr/local/bin/bash ./libtool --mode=link gcc -DFREEBSD -g -O2 -Wshadow 
>-Wpointer-arith -Wmissing-prototypes -Wmissing-declarations 
>-Wnested-externs  -fPIC -DFREEBSD -g -O2 -Wshadow -Wpointer-arith 
>-Wmissing-prototypes -Wmissing-declarations -Wnested-externs  -fPIC   -o 
>ntop  ntop-main.o ntop-admin.o libntopreport.la libntop.la -lxml2 -lc_r 
>-lssl -lcrypto -lpcap -lgdbm -lc -lcrypt 
>-L/home/anwsmh/build/ntop-2.2c/ntop/gdchart0.94c/zlib-1.1.4 -lz 
>-Wl,--rpath -Wl,/home/anwsmh/build/ntop-2.2c/ntop/gdchart0.94c -lgdchart 
>-L/usr/local//lib -lgd 
>-L/home/anwsmh/build/ntop-2.2c/ntop/gdchart0.94c/gd-1.8.3/libpng-1.2.4 
>-lpng 
>gcc -DFREEBSD -g -O2 -Wshadow -Wpointer-arith -Wmissing-prototypes 
>-Wmissing-declarations -Wnested-externs -fPIC -DFREEBSD -g -O2 -Wshadow 
>-Wpointer-arith -Wmissing-prototypes -Wmissing-declarations 
>-Wnested-externs -fPIC -o .libs/ntop ntop-main.o ntop-admin.o 
>-Wl,--rpath -Wl,/home/anwsmh/build/ntop-2.2c/ntop/gdchart0.94c  
>./.libs/libntopreport.so 
>-L/home/anwsmh/build/ntop-2.2c/ntop/gdchart0.94c/zlib-1.1.4 
>-L/usr/local//lib 
>-L/home/anwsmh/build/ntop-2.2c/ntop/gdchart0.94c/gd-1.8.3/libpng-1.2.4 
>./.libs/libntop.so -lxml2 -lc_r -lssl -lcrypto -lpcap -lgdbm -lc -lcrypt 
>-lz -lgdchart -lgd -lpng -Wl,--rpath -Wl,/usr/local/ntop-2.2c/lib
>/usr/lib/libc.so: WARNING!  setkey(3) not present in the system!
>/usr/lib/libc.so: warning: this program uses gets(), which is unsafe.
>/usr/lib/libc.so: warning: mktemp() possibly used unsafely; consider 
>using mkstemp()
>/usr/lib/libc.so: WARNING!  des_setkey(3) not present in the system!
>/usr/lib/libc.so: WARNING!  encrypt(3) not present in the system!
>/usr/lib/libc.so: warning: tmpnam() possibly used unsafely; consider 
>using mkstemp()
>/usr/lib/libc.so: warning: this program uses f_prealloc(), which is not 
>recommended.
>/usr/lib/libc.so: WARNING!  des_cipher(3) not present in the system!
>/usr/lib/libc.so: warning: tempnam() possibly used unsafely; consider 
>using mkstemp()
>./.libs/libntop.so: undefined reference to `pthread_atfork'
>gmake[2]: *** [ntop] Error 1
>gmake[2]: Leaving directory `/usr/home/anwsmh/build/ntop-2.2c/ntop/ntop'
>gmake[1]: *** [all-recursive] Error 1
>gmake[1]: Leaving directory `/usr/home/anwsmh/build/ntop-2.2c/ntop/ntop'
>gmake: *** [all] Error 2
>pc09011> 
>
>
>On this system, the POSIX thread libary functions are implemented in 
>libc_r. This libray has no pthread_atfork() symbol.
>
>I have submitted (I think) a census report on the failure.
>
>For my tiny applications, ntop-2.2 is quite adequate. However, in view
>of the work that has been done back porting bug fixes to the 2.2 series,
>I thought I would try it out.
>
>Yours sincerely.
>
>-- 
>------------------------------------------------------------------------
>Stanley Hopcroft
>------------------------------------------------------------------------
>
>'...No man is an island, entire of itself; every man is a piece of the
>continent, a part of the main. If a clod be washed away by the sea,
>Europe is the less, as well as if a promontory were, as well as if a
>manor of thy friend's or of thine own were. Any man's death diminishes
>me, because I am involved in mankind; and therefore never send to know
>for whom the bell tolls; it tolls for thee...'
>
>from Meditation 17, J Donne.
>_______________________________________________
>Ntop mailing list
>[EMAIL PROTECTED]
>http://listgateway.unipi.it/mailman/listinfo/ntop
>


____________________________________________________________
Free 20MB Web Site Hosting and Personalized E-mail Service!
Get It Now At Doteasy.com http://www.doteasy.com/et/
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop

Reply via email to