This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Re: ttyname() and linux+devfs
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