From owner-freebsd-current Wed Apr 8 20:09:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA08763 for freebsd-current-outgoing; Wed, 8 Apr 1998 20:09:11 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA08754 for ; Wed, 8 Apr 1998 20:09:07 -0700 (PDT) (envelope-from tlambert@usr02.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id UAA18129; Wed, 8 Apr 1998 20:08:59 -0700 (MST) Received: from usr02.primenet.com(206.165.6.202) via SMTP by smtp04.primenet.com, id smtpd018092; Wed Apr 8 20:08:50 1998 Received: (from tlambert@localhost) by usr02.primenet.com (8.8.5/8.8.5) id UAA25433; Wed, 8 Apr 1998 20:08:48 -0700 (MST) From: Terry Lambert Message-Id: <199804090308.UAA25433@usr02.primenet.com> Subject: Re: /usr/include/pwd.h To: eivind@yes.no (Eivind Eklund) Date: Thu, 9 Apr 1998 03:08:47 +0000 (GMT) Cc: current@FreeBSD.ORG In-Reply-To: <19980407180754.16757@follo.net> from "Eivind Eklund" at Apr 7, 98 06:07:54 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Does anybody know why the uid and gid field here are int's? (Looks > like hystorical raisons, as they haven't been changed since 4.4Lite). > > Can I change them to uid_t/gid_t, or at least to 'unsigned int' so > they match with chown(2)? I think there are two reasons: Non-opacity. The type is not opaque because of NIS. History. The value of "nobody" on old SunOS systems was "-1". I don't know if the 65534/65535 values are short-converted and sign extended and compared, as in "if( uid < 0)", but there used to be a lot of code that did this. You would really need to look hard to find this. I'm also not sure if there aren't libraries that overload uid return values with "-1" to return an error. I would guess that the value *must* be signed in case there were. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message