_GNU_SOURCE doesn't enable cuserid() declaration

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Nov 29 10:28:00 GMT 2018


On Nov 29 13:22, Tony Cook wrote:
> Linux stdio.h exposes the declaration of cuserid() both with standard
> version macros and with _GNU_SOURCE:
> 
> tony@mars:~/play$ cat testcuserid.c
> #define _GNU_SOURCE
> #include <stdio.h>
> 
> int main() {
>   puts(cuserid(NULL));
>   return 0;
> }
> tony@mars:~/play$ gcc -otestcuserid -Werror=all testcuserid.c
> tony@mars:~/play$ ./testcuserid
> tony
> tony@mars:~/play$ uname -a
> Linux mars 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
> 
> while on Cygwin _GNU_SOURCE doesn't expose cuserid():

Thanks, I pushed a patch.

https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=09870c6e958c

Of course, that doesn't make cuserid more portable.  The rule given in
the Linux man page still applies:  "Do not use cuserid()."


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20181129/6d83f56f/attachment.sig>


More information about the Cygwin mailing list