On Mon, 13 Mar 2000 13:07:47 +1100, Paul Richards <[EMAIL PROTECTED]> wrote:
>Peter Jeremy wrote:
>> You can do this now.  Just add the following:
>>         pid_t   UID_MAX = ~0;
>> somewhere before the code.
>
>I assume you meant uid_t,

Ooops, I did :-(.  And this should probably be
        uid_t   UID_MAX = ~0L;
to avoid problems if int != long (as John mentioned in passing).

>The actual limit is 4294967295, which is the largest number that will
>fit into the the 32-bit uid_t. This does work,

I had an idea that NFSv2 only allowed 16-bit UIDs, but I can't find
any code in FreeBSD, or the relevant RFCs, to support this (possibly
some NFS clients/servers ignore the top 16 bits).  I did notice,
however, that VNOVAL (-1) is used to mean the UID isn't present in
some places - and (uid_t)2^32-1 == (uid_t)-1.

On 2000-Mar-13 13:14:40 +1100, Paul Richards <[EMAIL PROTECTED]> wrote:
>#define UID_MAX ((uid_t)0-1)
...
>I can see the flaw in that straight away in that uid_t isn't available
>in <sys/syslimits.h>

Not a problem.  C macros are just text expansions.  The `uid_t' isn't
evaluated unless/until the macro is used - at which point uid_t must
be available.

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to