10 eval { my @n = getpwuid 0 };
11 $haspw = 1 unless $@ && $@ =~ /unimplemented/;
12 unless ($haspw) { print "1..0 # Skip: no getpwuid\n"; exit 0 }
14 $haspw = 0 unless $Config{'i_pwd'} eq 'define';
15 unless ($haspw) { print "1..0 # Skip: no pwd.h\n"; exit 0 }
19 our @pwent = getpwuid 0; # This is the function getpwuid.
20 unless (@pwent) { print "1..0 # Skip: no uid 0\n"; exit 0 }
29 my $pwent = getpwuid 0; # This is the OO getpwuid.
31 print "not " unless $pwent->uid == 0 ||
32 ($^O eq 'cygwin' && $pwent->uid == 500); # go figure
35 print "not " unless $pwent->name == $pwent[0];
38 print "not " unless $pwent->passwd eq $pwent[1];
41 print "not " unless $pwent->uid == $pwent[2];
44 print "not " unless $pwent->gid == $pwent[3];
47 # The quota and comment fields are unportable.
49 print "not " unless $pwent->gecos eq $pwent[6];
52 print "not " unless $pwent->dir eq $pwent[7];
55 print "not " unless $pwent->shell eq $pwent[8];
58 # The expire field is unportable.
60 # Testing pretty much anything else is unportable:
61 # there maybe more than one username with uid 0;
62 # uid 0's home directory may be "/" or "/root' or something else,