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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080206/9995d3b7/attachment.html>
On Feb 6, 2008 5:42 PM, MHR <mhullrich at 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
Apparently Analagous Threads
- febootstrap-3.12 configure error on Fedora 16
- measuring sleep time in synchronization objects
- [PATCH for discussion only 0/3] Implement mutexes to limit number of concurrent instances of libguestfs.
- Strange Fedora Booting problem: can not mount "LABEL=*" partitions
- [nbdkit PATCH] nbd: Rewrite thread passing to use semaphore rather than pipe