Date: Mon, 13 Mar 2000 08:27:07 -0800 (PST) From: John Polstra <jdp@polstra.com> To: keramida@ceid.upatras.gr Cc: current@freebsd.org Subject: Re: MAX_UID ? Message-ID: <200003131627.IAA52416@vashon.polstra.com> In-Reply-To: <20000313045401.A11429@hades.hell.gr> References: <38CAD957.3C839375@originative.co.uk> <20000313015009.A5653@hades.hell.gr> <200003130151.RAA51453@vashon.polstra.com> <20000313045401.A11429@hades.hell.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <20000313045401.A11429@hades.hell.gr>, Giorgos Keramidas <keramida@ceid.upatras.gr> wrote: > On Sun, Mar 12, 2000 at 05:51:17PM -0800, John Polstra wrote: > > In article <20000313015009.A5653@hades.hell.gr>, > > Giorgos Keramidas <keramida@ceid.upatras.gr> 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? Sorry, I wasn't clear. I was talking about the general case, not about uid_t in particular. John To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003131627.IAA52416>