From owner-freebsd-hackers@freebsd.org Wed Feb 14 16:35:44 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E112F0C8F3 for ; Wed, 14 Feb 2018 16:35:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCF3C80C81 for ; Wed, 14 Feb 2018 16:35:43 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0a25691d-11a5-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 0a25691d-11a5-11e8-b951-f99fef315fd9; Wed, 14 Feb 2018 16:35:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1EGZcPe040863; Wed, 14 Feb 2018 09:35:38 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518626138.72050.29.camel@freebsd.org> Subject: Re: select call in devd From: Ian Lepore To: Eric van Gyzen , Warner Losh , Eitan Adler Cc: FreeBSD Hackers , zrj@dragonflybsd.org Date: Wed, 14 Feb 2018 09:35:38 -0700 In-Reply-To: <76665530-c7f1-cbe7-252b-a1d146b0f51d@vangyzen.net> References: <76665530-c7f1-cbe7-252b-a1d146b0f51d@vangyzen.net> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 16:35:44 -0000 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 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