public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Declare cuserid in unistd.h for UNIX98 and before (bug 20043)
@ 2016-05-04 15:48 Joseph Myers
  2016-05-04 16:05 ` Zack Weinberg
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2016-05-04 15:48 UTC (permalink / raw)
  To: libc-alpha

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  <joseph@codesourcery.com>

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

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,
 #endif
 
 
-/* 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);
 #endif
 
 

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Declare cuserid in unistd.h for UNIX98 and before (bug 20043)
  2016-05-04 15:48 Declare cuserid in unistd.h for UNIX98 and before (bug 20043) Joseph Myers
@ 2016-05-04 16:05 ` Zack Weinberg
  2016-05-04 16:14   ` Joseph Myers
  0 siblings, 1 reply; 5+ messages in thread
From: Zack Weinberg @ 2016-05-04 16:05 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GNU C Library

On Wed, May 4, 2016 at 11:48 AM, Joseph Myers <joseph@codesourcery.com> wrote:
>
> -/* 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>.  */

Since you're touching this comment anyway, would you mind fixing the
grammar and clarifying which version(s) of SUS are meant? I would
suggest something along the lines of

/* Prior to Issue 6, the Single Unix specification required these prototypes
   to appear in this header.  They are also found in <stdio.h>.  */

only with the correct version information.

zw

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Declare cuserid in unistd.h for UNIX98 and before (bug 20043)
  2016-05-04 16:05 ` Zack Weinberg
@ 2016-05-04 16:14   ` Joseph Myers
  2016-05-09 21:14     ` Ping " Joseph Myers
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2016-05-04 16:14 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: GNU C Library

On Wed, 4 May 2016, Zack Weinberg wrote:

> On Wed, May 4, 2016 at 11:48 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> >
> > -/* 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>.  */
> 
> Since you're touching this comment anyway, would you mind fixing the
> grammar and clarifying which version(s) of SUS are meant? I would
> suggest something along the lines of
> 
> /* Prior to Issue 6, the Single Unix specification required these prototypes
>    to appear in this header.  They are also found in <stdio.h>.  */
> 
> only with the correct version information.

I think that's correct (with capital S on Specification); SUSv2 = Issue 5.

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  <joseph@codesourcery.com>

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

diff --git a/posix/unistd.h b/posix/unistd.h
index 405638c..4722f7f 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -1138,11 +1138,15 @@ extern void swab (const void *__restrict __from, void *__restrict __to,
 #endif
 
 
-/* The Single Unix specification demands this prototype to be here.
-   It is also found in <stdio.h>.  */
+/* Prior to Issue 6, the Single Unix Specification required these
+   prototypes to appear in this header.  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);
 #endif
 
 

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Ping Re: Declare cuserid in unistd.h for UNIX98 and before (bug 20043)
  2016-05-04 16:14   ` Joseph Myers
@ 2016-05-09 21:14     ` Joseph Myers
  2016-05-10 14:55       ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2016-05-09 21:14 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: GNU C Library

Ping.  This patch 
<https://sourceware.org/ml/libc-alpha/2016-05/msg00054.html> is pending 
review.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Ping Re: Declare cuserid in unistd.h for UNIX98 and before (bug 20043)
  2016-05-09 21:14     ` Ping " Joseph Myers
@ 2016-05-10 14:55       ` Paul Eggert
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggert @ 2016-05-10 14:55 UTC (permalink / raw)
  To: Joseph Myers, Zack Weinberg; +Cc: GNU C Library

On 05/09/2016 02:13 PM, Joseph Myers wrote:
> Ping.  This patch
> <https://sourceware.org/ml/libc-alpha/2016-05/msg00054.html> is pending
> review.
>
Thanks, that looks good to me.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-10 14:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-04 15:48 Declare cuserid in unistd.h for UNIX98 and before (bug 20043) Joseph Myers
2016-05-04 16:05 ` Zack Weinberg
2016-05-04 16:14   ` Joseph Myers
2016-05-09 21:14     ` Ping " Joseph Myers
2016-05-10 14:55       ` Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).