summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2010-03-24 17:02:57 -0700
committerUlrich Drepper <drepper@redhat.com>2010-03-24 17:02:57 -0700
commitc8727fa6e5073d28ed6d0eb40a006ac2c1b9f9f3 (patch)
tree23369e9301bb60abd73e4384e7974fa32acd6e57 /include
parentfd8ccb0427569ffdfbb70c8828029122f3459160 (diff)
downloadglibc-c8727fa6e5073d28ed6d0eb40a006ac2c1b9f9f3.tar.gz
glibc-c8727fa6e5073d28ed6d0eb40a006ac2c1b9f9f3.tar.xz
glibc-c8727fa6e5073d28ed6d0eb40a006ac2c1b9f9f3.zip
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.
Diffstat (limited to 'include')
-rw-r--r--include/unistd.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h
index ccba893abe..0ad2983280 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -176,6 +176,9 @@ extern int __have_sock_cloexec;
    unless it is really necessary.  */
 #define __have_pipe2 __have_sock_cloexec
 
+extern int __getlogin_r_loginuid (char *name, size_t namesize)
+     attribute_hidden;
+
 __END_DECLS
 
 #endif