func: int main(int argc, char *argv[]) unsigned i ; if ( fork ( ) )  for (i=0;i<3;++i) pid = fork ( ); if ( pid == 0 )  pid = getpid ( ); handler ( pid ); void handler(int curPid) int fd = open ( fName , O_WRONLY | O_CREAT | O_EXCL ) ; if ( fd != - 1 )  if ( errno == EEXIST )  fprintf ( stderr , "(%d) File exists\n" , curPid ); if ( errno == EACCES )  fprintf ( stderr , "(%d) Requested access not allowed\n" , curPid ); 