diff mbox series

[v2] aio_suspend.3: SYNOPSIS: Use 'restrict' in prototypes

Message ID 20210219130326.12772-1-alx.manpages@gmail.com
State New
Headers show
Series [v2] aio_suspend.3: SYNOPSIS: Use 'restrict' in prototypes | expand

Commit Message

Alejandro Colomar Feb. 19, 2021, 1:03 p.m. UTC
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!

......

.../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 <drepper@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---

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(-)

Comments

Michael Kerrisk \(man-pages\) Feb. 20, 2021, 2:36 p.m. UTC | #1
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 <drepper@redhat.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
> 
> 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 <aio.h>"
>  .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
>
diff mbox series

Patch

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 <aio.h>"
 .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