This is the mail archive of the 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]
Other format: [Raw text]

Declare cuserid in unistd.h for UNIX98 and before (bug 20043)

For UNIX98 and older X/Open standards, unistd.h should have a
declaration of the legacy cuserid function, but such a declaration is
missing.  This patch adds that missing declaration.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

2016-05-04  Joseph Myers  <>

	[BZ #20043]
	* posix/unistd.h [__USE_XOPEN && !__USE_XOPEN2K] (cuserid): New

diff --git a/posix/unistd.h b/posix/unistd.h
index 405638c..f2ced41 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -1138,11 +1138,14 @@ extern void swab (const void *__restrict __from, void *__restrict __to,
-/* The Single Unix specification demands this prototype to be here.
-   It is also found in <stdio.h>.  */
+/* The Single Unix specification demands these prototype to be here.
+   They are also found in <stdio.h>.  */
 #if defined __USE_XOPEN && !defined __USE_XOPEN2K
 /* Return the name of the controlling terminal.  */
 extern char *ctermid (char *__s) __THROW;
+/* Return the name of the current user.  */
+extern char *cuserid (char *__s);

Joseph S. Myers

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