Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Sep 2019 22:37:56 +0200
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r352795 - head/lib/libc/sys
Message-ID:  <CAGudoHFhMRFm_qvXHZ4MsHGtv74w0_CLdOG3QojeC=ZxDTYZvQ@mail.gmail.com>
In-Reply-To: <20190927184623.GM44691@kib.kiev.ua>
References:  <201909271611.x8RGBl0H036116@repo.freebsd.org> <CAGudoHF454hyHeS_HayGRJYRpSfo9B9wwU4hVBxjcmAk0HEeJg@mail.gmail.com> <20190927184623.GM44691@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/27/19, Konstantin Belousov <kostikbel@gmail.com> wrote:
> On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote:
>> On 9/27/19, Warner Losh <imp@freebsd.org> wrote:
>> >   Document varadic args as int, since you can't have short varadic args
>> > (they are
>> >   promoted to ints).
>> >
>> >   - `mode_t` is `uint16_t` (`sys/sys/_types.h`)
>> >   - `openat` takes variadic args
>> >   - variadic args cannot be 16-bit, and indeed the code uses int
>> >   - the manpage currently kinda implies the argument is 16-bit by
>> > saying
>> > `mode_t`
>> >
>> But opengroup says it is mode_t. Perhaps it is mode_t which needs
>> to be changed?
>
> Yes, users must pass mode_t, and the man page is written for users.
> Implementation needs to be aware of the implicit promotion and handle
> it accordingly.
>
> In theory, mode_t might be wider than int.
>

So I think the change should be reverted. Whatever workaround is being
in place in rust should remain for the current codebase.

If anyone is to fixed the problem they should bump mode_t to uint32_t,
to match Linux. This is ABI breakage, I don't know how that's handled.

I have no interest in handling any of this, but the change committed
is definitely wrong.

-- 
Mateusz Guzik <mjguzik gmail.com>



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