[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference clt::cma

Title:DECthreads Conference
Moderator:PTHRED::MARYSTEON
Created:Mon May 14 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1553
Total number of notes:9541

1488.0. "sigwait undefined symbol" by CSC32::P_HILL () Wed Feb 19 1997 18:17

    greetings,
    
      unix 4.0b man page for sigwait says it uses the libpthread.so
    library. when i compile a program using the -pthread at the end of 
    the compile command i get an error undefined symbol but when i 
    compile it using the -threads i do not get any error at all.  
    
    
    
    
    paul -osappl
    
    
    
    
T.RTitleUserPersonal
Name
DateLines
1488.1DCETHD::BUTENHOFDave Butenhof, DECthreadsThu Feb 20 1997 06:5427
My guess is that this means you're not including <signal.h>. The prototype of
sigwait(), unfortunately, changed between POSIX draft 4 and the final
standard. Because we were already using "sigwait" as the name, and we had to
retain binary compatibility (a real pain), the POSIX sigwait is called
__sigwaitd10. This is transparent if you build correctly, because <signal.h>
fixes up your reference to the proper name when you're building for POSIX
threads.

When you build -threads, you link against libpthreads.so, the "legacy"
library, which has a sigwait entry point. But libpthread.so has only
__sigwaitd10, so when you build -pthread, your reference to sigwait goes
unresolved.

First, you should always include <signal.h>. Second, make sure that you're
using the right prototype for sigwait. The draft 4 version returned the
signal number as the function value, and accepted a single argument (the
signal mask). The POSIX version returns an error code, and takes two
arguments (the signal mask and a pointer to an int that receives the signal
number that occurred).

Of course, if you ARE including <signal.h> in every source file that calls
sigwait(), then something else is wrong. Perhaps you've confused the
<signal.h> conditionals with some "unusual" combination of -D definitions,
for example. In this case, please post the complete build command so we can
try to figure out what may be happening.

	/dave