Like Topsy, UNIX growed uids and gids, as is the Chibi Scheme SRFI-170 implementation
hga@xxxxxx
(27 Jul 2019 22:20 UTC)
|
Re: Like Topsy, UNIX growed uids and gids, as is the Chibi Scheme SRFI-170 implementation
Lassi Kortela
(28 Jul 2019 14:23 UTC)
|
Re: Like Topsy, UNIX growed uids and gids, as is the Chibi Scheme SRFI-170 implementation
John Cowan
(28 Jul 2019 22:10 UTC)
|
Re: Like Topsy, UNIX growed uids and gids, as is the Chibi Scheme SRFI-170 implementation
Arthur A. Gleckler
(29 Jul 2019 03:22 UTC)
|
Re: Like Topsy, UNIX growed uids and gids, as is the Chibi Scheme SRFI-170 implementation Lassi Kortela (29 Jul 2019 06:24 UTC)
|
Re: Like Topsy, UNIX growed uids and gids, as is the Chibi Scheme SRFI-170 implementation
hga@xxxxxx
(29 Jul 2019 21:22 UTC)
|
Re: Like Topsy, UNIX growed uids and gids, as is the Chibi Scheme SRFI-170 implementation
John Cowan
(30 Jul 2019 16:00 UTC)
|
Re: Like Topsy, UNIX growed uids and gids, as is the Chibi Scheme SRFI-170 implementation Lassi Kortela 29 Jul 2019 06:24 UTC
> | * Call count = getgroups(0, NULL) to get the actual count. > | * Then call getgroups(count, gid_array); > | > | I prefer this strategy. > > It looks like one still has to account for a race > condition with this approach. ...and the prize goes to Arthur :) The version where the group list doubles in size every call is safer. The Unix process would have to keep doubling the number of groups it's in faster than the Scheme code makes new getgroups() calls, which for all practical purposes is impossible. And with a reasonable initial group list size, this version will have to make only one getgroups() call, whereas the "count = getgroups(0, NULL)" version will have to make two calls every time.