Untitled
public c v1 · immutable#include <sys/types.h>#include <errno.h>#include <fcntl.h>#include <semaphore.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h> int main(void){ sem_t *sem1; sem1 = sem_open("nimeni", O_CREAT | O_EXCL, 0666, 1); if (sem1 == NULL) { printf("error opening semaphore: %s\n", strerror(errno)); return EXIT_FAILURE; } return EXIT_SUCCESS;}