On Sun, Mar 12, 2000 at 05:51:17PM -0800, John Polstra wrote:
> In article <[EMAIL PROTECTED]>,
> Giorgos Keramidas  <[EMAIL PROTECTED]> wrote:
> > On Sun, Mar 12, 2000 at 05:59:09AM +0000, Paul Richards wrote:
> > > 
> > > Are expressions like ((uid_t)0-1) portable/safe ? Maybe that's a better
> > > way of approaching this.
> > 
> > To get the all-1's number, maybe it's better to use ((uid_t)~0), but
> > that is a rather controversial topic anyway.
> 
> That works, but on machines like the Alpha where longs are bigger
> than ints it only works by virtue of sign extension.  Our existing
> headers seem to prefer ((uid_t)0-1).  That's what is used in the
> i386's <machine/limits.h>.

My bummer, I thought the definition was the same in /sys/sys/types.h and
in /usr/include/sys/types.h -- and there I could see:

    % cd /sys ; grep uid sys/* | grep type
    sys/conf.h:typedef void devfs_create_t __P((dev_t dev, uid_t uid...
    sys/types.h:typedef     u_int32_t       uid_t;          /* user id */
    % cd /usr/include ; grep uid sys/* | grep type
    sys/conf.h:typedef void devfs_create_t __P((dev_t dev, uid_t uid...
    sys/types.h:typedef     u_int32_t       uid_t;          /* user id */

and I mistakenly assumed that both x86 and alpha's use uid_t's of 32
bits.  What did I miss?

- Giorgos


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

Reply via email to