man pthread_atfork ??
PTHREAD_ATFORK(3)
PTHREAD_ATFORK(3)
NAME
pthread_atfork - register handlers to be called at fork(2) time
SYNOPSIS
#include <pthread.h>
int pthread_atfork(void (*prepare)(void), void (*parent)(void),
void
(*child)(void));
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.
RETURN VALUE
pthread_atfork returns 0 on success and a non-zero error code on
error.
ERRORS
ENOMEM insufficient memory available to register the handlers.
AUTHOR
Xavier Leroy <[EMAIL PROTECTED]>
SEE ALSO
fork(2), pthread_mutex_lock(3), pthread_mutex_unlock(3).
LinuxThreads
PTHREAD_ATFORK(3)
Sounds like you're actually running an older gcc, one that doesn't have it?
You'll probably need to follow up on the Slackware side.
-----Burton
PS: I've got either 9 or 9.1 on my test box and it works fine... so it's
likely something in your environment.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
Matthew Schumacher
Sent: Monday, October 13, 2003 12:03 PM
To: [EMAIL PROTECTED]
Subject: [Ntop] undefined reference to `pthread_atfork' when compiling
on slackware 9.1
Hello all,
I have a really odd compilation error:
./.libs/libntop.so: undefined reference to `pthread_atfork'
It doesn't really make sense because it is linking against -lpthread.
Anyone have a suggestion on what I can look at?
Thanks,
schu
=========================================================================
Here is my system:
Slackware 9.1 (kernel: 2.4.22, glibc 2.3.2, gcc 3.2.3, GNU Make 3.80)
=========================================================================
Here is the output:
source='admin.c' object='ntop-admin.o' libtool=no \
depfile='.deps/ntop-admin.Po' tmpdepfile='.deps/ntop-admin.TPo' \
depmode=gcc3 /bin/sh ./depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I. -I.
-I/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/zlib-1.1.4
-I/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c
-I/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/gd-1.8.3
-I/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/gd-1.8.3/libpng-1.2.4
-DLINUX -g -O2 -Wshadow -Wpointer-arith -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -fPIC -c -o ntop-admin.o `test
-f 'admin.c' || echo './'`admin.c
/bin/sh ./libtool --mode=link gcc -DLINUX -g -O2 -Wshadow
-Wpointer-arith -Wmissing-prototypes -Wmissing-declarations
-Wnested-externs -fPIC -DLINUX -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 -lglib
-lpthread -lresolv -lnsl -lm -lssl -lcrypto -lpcap -lgdbm -ldl -lcrypt
-lc -L/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/zlib-1.1.4 -lz
-L/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c -lgdchart
-L/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/gd-1.8.3 -lgd
-L/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/gd-1.8.3/libpng-1.2.4
-lpng
gcc -DLINUX -g -O2 -Wshadow -Wpointer-arith -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -fPIC -DLINUX -g -O2 -Wshadow
-Wpointer-arith -Wmissing-prototypes -Wmissing-declarations
-Wnested-externs -fPIC -o .libs/ntop ntop-main.o ntop-admin.o
./.libs/libntopreport.so
-L/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/zlib-1.1.4
-L/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c
-L/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/gd-1.8.3
-L/usr/src/software/pwbuild/ntop/ntop/gdchart0.94c/gd-1.8.3/libpng-1.2.4
./.libs/libntop.so /usr/lib/libxml2.so /usr/lib/libglib.so -lpthread
-lresolv -lnsl -lm -lssl -lcrypto -lpcap /usr/lib/libgdbm.so -ldl
-lcrypt -lc -lz -lgdchart -lgd -lpng -Wl,--rpath -Wl,/usr/local/lib
./.libs/libntop.so: undefined reference to `pthread_atfork'
collect2: ld returned 1 exit status
gmake[2]: *** [ntop] Error 1
gmake[2]: Leaving directory `/usr/src/software/pwbuild/ntop/ntop/ntop'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/src/software/pwbuild/ntop/ntop/ntop'
gmake: *** [all] Error 2
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop