problems with sem_open

Matthias Hofmann matthias.hofmann at tu-dortmund.de
Wed Apr 21 13:23:40 UTC 2010


Hello,

typing ldd to the shared library has the following output:

 linux-gate.so.1 =>  (0xb7fad000)
 libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7d5f000)
 libm.so.0 => /usr/lib/libm.so.0 (0xb7d52000)
 libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7d48000)
 libc.so.0 => /usr/lib/libc.so.0 (0xb7cfb000)
 libc.so.6 => /lib/libc.so.6 (0xb7bce000)
 ld-uClibc.so.0 => /usr/lib/ld-uClibc.so.0 (0xb7bc7000)
 /lib/ld-linux.so.2 (0xb7fae000)

seems to me that he is using both versions of libc, the glibc and uclibc.
maybe he uses the wrong libc version to call sem_open?

thank you,

Matthias

> Hello,
>
> i have a problem using and opening semaphores with uclibc-based code.
> i am using a crosscompiler cygwin to x86-linux. The uclibc version is
> 0.9.30.3.
>
> i have two components, one shared library (uclibc) which creates the
> semaphore with the following method call:
> sem_open(SEM_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0)
>
> after that i would like to access the semaphore with the following method
> call from another statically linked executable (same compiler and
> versions):
> sem = sem_open(SEM_NAME, O_RDWR, S_IRUSR | S_IWUSR, 0);
>
> exactly the same code works with glibc based crosscompilers and
> executables. does anybody have further information to investigate this
> issue?
>
> the shared library includes some header files which are linked against
> statically glibc-based libraries. the main program has to be linked
> statically, otherwise i get the error "program" not found. it seems to me
> that the dynamic uclibc linker can't be found on my target system. I put
> in /usr/lib and ran "ldconfig -v" where he is listed.
> i built the crosscompiler with the RUNTIME_PREFIX setting = /usr/lib/.
>
> i ensured with ldd that all required libraries are found.
>
> thank you,
>
> Matthias
>




More information about the uClibc mailing list