This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

getlogin() thoughts


I've been playing around with the difficulties of getlogin() and output
redirection recently, and have two thoughts - 

1.  It seems that since libc6 only stdin is checked for tty-ness.  In
libc5 stdin, stdout, or stderr could all be checked, allowing it to
function even if two of those were not ttys.  Is readding this in any
way desirable?

2.  The note in getlogin() says that the expectation is to return the
tty associated with fd 0.  Under that, however, it mentions that using
the fd associated with open("/dev/tty") is not an alternative.  There
is an effective alternative, however: /proc/self/stat's seventh field
is the major and minor number of the current process's controlling tty. 
Just throwing that out in case anyone thinks it might be a useful
alternative.

Dan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]