bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gawk 3.1.0 getgroups problem


From: John H. DuBois III
Subject: gawk 3.1.0 getgroups problem
Date: Mon, 3 Dec 2001 01:06:26 -0800

Under SCO OpenServer 5.0.6a using gawk 3.1.0 compiled with gcc 2.95.2, if a
process has more than 8 supplemental groups, any reference to PROCINFO[] gives:

$ gawk 'BEGIN{print PROCINFO["pid"]}'
gawk: cmd. line:1: fatal: could not find groups: Invalid argument

This is because gawk is using getgroups(8):

getgroups(8, 134508692) = EINVAL

The most common approach for determining the size of the array to pass to
getgroups is to first check how many groups the process is in:

getgroups(0, 0) = 18
malloc...
getgroups(18, 134559144) = 18

        John
--
John DuBois  address@hidden  KC6QKZ/AE  http://www.armory.com./~spcecdt/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]