#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include <fcntl.h>
#include <sys/types.h>
int main (int argc, char *argv[]) {
int x = 100;
int rc = fork();
if (rc < 0) {
fprintf(stderr, "fork failed\n");
} else if (rc == 0) {
x=200;
printf("childFork: x=%d\n",x);
} else {
int wc = wait(NULL);
printf("parentFork: x=%d\n",x);
}
return 0;
}