Question

I called strace on some program A which forks two child programs: B and C.

In strace, I have the following syscalls:

 pipe[([3,4]) = 0
 pipe([5,6]) = 0
 fork(wc) = 7135
 fork (gnetcat) = 7136
 close(3) = 0
 close(5) = 0
 close(4) = 0
 close(6) = 0
 wait4(-1, NULL, 0, NULL) = 7136
 wait4(-1, NUKLL, 0, NULL) = 7135

I am trying to rewrite the program A in C. In that case, I really never really have to know what those file descriptors 3,4,5 and 6 stand for, do I? Is there a way to find out what they are? I know 3 is for stderr.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top