semaphore.h does'nt include fcntl.h ?
fmail_girish at yahoo.com
Sun Jan 14 17:10:53 UTC 2007
I am trying to use sem_open(3) but gcc complains that
O_CREAT and O_EXCL is undeclared. According to the man
page only semaphore.h needs to be included. But
including fcntl.h solves the problem.
sem_t *lock = sem_open("example_lock", O_CREAT |
O_EXCL, 0600, 1);
Another thing, a program with the above function call
compiles but when I execute it, it spits out "Bad
system call (core dump)". Specifically, I am trying to
run this program given here:
Thanks for your time.
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
More information about the freebsd-hackers