From c8727fa6e5073d28ed6d0eb40a006ac2c1b9f9f3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 24 Mar 2010 17:02:57 -0700 Subject: 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. --- include/unistd.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') 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 -- cgit v1.2.3