Fix Linux getlogin{_r,} implementation
commitc8727fa6e5073d28ed6d0eb40a006ac2c1b9f9f3
authorUlrich Drepper <drepper@redhat.com>
Thu, 25 Mar 2010 00:02:57 +0000 (24 17:02 -0700)
committerUlrich Drepper <drepper@redhat.com>
Thu, 25 Mar 2010 00:02:57 +0000 (24 17:02 -0700)
tree23369e9301bb60abd73e4384e7974fa32acd6e57
parentfd8ccb0427569ffdfbb70c8828029122f3459160
Fix Linux getlogin{_r,} implementation

The old implementation uses fd 0 to determine the login TTY.  This
was needed because using /dev/tty it is not possible to deduce the
login TTY.  For some time now there is the pseudo-file
/proc/self/loginuid which directly helps us to find the user.  Prefer
using this file.  It also works if stdin is closed, redirected, or
re-opened.
ChangeLog
include/unistd.h
sysdeps/unix/getlogin.c
sysdeps/unix/getlogin_r.c
sysdeps/unix/sysv/linux/getlogin.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/getlogin_r.c [new file with mode: 0644]