Skip to content

Instantly share code, notes, and snippets.

@lettergram lettergram/func.c
Created Mar 19, 2015

Embed
What would you like to do?
/**
* 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
You can’t perform that action at this time.