select call in devd
Ian Lepore
ian at freebsd.org
Wed Feb 14 16:35:44 UTC 2018
On Wed, 2018-02-14 at 09:30 -0600, Eric van Gyzen wrote:
> On 02/14/2018 09:13, Warner Losh wrote:
> >
> > On Wed, Feb 14, 2018 at 12:13 AM, Eitan Adler <lists at eitanadler.com> wrote:
> >
> > >
> > > Hi all,
> > >
> > > select(2) is declared with restrict for the pointers for fd. Can y'all
> > > confirm this is the correct fix?
> > >
> > No. It's not. Select is not declared with restrict parameters. pselect is,
> > but select is not.
> You're right, it's not, but it /should/ be:
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html
>
> Issue 6
> The restrict keyword is added to the select() prototype for
> alignment with the ISO/IEC 9899:1999 standard.
>
> >
> > There's no real call to change it.
> ...unless he intends to mount a valiant effort to fix our declaration.
>
> Eric
The fix isn't correct because of posix and/or a restrict keyword so
much as being the right thing to do because the only fd in the fdset is
open O_RDONLY, and it's not a socket that can provide OOB
notifications, so the fdset should be passed only as the readfds
argument because the other two types of events just can't happen.
-- Ian
More information about the freebsd-hackers
mailing list