libc6-i686: how to use NTLP ?
Hello everybody,
forgive me for bothering you, but after hours of searching and asking for
help on the debian-user list, I'm still stuck.
For my university, I've to program some easy things with POSIX.4
semaphores. I know that I need kernel 2.6 and NPTL for that, and I have
kernel 2.6.7, gcc 3.3.5 and libc6-i686 2.3.2.ds1-19 well installed. But a
minimal
program, shown below, compiles flawlessly with "gcc -o minimal -lpthread
minimal.c",
but it says "sem_open: function not implemented" at run time, as if I were
still using
old LinuxThreads. However, getconf says:
$ getconf _POSIX_SEMAPHORES
1
$ getconf GNU_LIBPTHREAD_VERSION
NPTL 0.60
and ldd shows that the libraries link to the libc6-i686 versions:
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x40025000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x40035000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
On Fedora Cora 2 (computer at my university that I connected via ssh), it
works flawlessly. So does it on the Debian machines of some kind people of
the debian-user list. Have you any idea what I could be missing?
Thanks for reading,
have a merry Christmas,
Viktor.
/* minimal.c */
#define _POSIX_SOURCE 1
#define _XOPEN_SOURCE 1
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <semaphore.h>
int main (int argc, char **argv) {
sem_t* mysem;
if ((mysem = sem_open("/mysem", O_CREAT, S_IRWXU, 1)) == SEM_FAILED) {
perror("sem_open");
return EXIT_FAILURE;
}
}
Reply to: