From owner-freebsd-hackers@freebsd.org Wed Feb 21 04:52:02 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 92816F031CF for ; Wed, 21 Feb 2018 04:52:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (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 2915F8582F for ; Wed, 21 Feb 2018 04:52:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22a.google.com with SMTP id l34so129883ywk.11 for ; Tue, 20 Feb 2018 20:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=87+jY1Jz7UxZaZvpNHNkdVrbgGotLdqJrBJ6d1BgE50=; b=glEIgpkll3IqLn8kj7gfIgyizcHGLyf+n8QumDjU2OJKDNNDCXCAA9juJMjq679L61 mc93RCjCXU1OJPNMVAgE8Q4ATopXBOFSai99cMj1j2HmA3zrDRwmbMXQTH7we1dL6W9n udb7h5FdUM7H3TslJhPY8qzYaYshBnybWGwo8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=87+jY1Jz7UxZaZvpNHNkdVrbgGotLdqJrBJ6d1BgE50=; b=J/CJurl/B2v+vry2O7WsGAWC6l4D3vAa5MwtN5k3RvGcI5cnb8LZZDaclcxFn/EAhq n/vnI8dvHt0MX+fBJFqu4RIOdcX7YZfWf2LwmVVhXhsixhS8R2GkyBzYy53KCHCFM1e1 ZSTwd+7Vb9xQW9+0yN6J9b2T1JulETwqbKFnTRc1ZZXWC/0QgzVnHEim84ssgK9/qk41 lwlc7LXApm35QvE3UZ0n1HCTs8ei4/KfgnhlnUnKJca6BSA6ywFtLnFbiI8NRy33/xOv MZMllIWCMUheTM7Vv2uWOt0B3fLWcMK1NiNd+lPjyN+PMFrilz61ALHazYjDhhilAMdt Tavg== X-Gm-Message-State: APf1xPCv+cyL7gWt8xjHYvHl7OQwrdpHtyXWyxeTFM9Y6SQdIqdCnn2E 32FRun5ChoBlqaSiQ3NeeFmT3jbclE6e56dE/R5n0w== X-Google-Smtp-Source: AH8x226+5NxN/OfgBLzVW91wh20LM03CDGT1yvkMZ+5nMz0wKtG0kFt6nWhHy6C9Igr5NKKH7pNBGS9Kc3ZoKkPBFdM= X-Received: by 10.13.214.214 with SMTP id y205mr1416048ywd.37.1519188721582; Tue, 20 Feb 2018 20:52:01 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:dfcb:0:0:0:0:0 with HTTP; Tue, 20 Feb 2018 20:52:00 -0800 (PST) In-Reply-To: <20180221032247.GA81670@ns.kevlo.org> References: <20180221032247.GA81670@ns.kevlo.org> From: Eitan Adler Date: Tue, 20 Feb 2018 20:52:00 -0800 Message-ID: Subject: Re: Marking select(2) as restrict To: Kevin Lo , FreeBSD Standards Cc: FreeBSD Hackers , Warner Losh 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, 21 Feb 2018 04:52:02 -0000 Adding standards mailing list On Tuesday, 20 February 2018, Kevin Lo wrote: > On Tue, Feb 20, 2018 at 04:29:59PM -0800, Eitan Adler wrote: > > > > I filed a request for a slightly modified version of this patch to be > > exp-run. I'm planning on committing unless there is significant > > fallout or objections on this list. > > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225981 > > Please send your patch to standards@. The freebsd-standards mailing list > was created for precisely this purpose, thanks. > > > On 15 February 2018 at 00:10, Eitan Adler wrote: > > > Hi all, > > > > > > POSIX requires that the fd_set arguments in select(2) be marked as > > > restrict. This patch attempts to implement that. > > > > > > (a) Am I missing anything? > > > (b) Anything in particular to watch out for? > > > (c) Assuming an exp-run passes any reason not to commit? > > > > > > > > > Index: lib/libc/sys/select.2 > > > =================================================================== > > > --- lib/libc/sys/select.2 (revision 329296) > > > +++ lib/libc/sys/select.2 (working copy) > > > @@ -39,7 +39,7 @@ > > > .Sh SYNOPSIS > > > .In sys/select.h > > > .Ft int > > > -.Fn select "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set > > > *exceptfds" "struct timeval *timeout" > > > +.Fn select "int nfds" "fd_set * restrict readfds" "fd_set * restrict > > > writefds" "fd_set * restrict exceptfds" "struct timeval *timeout" > > > .Fn FD_SET fd &fdset > > > .Fn FD_CLR fd &fdset > > > .Fn FD_ISSET fd &fdset > > > Index: lib/libc/sys/select.c > > > =================================================================== > > > --- lib/libc/sys/select.c (revision 329296) > > > +++ lib/libc/sys/select.c (working copy) > > > @@ -41,7 +41,7 @@ __weak_reference(__sys_select, __select); > > > > > > #pragma weak select > > > int > > > -select(int n, fd_set *rs, fd_set *ws, fd_set *es, struct timeval *t) > > > +select(int n, fd_set * restrict rs, fd_set * restrict ws, fd_set * > > > restrict es, struct timeval *t) > > > { > > > > > > return (((int (*)(int, fd_set *, fd_set *, fd_set *, struct timeval > *)) > > > Index: sys/sys/select.h > > > =================================================================== > > > --- sys/sys/select.h (revision 329296) > > > +++ sys/sys/select.h (working copy) > > > @@ -101,8 +101,7 @@ int pselect(int, fd_set *__restrict, fd_set *__res > > > const struct timespec *__restrict, const sigset_t *__restrict); > > > #ifndef _SELECT_DECLARED > > > #define _SELECT_DECLARED > > > -/* XXX missing restrict type-qualifier */ > > > -int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); > > > +int select(int, fd_set *__restrict, fd_set *__restrict, fd_set > > > *__restrict, struct timeval *); > > > #endif > > > __END_DECLS > > > #endif /* !_KERNEL */ > > > > > > > > > -- > > > Eitan Adler > > > > > > > > -- > > Eitan Adler > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > > > -- Sent from my Turing Machine