From owner-freebsd-arch@FreeBSD.ORG Mon Mar 18 21:06:46 2013 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8227BB63 for ; Mon, 18 Mar 2013 21:06:46 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC98AC4 for ; Mon, 18 Mar 2013 21:06:45 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E446D707; Mon, 18 Mar 2013 22:03:22 +0100 (CET) Date: Mon, 18 Mar 2013 22:08:17 +0100 From: Pawel Jakub Dawidek To: Bruce Evans Subject: Re: chflags(2)'s flags argument. Message-ID: <20130318210817.GA1367@garage.freebsd.pl> References: <20130317003559.GA1364@garage.freebsd.pl> <20130317064123.GM3794@kib.kiev.ua> <20130317111112.GC1364@garage.freebsd.pl> <20130317155743.GR3794@kib.kiev.ua> <20130317162021.GG1364@garage.freebsd.pl> <20130317162533.GT3794@kib.kiev.ua> <20130317164632.GI1364@garage.freebsd.pl> <20130317174205.GU3794@kib.kiev.ua> <20130317211027.GJ1364@garage.freebsd.pl> <20130318155059.V925@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <20130318155059.V925@besplex.bde.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2013 21:06:46 -0000 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 18, 2013 at 04:51:22PM +1100, Bruce Evans wrote: > On Sun, 17 Mar 2013, Pawel Jakub Dawidek wrote: > > Maybe we could arrange ports build with lchflags(2) changed to take > > unsigned long to see how destructive the change really is, because my > > expectation is that not very. >=20 > Why not use the correct type (u_int)? u_long is just too long, since > st_flags is only 32 bits, so much larger and realler API and ABI changes > would be needed to support more than 32 flags. I'd prefer leave u_long, as it breaks API as little as possible. This is also the type that's being used by consumers of this API, as it was documented in chflags(2) since forever. Also, as I already mentioned, strtofflags(3) and fflagstostr(3) uses this type too. > The garbage also has some style bugs. It spells "unsigned long" as > itself. All other code in chflags.c still uses the normal abbreviation > u_long. Using u_long for chflags() prototypes in sys/stat.h will only work, because of this: #if !defined(_KERNEL) && __BSD_VISIBLE /* * XXX We get miscellaneous namespace pollution with this. */ #include #endif As sys/time.h will include sys/types.h, eventhough sys/stat.h is trying to avoid that at the begining. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --ZGiS0Q5IWpPtfppv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlFHgkEACgkQForvXbEpPzQdUACeL0zb1OyES3PV70QqYXRwykGM kCYAoOvxRT7OhNWLP3lBeQOrALQFZpwd =1m5M -----END PGP SIGNATURE----- --ZGiS0Q5IWpPtfppv--