Question regarding /proc/<pid>/fd and pipes

From: John Schmerge
Date: Wed Feb 08 2006 - 02:25:11 EST


Hi all,

I'm attempting to track down a spooky problem with some code that I've
written (running under the 2.6.11.12 kernel) and am wondering if there's a
way to track (via /proc) both ends of an open pipe that was created with a
pipe(2) system call... It appears that I've got a bunch of spawned
processes stuck in some kind of sleep caused by a read(2) on the
read-end of a pipe and would like to eliminate the possibility that I've
done something truly bone-headed in my code like leaving the write-end
of the pipe open in another process. (I don't think I did, but want to
be sure :).

I know that the symlinks in the /proc/<pid>/fd directory point to
bogus filenames for pipes (i.e. 'pipe:[64682]') and am wondering if
every process that reads and writes from that pipe will share the same
bogus symlink name.

In essence, I'm wondering if there's any way to list all of the pid's
of processes using an anonomous pipe.

Please CC me on any answers.

Thanks,
John
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/