This repository has been archived on 2026-05-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-04-13 23:19:04 +02:00

30 lines
413 B
C

#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/types.h>
#include <err.h>
int forky(){
pid_t pid = fork();
if (pid < 0) return -1;
else if (pid == 0){
printf("I am the child!\n");
exit(0);
}
else{
printf("I am the parent!\n");
}
return 0;
}
/*
int main(){
int res = forky();
printf("%d\n", res);
}
*/