chflags(2)'s flags argument.
Konstantin Belousov
kostikbel at gmail.com
Sun Mar 17 06:41:36 UTC 2013
On Sun, Mar 17, 2013 at 01:35:59AM +0100, Pawel Jakub Dawidek wrote:
> Hi.
>
> Currently this is a bit messy: chflags(2) and fchflags(2) take 'flags'
> argument of type unsigned long and lchflags(2) takes the same argument
> of type int. At least this is what you can see in manual page and in
> prototypes of those functions in sys/stat.h.
>
> However all of those syscalls are defined in syscalls.master to take the
> 'flags' argument of type int and this is what they use in kernel.
>
> I'd like to proposed the following patch:
>
> http://people.freebsd.org/~pjd/patches/chflags_int.patch
>
> It changes type of the 'flags' argument from unsigned long to int where
> possible.
>
> I believe this change won't break ABI, as the syscalls (apart from the
> prototypes) already expect int and I hope in doesn't break API in any
> really visible and destructive way. If you think otherwise, let me know.
The patch seems to keep ABI intact for all useful purposes, at least
on all architectures the FreeBSD supports. A FreeBSD architecture where
sizeof(int) != sizeof(long), uses register calling conventions.
Please note that API != ABI, and you found a case where the API
is broken indeed by your change.
>
> Note that the patch doesn't touch the strtofflags(3) function, as I
> believe it would break ABI and it doesn't touch the fflagstostr(3)
> function to stay consistent with strtofflags(3).
>
> PS. Manual page text provided by jilles.
>
> --
> Pawel Jakub Dawidek http://www.wheelsystems.com
> FreeBSD committer http://www.FreeBSD.org
> Am I Evil? Yes, I Am! http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20130317/64622037/attachment.sig>
More information about the freebsd-arch
mailing list