Skip to content

Instantly share code, notes, and snippets.

@zbskii
Created December 3, 2014 17:56
Show Gist options
  • Save zbskii/82863c53e28479f6c883 to your computer and use it in GitHub Desktop.
Save zbskii/82863c53e28479f6c883 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main(int c, char **v)
{
while (--c > 1 && !fork());
sleep(c = atoi(v[c]));
printf("%d\n", c);
wait(0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment