Something
public text v1 · immutable#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
int main (int argc, char **argv) {
key_t mkey = ftok(argv[0], 0);
if (mkey == -1) {
perror ("ftok");
exit (-2);
}
int mysem = semget (mkey, 1, IPC_CREAT|0777);
if (mysem == -1) {
perror ("semget");
exit (-1);
}
}