answer waiting for son
Here is a few line of codes.
I hope is usefull for you! int main() { pid_t pid,w; int status; for(i=0;i<3;i++) { if((pid=fork())==0) { bla,bla,bla } else printf("Fork son %d\n",pid); } /*Waiting for son*/ while((w=wait(&status)) && w !=-1) { if(w != -1) printf("The waiting for PID: %d has return status : %040X\n", w, status); } exit(0); } ------------------- Any improvements are welcome! |
All times are GMT -5. The time now is 06:59 AM. |