ttyname() and linux+devfs

Dan Jacobowitz drow@false.org
Thu Oct 29 15:47:00 GMT 1998


On Thu, Oct 29, 1998 at 10:54:04PM +0100, Clifford Wolf wrote:
> That's a good question. Why don't making just a readlink() on
> /proc/self/fd/%d (where %d is the fd number)? Would be much faster
> than scanning /dev and works with all /dev structures ...
> 
> It would solve the symlink/real-device problem too: afaik the symlinks
> in /proc/self/fd/ point to the filenames which are passed to open() - and
> this are the filenames we would like to know.

Because this only works on moderately recent 2.1.x kernels.  2.0 stores
the device number there in some ugly form, leaving the need to walk
/dev.

Dan



More information about the Libc-alpha mailing list