Skip to content

Instantly share code, notes, and snippets.

@good5dog5
Created December 28, 2015 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save good5dog5/5bf755171a0a4c546f5e to your computer and use it in GitHub Desktop.
Save good5dog5/5bf755171a0a4c546f5e to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<stdbool.h>
#include<unistd.h>
#include<sys/types.h>
void main()
{
printf("A\n");
while(1);
}
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<stdbool.h>
#include<unistd.h>
#include<sys/types.h>
void main()
{
pid_t x = fork();
if (x > 0) {
fork();
printf("1\n");
}
else if (x == 0) {
printf("2\n");
fork();
execl("./outA.out", "./outA.out", "NULL");
printf("3\n");
}
while(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment