Created
March 19, 2015 00:26
-
-
Save lettergram/990312e930796eb364ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Given the file descriptor this function, | |
* writes A, waits 2 second, writes "c," | |
*/ | |
void child_one_func(int fd){ | |
write(fd, "A - 1", 5); | |
sleep(2); | |
write(fd, "C - 3", 5); | |
close(fd); | |
} | |
/** | |
* Given the file descriptor this function, | |
* Waits 1 second, writes "B", Waits 2 seconds, | |
* then writes "D" | |
*/ | |
void child_two_func(int fd){ | |
sleep(1); | |
write(fd, "B - 2", 5); | |
sleep(2); | |
write(fd, "D - 4", 5); | |
close(fd); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment