According to the man pages for sem_wait, etc., POSIX semaphores are available in Linux 2.6 (with the right NTPL threading in glibc).
However, I have a program that compiles just fine but won't link because it can't find the library for the semaphore operations.
What am I missing?
I ran a find and grep through all the libc's on the system and they turned up nothing:
$ find /lib /usr/lib -name "*libc.*" -print -exec nm {} 2>/dev/null ; | grep sem_
(no results)
Time is critical (yeah, I know...).
Thanks.
mhr
On Feb 6, 2008 5:42 PM, MHR mhullrich@gmail.com wrote:
According to the man pages for sem_wait, etc., POSIX semaphores are available in Linux 2.6 (with the right NTPL threading in glibc).
However, I have a program that compiles just fine but won't link because it can't find the library for the semaphore operations.
What am I missing?
I ran a find and grep through all the libc's on the system and they turned up nothing:
$ find /lib /usr/lib -name "*libc.*" -print -exec nm {} 2>/dev/null ; | grep sem_
(no results)
Time is critical (yeah, I know...).
From man sem_overview:
"Linking Programs using the POSIX semaphores API must be compiled with cc -lrt to link against the real-time library, librt."
Are you linking with -lrt?
Jonathan
On Feb 6, 2008 6:44 PM, Jonathan Berry berryja@gmail.com wrote:
On Feb 6, 2008 5:42 PM, MHR mhullrich@gmail.com wrote:
According to the man pages for sem_wait, etc., POSIX semaphores are available in Linux 2.6 (with the right NTPL threading in glibc).
However, I have a program that compiles just fine but won't link because it can't find the library for the semaphore operations.
What am I missing?
I ran a find and grep through all the libc's on the system and they turned up nothing:
$ find /lib /usr/lib -name "*libc.*" -print -exec nm {} 2>/dev/null ; | grep sem_
(no results)
Time is critical (yeah, I know...).
From man sem_overview:
"Linking Programs using the POSIX semaphores API must be compiled with cc -lrt to link against the real-time library, librt."
Are you linking with -lrt?
Works. Thanks. Must have been working on it too long - I saw that and misread it.
mhr