[PATCH 06/23] pthread_create.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar
alx.manpages@gmail.com
Mon Mar 8 18:53:15 GMT 2021
Both POSIX and glibc use 'restrict' in pthread_create().
Let's use it here too.
.../glibc$ grep_glibc_prototype pthread_create
sysdeps/htl/pthread.h:212:
extern int pthread_create (pthread_t *__restrict __threadp,
__const pthread_attr_t *__restrict __attr,
void *(*__start_routine)(void *),
void *__restrict __arg) __THROWNL __nonnull ((1, 3));
sysdeps/nptl/pthread.h:200:
extern int pthread_create (pthread_t *__restrict __newthread,
const pthread_attr_t *__restrict __attr,
void *(*__start_routine) (void *),
void *__restrict __arg) __THROWNL __nonnull ((1, 3));
.../glibc$
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man3/pthread_create.3 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/man3/pthread_create.3 b/man3/pthread_create.3
index a1ede6e96..14fd37220 100644
--- a/man3/pthread_create.3
+++ b/man3/pthread_create.3
@@ -30,8 +30,10 @@ pthread_create \- create a new thread
.nf
.B #include <pthread.h>
.PP
-.BI "int pthread_create(pthread_t *" thread ", const pthread_attr_t *" attr ,
-.BI " void *(*" start_routine ")(void *), void *" arg );
+.BI "int pthread_create(pthread_t *restrict " thread ,
+.BI " const pthread_attr_t *restrict " attr ,
+.BI " void *(*" start_routine ")(void *),"
+.BI " void *restrict " arg );
.fi
.PP
Compile and link with \fI\-pthread\fP.
--
2.30.1
More information about the Libc-alpha
mailing list