I have created a file and I'm trying to create a semaphore for it using
POSIX system calls. My program creates children processes who will open
the file and write their pid in the file at the same time.
This is my file:
void Parent process()
File *p, *p2;
p=fopen("file1" , "w+");
if(p==NULL) //error
else
fprintf(p,"%u", getpid())
pclose(p);...