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

next in thread | previous in thread | raw e-mail | index | archive | help
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.

-- Ian




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