Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fcntl.h> /* For O_* constants */
- #include <sys/stat.h> /* For mode constants */
- #include <semaphore.h>
- #include <stdio.h>
- #include <errno.h>
- int main (){
- sem_t * testSem = sem_open("/aaa", O_CREAT|O_EXCL, 0600, 1);
- printf("HELLO %d\n", errno); // errno is set to 2 (no such file or dir)
- sem_close(testSem);
- }
Advertisement
Add Comment
Please, Sign In to add comment