Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. int p_to_c[2];
  2. int c_to_p[2];
  3.  
  4. int pid = fork();
  5. if(pid == 0){
  6.     close(p_to_c[1]);
  7.     close(c_to_p[0]);
  8.     dup2(p_to_c[0], 0);
  9.     close(p_t_c[0]);
  10.     dup2(c_to_p[1], 1);
  11.     close(c_to_p[1]);
  12.     execl(/* irrelevant*/)
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement