Guest User

Untitled

a guest
Dec 15th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <fcntl.h> /* For O_* constants */
  2. #include <sys/stat.h> /* For mode constants */
  3. #include <semaphore.h>
  4. #include <stdio.h>
  5. #include <errno.h>
  6.  
  7. int main (){
  8. sem_t * testSem = sem_open("/aaa", O_CREAT|O_EXCL, 0600, 1);
  9. printf("HELLO %d\n", errno); // errno is set to 2 (no such file or dir)
  10. sem_close(testSem);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment