guile-devel
[Top][All Lists]
Advanced

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

Re: setgroups


From: Paul Jarc
Subject: Re: setgroups
Date: Fri, 18 Apr 2003 12:00:40 -0400
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3 (gnu/linux)

Rob Browning <address@hidden> wrote:
> If there's nothing like GID_MAX, I guess we'll need to compute the
> fit manually.

unsigned long lgid = SCM_INUM (foo);
GETGROUPS_T gid = lgid;
if (gid < 0 || lgid != (unsigned long) gid) overflow;

- Is SCM_INUM guaranteed to fit in unsigned long?  If not, what type
  can we use instead?
- If GETGROUPS_T is signed and "gid = lgid" overflows, the C standard
  says it's undefined behavior.  Are we worried about that, or are we
  confident that it'll just wrap on platforms we care about?


paul




reply via email to

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