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
B_141107_TablaMultiplicar
Working except for the thread part. LUL
example of scanf and basic integer manipulation
la profe
lab5
ele709 3.5 finished
Hello
PI
Lab 7 blackjack v0.6
Spring 2017 Lab 4 v0.5