From owner-freebsd-hackers@freebsd.org Wed Feb 14 16:51:55 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 32565F0DC5D for ; Wed, 14 Feb 2018 16:51:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B76B1819A8 for ; Wed, 14 Feb 2018 16:51:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id 72so25830331iom.10 for ; Wed, 14 Feb 2018 08:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=jPxaHsuA0jmkOPN1Ja91SjqcKpBsOZssGop2duUCUlQ=; b=Ttr5MVSuvAjMIRWQDT0SyoqI5owtZpEj1vNCUFK8iQUIIOCi64ZudOgmPjGgZpgg5s EvW0aWXgDKO8ulJRvRnBwUJxO+LB2z8t8+DXf0Fa+Jn694Nw27WKgQfDkg1HEf1v7pp8 JK0OvYZWWplDEMCe1UkoUiXmSGD78TINNe+X+71rsf6bhauvsjOZZfzwYZzaPfchk8JS CaSfS/jG5Fa3aNnCMqMHXCtNmSAbfBOd5UbOqQRGK/r5a+VfnNdmbtESjRwbl1Zogagh 3rwpMnf9AHVuOy+YcDxYgPCZ/dT3qjGhENocaObnfSLIkMOiIlRp5kCABppwq4M3sfYE 9gFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=jPxaHsuA0jmkOPN1Ja91SjqcKpBsOZssGop2duUCUlQ=; b=Pr1cbig6VpfXwlIto4SWz9A9pxOt6fjU3HnSGpBgNUOh3TlxWwC1DFcYonNlLu54ZK uJzTvXzXTvxGYaxlPyZQFDDP/cxVCcKrj/nPm0IbvYyQ168446LBQetVjRb4Ko+Pv1Rv KfZkYIjSyo3bq4er54zeSKYWDV1wWU2rrlgVQHniPdv/sjDBIfkWNUHkeqGZ/KzGhPG2 igZLkvuJ7OemHpGSR7OAyOYuFzGHBkws6AxKPB4WL+dTW2E2Zgc9nnxBIzOJVMSLHqWo SmWKs9SaCrzgXJaMwSXi16W4O0Pgj2EUKqso1JU9lwH+n88U7oSM3/r6x4N0dSobmhHJ GtHw== X-Gm-Message-State: APf1xPAL3RNtcT8rNwHliVGvuyIvZp19WiFd0m4KzjeDiXUHYmVhveTf N133Yi+KlKWc3FY8KY6SHxNoZ2xhmC3O/GB++GjwWw== X-Google-Smtp-Source: AH8x226EIkaulc1/m3XnfzYsw+j0za762TLSnPkoBVVqw0mQs4GgOqICB18/CRwRy6EvYX2pvNDlcxs36XpFWgJczX0= X-Received: by 10.107.167.69 with SMTP id q66mr6085669ioe.130.1518627113934; Wed, 14 Feb 2018 08:51:53 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 08:51:53 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <1518626138.72050.29.camel@freebsd.org> References: <76665530-c7f1-cbe7-252b-a1d146b0f51d@vangyzen.net> <1518626138.72050.29.camel@freebsd.org> From: Warner Losh Date: Wed, 14 Feb 2018 09:51:53 -0700 X-Google-Sender-Auth: sbrccHxfuqjH8x_viGIzWcImls4 Message-ID: Subject: Re: select call in devd To: Ian Lepore Cc: Eric van Gyzen , Eitan Adler , FreeBSD Hackers , zrj@dragonflybsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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:51:55 -0000 On Wed, Feb 14, 2018 at 9:35 AM, Ian Lepore 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 > 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