Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. char *myargs[] = {
  3. "ls",
  4. "-l",
  5. NULL
  6. };
  7. int main()
  8. {
  9. int i;
  10. if (fork()==0)
  11. {
  12.  
  13. execvp("ls",myargs);
  14. printf("NEVER PRINTEDn");
  15. exit(0);
  16. }
  17. else
  18. {
  19. for (i=0;i<5;i++)
  20. {
  21. printf("PARENT: %dn",i);
  22. sleep(1);
  23. }
  24. }
  25. printf("DONEn");
  26. return 0;
  27. }
  28.  
  29. monet:~/Desktop% ./p3
  30. Assign3.asm~ client.c~ p1 p2 p3 p4.c
  31. client clientList.txt~ p1.c p2.c p3.c p4.c~
  32. clientbroadcastlistner output.c~ p1.c~ p2.c~ p3.c~ server
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement