Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
fork() System call
//gcc 5.4.0 #include<stdio.h> #include<unistd.h> #include<sys/types.h> #include<sys/wait.h> int main() { printf("\nMy process id is %d",(int)getpid()); pid_t pid=fork(); printf("\nFork returned is %d",(int)pid); if(pid<0) { printf("Fork Failed to return value"); } if(pid==0) { printf("\nChild process having pid=%d",(int)getpid()); printf("\nParent process having pid=%d",(int)getpid()); } else { wait(NULL); printf("\nChild process completed"); } return 0; }
run
|
edit
|
history
|
help
0
program
Project 3 Part 1 v1.0
Spring 2017 Project 2 v.02
SAI_1-6.c
150112_CribaErastotenes
project 5 v.075
Spring 2017 Project 2 v1
Char data type.c
SumIt
150113_CribaErastotenes