Note that there are some explanatory texts on larger screens.

plurals
  1. POsem_open fails with ENOSYS even with NPTL support in glibc
    primarykey
    data
    text
    <p>I am trying to use named semaphore to synchronize between multiple process in my linux application.</p> <pre><code> #include &lt;fcntl.h&gt; /* For O_* constants */ #include &lt;sys/stat.h&gt; /* For mode constants */ #include &lt;semaphore.h&gt; #include &lt;stdio.h&gt; #include &lt;errno.h&gt; int main( ) { int sval = -2; char sem_open_file[128]; snprintf(sem_open_file, 128, "/MyNamedSem"); sem_t *sem = sem_open((const char *)sem_open_file, O_CREAT|O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO, 0); if(SEM_FAILED == sem) { printf( "sem_open failed with errno %d\n",errno); } else { printf("sem_open succeded\n"); } return 0; } </code></pre> <p>My sample code works fine on my Ubuntu machine. But when I try to execute the cross compiled version of the code on my embedded board, sem_open() fails with error code 38 (ENOSYS). </p> <p>I found a very similar <a href="https://stackoverflow.com/questions/270113/how-do-i-stop-sem-open-failing-with-enosys">question</a> being asked few years back and tried the solutions given there, but could not solve my issue.</p> <p>From the following command I found the libc version is compiled on kernel version 2.6.24. (The libc is part of angstrom-2011.03-i686-linux-armv5te-linux-gnueabi-toolchain.)</p> <pre><code>$/lib/libc.so.6 GNU C Library stable release version 2.9, by Roland McGrath et al. Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 4.3.3. Compiled on a Linux &gt;&gt;2.6.24-23-generic&lt;&lt; system on 2010-04-22. Available extensions: crypt add-on version 2.1 by Michael Glad and others GNU Libidn by Simon Josefsson Native POSIX Threads Library by Ulrich Drepper et al Support for some architectures added on, not maintained in glibc core. BIND-8.2.3-T5B For bug reporting instructions, please see: &lt;http://www.gnu.org/software/libc/bugs.html&gt;. </code></pre> <p>But the kernel version used for the final application is 2.6.30.</p> <pre><code>$uname -r 2.6.30 </code></pre> <p>-Does the variation in the kernel versions cause any problem?</p> <p>I have also configured the linux kernel to include POSIX_MQUEUE. The NPTL version being used is 2.9 (obtained by running arm-angstrom-linux-gnueabi/usr/bin/getconf on my embedded board by <code>./getconf GNU_LIBPTHREAD_VERSION</code>)</p> <p>Appreciate any sort of ideas to figure out the issue. Thanks for your help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload