Date: Wed, 14 Feb 2018 08:13:54 -0700 From: Warner Losh <imp@bsdimp.com> To: Eitan Adler <lists@eitanadler.com> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org>, zrj@dragonflybsd.org Subject: Re: select call in devd Message-ID: <CANCZdfpVqqgCmwJqKfdwWEntZgOeo7dpTbs5ab8-W5Lo6pz1zw@mail.gmail.com> In-Reply-To: <CAF6rxgmrkUS18kVPCK1VkBJAhBQ2vY3_MJgq%2BXNjqcx8yFi7Lw@mail.gmail.com> References: <CAF6rxgmrkUS18kVPCK1VkBJAhBQ2vY3_MJgq%2BXNjqcx8yFi7Lw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
There's no real call to change it.
Warner
> It is only lightly tested (it seems to do its job on my machine)
>
> Index: devd.cc
> ===================================================================
> --- devd.cc (revision 329192)
> +++ devd.cc (working copy)
> @@ -1021,7 +1021,7 @@ event_loop(void)
> tv.tv_usec = 0;
> FD_ZERO(&fds);
> FD_SET(fd, &fds);
> - rv = select(fd + 1, &fds, &fds, &fds, &tv);
> + rv = select(fd + 1, &fds, NULL, NULL, &tv);
> // No events -> we've processed all pending events
> if (rv == 0) {
> devdlog(LOG_DEBUG, "Calling daemon\n");
>
>
> --
> Eitan Adler
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpVqqgCmwJqKfdwWEntZgOeo7dpTbs5ab8-W5Lo6pz1zw>
