The man page of getlogin(3) says that L_cuserid is declared in
<stdio.h>. But if I try to compile (gcc-4.7.0-5.fc17.x86_64) a little
source using L_cuserid
#include <unistd.h>
#include <stdio.h>
main () {
fprintf (stderr,"L_cuserid = %d",L_cuserid);
}
I get an error:
x.c: In function ‘main’:
x.c:4:34: error: ‘L_cuserid’ undeclared (first use in this function)
x.c:4:34: note: each undeclared identifier is reported only once for
each function it appears in
The source compiles correctly if I use -D_XOPEN_SOURCE
Kind regards
--
Joachim Backes <joachim.backes(a)rhrk.uni-kl.de>
https://www-user.rhrk.uni-kl.de/~backes
On 07/23/2012 07:56 AM, Joachim Backes wrote:
> #include <unistd.h>
> #include <stdio.h>
> main () {
> fprintf (stderr,"L_cuserid = %d",L_cuserid);
> }
Do you need to add -D_GNU_SOURCE to your compile line?