Article View: comp.sys.masscomp
Article #118Problem with "getgroups" system call
From: Joe Buck
Date: Tue, 15 Mar 1988 06:18
Date: Tue, 15 Mar 1988 06:18
28 lines
1239 bytes
1239 bytes
I first noticed this when building "perl".
On RTU 3.1 on our 5600, the man page for "getgroups"
claims that the groups array consists of unsigned shorts.
After doing a few experiments, I find that it does not;
I only get consistent results when I pass it an array
of ints or unsigned ints. It's easy to duplicate this;
from an account that is in more than one group, run the
program
main () {
int gary[32];
int i = getgroups(32,gary), j;
for (j = 0; j < i; j++) printf ("%d ", gary[j]);
printf ("\n");
}
The results will be correct. Change the declaration of
gary to "unsigned short" as described in the man page
and the program no longer works.
So what gives?
--
- Joe Buck {uunet,ucbvax,sun,<smart-site>}!epimass.epi.com!jbuck
Old Internet mailers: jbuck%epimass.epi.com@uunet.uu.net
Technical Details
Message-ID:
<3351@soma.bcm.tmc.edu>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!ut-sally!bcm!soma!masscomp-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!ut-sally!bcm!soma!masscomp-request From: jbuck@epimass.epi.com (Joe Buck) Newsgroups: comp.sys.masscomp Subject: Problem with "getgroups" system call Message-ID: <3351@soma.bcm.tmc.edu> Date: 15 Mar 88 06:18:25 GMT Sender: masscomp@soma.bcm.tmc.edu Organization: Entropic Processing, Inc., Cupertino, CA Lines: 28 Approved: masscomp@soma.bcm.tmc.edu