Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2013 22:08:17 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, freebsd-arch@FreeBSD.org
Subject:   Re: chflags(2)'s flags argument.
Message-ID:  <20130318210817.GA1367@garage.freebsd.pl>
In-Reply-To: <20130318155059.V925@besplex.bde.org>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <sys/time.h>
#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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130318210817.GA1367>