From owner-freebsd-hackers@freebsd.org Wed Feb 14 15:13:56 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 4F612F062C9 for ; Wed, 14 Feb 2018 15:13:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (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 D69947D0B8 for ; Wed, 14 Feb 2018 15:13:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id n7so25504944iob.0 for ; Wed, 14 Feb 2018 07:13:55 -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=bt83h21qclGemDPJogupNaweYP9ukKEIKXg2gDdAWHU=; b=SFbn11Qgb5HhXHicYkOfP/tJzdkh76mCx7ilGfZ9u6UG2Jpfy45TR8el/S9EJ7+QhT SDEAfqbFiCb4zC4EaBDLyPjc7I8Jp9RhCDdy1WCNIOwRQXs+FygL5LEMbLwVRe1DmJIR GYaArCYlc1UqxixVqr2ogo16dOlwBzh5jNTbZ6BVBU0eA+5Mx2GFMZtx9gvw/Wh9WfKE jzZ6TZjMYArgqhAPc9DI5nDfTwaObGk/AdBMF+kkXC0nfBs6kp8coCX7fVxEb+WTPoHz xXwqLWNNjSaF+2BICuG6NkaNjt7/1NdmOYtzvp4hTRsgLEwUqZSyAVtY3Bk5gQAnwCm/ bQDA== 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=bt83h21qclGemDPJogupNaweYP9ukKEIKXg2gDdAWHU=; b=a0i+qJghs59IcLRbZuTatABkaQONlUlqdwgWLU9IWcrKKxkvcbN866fJ0AYqxdO7kr zvehvOyhgiZKmhG6UOpF3poIwHk4Xo4yT4gSru4QbBvxvbUGABeHaIYtDW+CIupH6Zzh RUKwaMlpw2wqA1nV1PQJn5hXUn4zQ94ubVtBzJB0IAKYbec7UUt6pneRt5kK2vrqCSHD TzR0/xjcHPXGyWSzhcj0iPKVxVxVis9tXWyE2Up1HRdOmu0DnmFr5Shy3jElIQrOb4Zt WpUY9kPQeFuA1pksOQnPCYZip2WC4Yg5IwDetRVVjnbGkZ3sO6g9Nu6yuyr9KVPTFWAA Oouw== X-Gm-Message-State: APf1xPAGCoyiBfiKUWNtLZTqIlMzM8+YdlgCKFBcav03zu2GkJdn/WTC VOguTpsRB2vA8ga6Dyt99IPVTzS01dHF+tCZw7a+Ug== X-Google-Smtp-Source: AH8x225N4ceXGxUnqyhy5pVLPvKLe2AuraCeXe0l2jrNdIjaii9aOLA5SAMtAqxXR0V3wsjJMqq/7ujYmBHZ2GN4eiQ= X-Received: by 10.107.107.1 with SMTP id g1mr5749272ioc.63.1518621235113; Wed, 14 Feb 2018 07:13:55 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 14 Feb 2018 07:13:54 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: From: Warner Losh Date: Wed, 14 Feb 2018 08:13:54 -0700 X-Google-Sender-Auth: qaR4ColaZ99qoRNqjUs8Etjsuh4 Message-ID: Subject: Re: select call in devd To: Eitan Adler Cc: 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 15:13:56 -0000 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. 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 >