Are named posix semaphores not implemented?

pluknet pluknet at gmail.com
Sat May 9 18:20:53 UTC 2009


2009/5/9 Lothar Scholz <scholz at scriptolutions.com>:
> Hello,
>
> i tried to port a program using PCBSD based on FreeBSD 7.1
> and the small test program
>
> #include <semaphore>
> #include <stdio.h>
> #include <fcntl.h>
>
> int main() {
>   sem_t* s = sem_open("foobar", O_CREAT|O_EXCL);
>   if (s == SEM_FAILED) perror("sem_open");
> }
>
> raises a "bad system call 12" signal
> But from the manpage of sem_open tells me that it should
> be there since FreeBSD 5.0?
>
> Please don't tell me that i have to rewrite the code.
>

First, you should have sem(4) capacity enabled in kernel
(via kldload or statically built). It seems you haven't.
Second, as already mentioned and per manpage,
you must specify an abs. path in the first arg.

-- 
wbr,
pluknet


More information about the freebsd-arch mailing list