|
In the case of "prog_a | prog_b", prog_b won't have any name associated with FD 0. There are lots of problems like that. lsof is a program that can display pretty good info for most FD's of most processes, but it must run suid'ed to root. Get lsof and run it to see if that sort of info could help you. If so, use popen() to run lsof from your process and parse the lsof output to get what you need. Something like this is the only way.
|