From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 371023858038 for ; Sat, 20 Feb 2021 14:36:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 371023858038 Received: by mail-ej1-x62c.google.com with SMTP id hs11so21328433ejc.1 for ; Sat, 20 Feb 2021 06:36:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NaPq4c3HAhBB+A+0TCdWGsnwqkiGnJY79Wn767d9k4k=; b=UBKg1lgUKL8ZpjzZaf3PxRgvTrvihBq9tYNZjFDcx8XBHOjotcQupUjNIT9Ou8E5iD hhiaDroImI42ZFN2pqWfwybjEOM5/ThJ1Z9JE4ea8AyPFNGPZtIMxQj0w7iG+el0B0KJ 1f+nfXzNYH5hlRbVAf9sMFpCxtAG+fVryuxegs+avoJxnsBUH6Y3f1Z4ur5z5LSvq5Bl MyQ+PDrucXXHACrvtEz9EywNABLtp8Ye3sZnQ/i6Kd/dXD8y3jYgKcqELvwg4gLR6IoS E+mW6FkasbVgSjfHTLl9F4mRHa306uIQO7qF3FQeO58XXicXTpobzXo2pB68HJrOE8Ud 5CtQ== X-Gm-Message-State: AOAM530Wo4PdwPmI1frEF4UGDRVbWhuZoRC6diWo+ExO2QpKjXYyj+vv 6cHNS42zT0a+FjD9yyFEe8/TcWWLkTSBZQ== X-Google-Smtp-Source: ABdhPJwBIwlLFYxL/O7Q5Xym4HRjYqpg2G+3Q0jNaxBYo0YYdQ4OMqgmmvyNVx210gfoc2OeDU8H/Q== X-Received: by 2002:a17:907:98a8:: with SMTP id ju8mr13122622ejc.35.1613831803319; Sat, 20 Feb 2021 06:36:43 -0800 (PST) Received: from ?IPv6:2001:a61:3a2d:1d01:99ab:4f20:ed7f:402b? ([2001:a61:3a2d:1d01:99ab:4f20:ed7f:402b]) by smtp.gmail.com with ESMTPSA id r11sm7412440edt.58.2021.02.20.06.36.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Feb 2021 06:36:43 -0800 (PST) Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, libc-alpha@sourceware.org, Ulrich Drepper Subject: Re: [PATCH v2] aio_suspend.3: SYNOPSIS: Use 'restrict' in prototypes To: Alejandro Colomar References: <1950eeca-5627-93de-6fe9-22ebf189b37a@gmail.com> <20210219130326.12772-1-alx.manpages@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: Date: Sat, 20 Feb 2021 15:36:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210219130326.12772-1-alx.manpages@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2021 14:36:45 -0000 On 2/19/21 2:03 PM, Alejandro Colomar wrote: > POSIX does NOT specify aio_suspend() to use 'restrict'. > However, glibc uses 'restrict'. > Users might be surprised by this! Let's use it here too! Hi Alex. Patch applied. Thanks! Cheers, Michael > ...... > > .../glibc$ grep_glibc_prototype aio_suspend > rt/aio.h:167: > extern int aio_suspend (const struct aiocb *const __list[], int __nent, > const struct timespec *__restrict __timeout) > __nonnull ((1)); > .../glibc$ > > Cc: libc-alpha@sourceware.org > Cc: Ulrich Drepper > Signed-off-by: Alejandro Colomar > --- > > v2: > - wsfix + srcfix: Avoid breaking the line in the prototype > - Note the difference between POSIX and glibc in CONFORMING TO. > > --- > man3/aio_suspend.3 | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/man3/aio_suspend.3 b/man3/aio_suspend.3 > index 76a05f48e..e0355a449 100644 > --- a/man3/aio_suspend.3 > +++ b/man3/aio_suspend.3 > @@ -30,8 +30,8 @@ aio_suspend \- wait for asynchronous I/O operation or timeout > .PP > .B "#include " > .PP > -.BI "int aio_suspend(const struct aiocb * const " aiocb_list [], > -.BI " int " nitems ", const struct timespec *" timeout ); > +.BI "int aio_suspend(const struct aiocb *const " aiocb_list "[], int " nitems , > +.BI " const struct timespec *restrict " timeout ); > .PP > Link with \fI\-lrt\fP. > .fi > @@ -122,6 +122,10 @@ T} Thread safety MT-Safe > .sp 1 > .SH CONFORMING TO > POSIX.1-2001, POSIX.1-2008. > +.PP > +POSIX doesn't specify the parameters to be > +.IR restrict ; > +that is specific to glibc. > .SH NOTES > One can achieve polling by using a non-NULL > .I timeout > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/