Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2018 09:51:53 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        Eric van Gyzen <eric@vangyzen.net>, Eitan Adler <lists@eitanadler.com>,  FreeBSD Hackers <freebsd-hackers@freebsd.org>, zrj@dragonflybsd.org
Subject:   Re: select call in devd
Message-ID:  <CANCZdfo=TmCbY1iWYyp0m1c_AabeJ_bqC34fSK7gMsVwKJuRxw@mail.gmail.com>
In-Reply-To: <1518626138.72050.29.camel@freebsd.org>
References:  <CAF6rxgmrkUS18kVPCK1VkBJAhBQ2vY3_MJgq%2BXNjqcx8yFi7Lw@mail.gmail.com> <CANCZdfpVqqgCmwJqKfdwWEntZgOeo7dpTbs5ab8-W5Lo6pz1zw@mail.gmail.com> <76665530-c7f1-cbe7-252b-a1d146b0f51d@vangyzen.net> <1518626138.72050.29.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 14, 2018 at 9:35 AM, Ian Lepore <ian@freebsd.org> wrote:

> 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@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.
>

Yea. Poll is likely a better interface.

Warner



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