Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char* fifo_name;
- for (i = 0; i < wnuk_ilosc; i++)
- {
- wnuki[i] = fork();
- if(wnuki[i]==-1)
- {
- perror("Fatal Error! - grand son's\t");
- printf("errno = %d \n", errno);
- exit(1);
- }
- else if (wnuki[i]==0)
- {
- fifo_name = (char*)malloc(6);
- sprintf(fifo_name,"%d",i);
- if(execl("./wnuk","wnuk",parm1,fifo_name,NULL)==-1)
- {
- perror("Fatal Error! - grand son's execl\t");
- printf("errno = %d \n", errno);
- exit(1);
- }
- exit(0);
- }
- else
- {
- sleep(10);
- printf("jestem nowym !!!!!! i gine za 5 sec\n");
- sleep(5);
- exit(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement