Problems with /proc/*/fd/*

Frank Racis (
Tue, 10 Oct 1995 12:56:50 -0400

I've been having a problem in recent kernels (1.3.30-32, don't know about
older ones) with the process /fd entries in /proc. All the fd's show
up in ls, but they can't be written to or read from. Bash gives "no
such file or directory"

I tracked down where the error actually occurs. It's in file
fs/proc/link.c in the function proc_fd_dupf. The error comes from
the "if (fd>=NR_OPEN) return -ENOENT /* should never happen */"
statement. The file descriptor comparison loop is failing. I don't
know exactly how this is supposed to work, so I don't know _why_ this
loop fails. Could someone take a look at this?