Re: sem_open(3) and FBSD 5.2 : what the point ?
In the last episode (Feb 06), Eric Jacoboni said: > Here's a sample code: > > #include ... >dis_ping = sem_open("/ping.sem", O_CREAT, 0777, 1); ... > > On FBSD 5.2, gcc first complains it doesn't know about O_CREAT... > That's not what the sem_open() manpage claims but, ok, let's include > . > > The code, then, compile ok, but fails on : > > $ ./ping.exe > zsh: invalid system call (core dumped) ./ping.exe > > Any idea? Have you enabled them in your kernel config? From /sys/conf/NOTES : # p1003_1b_semaphores are very experimental, # user should be ready to assist in debugging if problems arise. options P1003_1B_SEMAPHORES -- Dan Nelson [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
sem_open(3) and FBSD 5.2 : what the point ?
Hi, Here's a sample code: #include #include int main(void) { sem_t *dis_ping, *dis_pong; dis_ping = sem_open("/ping.sem", O_CREAT, 0777, 1); dis_pong = sem_open("/pong.sem", O_CREAT, 0777, 0); for(;;) { sem_wait(dis_ping); puts("Ping..."); sem_post(dis_pong); } sem_close(dis_ping); sem_close(dis_pong); return 0; } This code compiles and works fine on Darwin... On FBSD 5.2, gcc first complains it doesn't know about O_CREAT... That's not what the sem_open() manpage claims but, ok, let's include . The code, then, compile ok, but fails on : $ ./ping.exe zsh: invalid system call (core dumped) ./ping.exe Any idea? ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"