This is the mail archive of the cygwin mailing list for the Cygwin 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]

Re: _GNU_SOURCE doesn't enable cuserid() declaration


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

Attachment: signature.asc
Description: PGP signature


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