Skip to content

Instantly share code, notes, and snippets.

@danrl
Created May 23, 2018 19:47
Show Gist options
  • Save danrl/bd71899434f421753477fbcf42c000ae to your computer and use it in GitHub Desktop.
Save danrl/bd71899434f421753477fbcf42c000ae to your computer and use it in GitHub Desktop.
#include <unistd.h>
#include <sys/types.h>
int main(int argc, char *argv[]) {
pid_t pid = fork();
if (pid == 0) {
// child being lazy
sleep(30);
return 0;
}
// parent exiting without waiting for the child
sleep(5);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment