Parent trying to read children exit status (or return value), fork and wait
问题 I'm confused. Supposedly, basing on man, and many other sources, like this: Return code when OS kills your process wait(&status) should make it possible for me to get the exit status or return value of a child process? Those 2 snippets of code, should allow me to see the exit value of it's child, and then print it. child process function: int childFunction(char in[],char logPath[]){ FILE *logFile= fopen( logPath, "a" ); if(logFile==NULL) return 1; int c=system(in); fclose(logFile); return(c);