From ff36510cfcf3d8f967bcdc7b01f8e01cc54d5618 Mon Sep 17 00:00:00 2001 From: pfg Date: Tue, 24 Mar 2015 20:33:24 +0000 Subject: Introduce nonnull attributes in the signal and pthread headers. The `nonnull' attribute specifies that some function parameters should be non-null pointers. This is very useful as it helps the compiler generate warnings on suspicious code and can also enable some small optimizations. In clang this is also useful for the static analyzer. While we could go on defining this all over the tree, it only makes sense to annotate a subset of critical functions. Hinted by: Android's bionic libc Differential Revision: https://reviews.freebsd.org/D2101 --- include/pthread.h | 135 ++++++++++++++++++++++++++++++------------------------ include/signal.h | 6 +-- 2 files changed, 79 insertions(+), 62 deletions(-) (limited to 'include') diff --git a/include/pthread.h b/include/pthread.h index c6356de..1a04da9 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -144,19 +144,23 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t *); +int pthread_attr_destroy(pthread_attr_t *) __nonnull(1); int pthread_attr_getstack(const pthread_attr_t * __restrict, - void ** __restrict, size_t * __restrict); -int pthread_attr_getstacksize(const pthread_attr_t *, size_t *); + void ** __restrict, size_t * __restrict) + __nonnull(1, 2, 3); +int pthread_attr_getstacksize(const pthread_attr_t *, size_t *) + __nonnull(1, 2); int pthread_attr_getguardsize(const pthread_attr_t *, size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t *, int *); -int pthread_attr_init(pthread_attr_t *); -int pthread_attr_setstacksize(pthread_attr_t *, size_t); -int pthread_attr_setguardsize(pthread_attr_t *, size_t); -int pthread_attr_setstack(pthread_attr_t *, void *, size_t); +int pthread_attr_getdetachstate(const pthread_attr_t *, int *) + __nonnull(1, 2); +int pthread_attr_init(pthread_attr_t *) __nonnull(1); +int pthread_attr_setstacksize(pthread_attr_t *, size_t) __nonnull(1); +int pthread_attr_setguardsize(pthread_attr_t *, size_t) __nonnull(1); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t) + __nonnull(1); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t *, int); +int pthread_attr_setdetachstate(pthread_attr_t *, int) __nonnull(1); int pthread_barrier_destroy(pthread_barrier_t *); int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); @@ -164,7 +168,7 @@ int pthread_barrier_wait(pthread_barrier_t *); int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared(const pthread_barrierattr_t *, int *); -int pthread_barrierattr_init(pthread_barrierattr_t *); +int pthread_barrierattr_init(pthread_barrierattr_t *) __nonnull(1); int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ @@ -180,85 +184,96 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t *); +int pthread_condattr_destroy(pthread_condattr_t *) __nonnull(1); int pthread_condattr_getclock(const pthread_condattr_t *, - clockid_t *); -int pthread_condattr_getpshared(const pthread_condattr_t *, int *); -int pthread_condattr_init(pthread_condattr_t *); -int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); -int pthread_condattr_setpshared(pthread_condattr_t *, int); -int pthread_cond_broadcast(pthread_cond_t *); -int pthread_cond_destroy(pthread_cond_t *); + clockid_t *) __nonnull(1, 2); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *) + __nonnull(1, 2); +int pthread_condattr_init(pthread_condattr_t *) __nonnull(1); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t) + __nonnull(1); +int pthread_condattr_setpshared(pthread_condattr_t *, int) + __nonnull(1); +int pthread_cond_broadcast(pthread_cond_t *) + __nonnull(1); +int pthread_cond_destroy(pthread_cond_t *) + __nonnull(1); int pthread_cond_init(pthread_cond_t *, - const pthread_condattr_t *); -int pthread_cond_signal(pthread_cond_t *); + const pthread_condattr_t *) __nonnull(1); +int pthread_cond_signal(pthread_cond_t *) __nonnull(1); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *__mutex, const struct timespec *) - __requires_exclusive(*__mutex); + __nonnull(1, 2, 3) __requires_exclusive(*__mutex); int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *__mutex) - __requires_exclusive(*__mutex); + __nonnull(1, 2) __requires_exclusive(*__mutex); int pthread_create(pthread_t *, const pthread_attr_t *, - void *(*) (void *), void *); + void *(*) (void *), void *) __nonnull(1, 3); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t *); +int pthread_getcpuclockid(pthread_t, clockid_t *) __nonnull(2); int pthread_join(pthread_t, void **); int pthread_key_create(pthread_key_t *, - void (*) (void *)); + void (*) (void *)) __nonnull(1); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t *); -int pthread_mutexattr_destroy(pthread_mutexattr_t *); +int pthread_mutexattr_init(pthread_mutexattr_t *) __nonnull(1); +int pthread_mutexattr_destroy(pthread_mutexattr_t *) __nonnull(1); int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, - int *); -int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); -int pthread_mutexattr_settype(pthread_mutexattr_t *, int); -int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); + int *) __nonnull(1, 2); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *) + __nonnull(1, 2); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int) + __nonnull(1); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int) + __nonnull(1); int pthread_mutex_destroy(pthread_mutex_t *__mutex) - __requires_unlocked(*__mutex); + __nonnull(1) __requires_unlocked(*__mutex); int pthread_mutex_init(pthread_mutex_t *__mutex, const pthread_mutexattr_t *) - __requires_unlocked(*__mutex); + __nonnull(1) __requires_unlocked(*__mutex); int pthread_mutex_lock(pthread_mutex_t *__mutex) - __locks_exclusive(*__mutex); + __nonnull(1) __locks_exclusive(*__mutex); int pthread_mutex_trylock(pthread_mutex_t *__mutex) - __trylocks_exclusive(0, *__mutex); + __nonnull(1) __trylocks_exclusive(0, *__mutex); int pthread_mutex_timedlock(pthread_mutex_t *__mutex, const struct timespec *) - __trylocks_exclusive(0, *__mutex); + __nonnull(1, 2) __trylocks_exclusive(0, *__mutex); int pthread_mutex_unlock(pthread_mutex_t *__mutex) - __unlocks(*__mutex); -int pthread_once(pthread_once_t *, void (*) (void)); + __nonnull(1) __unlocks(*__mutex); +int pthread_once(pthread_once_t *, void (*) (void)) __nonnull(1, 2); int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock) - __requires_unlocked(*__rwlock); + __nonnull(1) __requires_unlocked(*__rwlock); int pthread_rwlock_init(pthread_rwlock_t *__rwlock, const pthread_rwlockattr_t *) - __requires_unlocked(*__rwlock); + __nonnull(1) __requires_unlocked(*__rwlock); int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock) - __locks_shared(*__rwlock); + __nonnull(1) __locks_shared(*__rwlock); int pthread_rwlock_timedrdlock(pthread_rwlock_t *__rwlock, const struct timespec *) - __trylocks_shared(0, *__rwlock); + __nonnull(1, 2) __trylocks_shared(0, *__rwlock); int pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock, const struct timespec *) - __trylocks_exclusive(0, *__rwlock); + __nonnull(1, 2) __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock) - __trylocks_shared(0, *__rwlock); + __nonnull(1) __trylocks_shared(0, *__rwlock); int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) - __trylocks_exclusive(0, *__rwlock); + __nonnull(1) __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock) - __unlocks(*__rwlock); + __nonnull(1) __unlocks(*__rwlock); int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock) - __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); + __nonnull(1) __locks_exclusive(*__rwlock); +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *) + __nonnull(1); int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, int *); int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, - int *); -int pthread_rwlockattr_init(pthread_rwlockattr_t *); + int *) __nonnull(1, 2); +int pthread_rwlockattr_init(pthread_rwlockattr_t *) + __nonnull(1); int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int) + __nonnull(1); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); @@ -295,18 +310,20 @@ int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_attr_getinheritsched(const pthread_attr_t *, int *); int pthread_attr_getschedparam(const pthread_attr_t *, - struct sched_param *); -int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); -int pthread_attr_getscope(const pthread_attr_t *, int *); + struct sched_param *) __nonnull(1, 2); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *) + __nonnull(1, 2); +int pthread_attr_getscope(const pthread_attr_t *, int *) + __nonnull(1, 2); int pthread_attr_setinheritsched(pthread_attr_t *, int); int pthread_attr_setschedparam(pthread_attr_t *, - const struct sched_param *); -int pthread_attr_setschedpolicy(pthread_attr_t *, int); -int pthread_attr_setscope(pthread_attr_t *, int); + const struct sched_param *) __nonnull(1, 2); +int pthread_attr_setschedpolicy(pthread_attr_t *, int) __nonnull(1); +int pthread_attr_setscope(pthread_attr_t *, int) __nonnull(1); int pthread_getschedparam(pthread_t pthread, int *, - struct sched_param *); + struct sched_param *) __nonnull(2, 3); int pthread_setschedparam(pthread_t, int, - const struct sched_param *); + const struct sched_param *) __nonnull(3); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); diff --git a/include/signal.h b/include/signal.h index dca19aa..b80fde4 100644 --- a/include/signal.h +++ b/include/signal.h @@ -78,10 +78,10 @@ int sigdelset(sigset_t *, int); int sigemptyset(sigset_t *); int sigfillset(sigset_t *); int sigismember(const sigset_t *, int); -int sigpending(sigset_t *); +int sigpending(sigset_t *) __nonnull(1); int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); -int sigsuspend(const sigset_t *); -int sigwait(const sigset_t * __restrict, int * __restrict); +int sigsuspend(const sigset_t *) __nonnull(1); +int sigwait(const sigset_t * __restrict, int * __restrict) __nonnull(1, 2); #endif #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 -- cgit v1.1 From bfa2c0962ccfeed2612033d0eaa5d45d6eff9794 Mon Sep 17 00:00:00 2001 From: pfg Date: Wed, 25 Mar 2015 16:54:37 +0000 Subject: Clean sparse spaces. --- include/stdlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/stdlib.h b/include/stdlib.h index 2f580dc..6669495 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -277,9 +277,9 @@ int cgetustr(char *, const char *, char **); int daemon(int, int); char *devname(__dev_t, __mode_t); -char *devname_r(__dev_t, __mode_t, char *, int); +char *devname_r(__dev_t, __mode_t, char *, int); char *fdevname(int); -char *fdevname_r(int, char *, int); +char *fdevname_r(int, char *, int); int getloadavg(double [], int); const char * getprogname(void); -- cgit v1.1 From a4e5bd6db9052e10bc6e4f83f1e208d9d38335e3 Mon Sep 17 00:00:00 2001 From: pfg Date: Wed, 25 Mar 2015 21:53:17 +0000 Subject: Temporarily revert 280458. GCC is still carries an old version of cdefs.h which doesn't accept multiple parameters for the nonnull attribute. Since this issue probably affects many ports in the tree we will revert it for now until gcc gets fixed. --- include/pthread.h | 135 ++++++++++++++++++++++++------------------------------ include/signal.h | 6 +-- 2 files changed, 62 insertions(+), 79 deletions(-) (limited to 'include') diff --git a/include/pthread.h b/include/pthread.h index 1a04da9..c6356de 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -144,23 +144,19 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t *) __nonnull(1); +int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack(const pthread_attr_t * __restrict, - void ** __restrict, size_t * __restrict) - __nonnull(1, 2, 3); -int pthread_attr_getstacksize(const pthread_attr_t *, size_t *) - __nonnull(1, 2); + void ** __restrict, size_t * __restrict); +int pthread_attr_getstacksize(const pthread_attr_t *, size_t *); int pthread_attr_getguardsize(const pthread_attr_t *, size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t *, int *) - __nonnull(1, 2); -int pthread_attr_init(pthread_attr_t *) __nonnull(1); -int pthread_attr_setstacksize(pthread_attr_t *, size_t) __nonnull(1); -int pthread_attr_setguardsize(pthread_attr_t *, size_t) __nonnull(1); -int pthread_attr_setstack(pthread_attr_t *, void *, size_t) - __nonnull(1); +int pthread_attr_getdetachstate(const pthread_attr_t *, int *); +int pthread_attr_init(pthread_attr_t *); +int pthread_attr_setstacksize(pthread_attr_t *, size_t); +int pthread_attr_setguardsize(pthread_attr_t *, size_t); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t *, int) __nonnull(1); +int pthread_attr_setdetachstate(pthread_attr_t *, int); int pthread_barrier_destroy(pthread_barrier_t *); int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); @@ -168,7 +164,7 @@ int pthread_barrier_wait(pthread_barrier_t *); int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared(const pthread_barrierattr_t *, int *); -int pthread_barrierattr_init(pthread_barrierattr_t *) __nonnull(1); +int pthread_barrierattr_init(pthread_barrierattr_t *); int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ @@ -184,96 +180,85 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t *) __nonnull(1); +int pthread_condattr_destroy(pthread_condattr_t *); int pthread_condattr_getclock(const pthread_condattr_t *, - clockid_t *) __nonnull(1, 2); -int pthread_condattr_getpshared(const pthread_condattr_t *, int *) - __nonnull(1, 2); -int pthread_condattr_init(pthread_condattr_t *) __nonnull(1); -int pthread_condattr_setclock(pthread_condattr_t *, clockid_t) - __nonnull(1); -int pthread_condattr_setpshared(pthread_condattr_t *, int) - __nonnull(1); -int pthread_cond_broadcast(pthread_cond_t *) - __nonnull(1); -int pthread_cond_destroy(pthread_cond_t *) - __nonnull(1); + clockid_t *); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *); +int pthread_condattr_init(pthread_condattr_t *); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); +int pthread_condattr_setpshared(pthread_condattr_t *, int); +int pthread_cond_broadcast(pthread_cond_t *); +int pthread_cond_destroy(pthread_cond_t *); int pthread_cond_init(pthread_cond_t *, - const pthread_condattr_t *) __nonnull(1); -int pthread_cond_signal(pthread_cond_t *) __nonnull(1); + const pthread_condattr_t *); +int pthread_cond_signal(pthread_cond_t *); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *__mutex, const struct timespec *) - __nonnull(1, 2, 3) __requires_exclusive(*__mutex); + __requires_exclusive(*__mutex); int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *__mutex) - __nonnull(1, 2) __requires_exclusive(*__mutex); + __requires_exclusive(*__mutex); int pthread_create(pthread_t *, const pthread_attr_t *, - void *(*) (void *), void *) __nonnull(1, 3); + void *(*) (void *), void *); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t *) __nonnull(2); +int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); int pthread_key_create(pthread_key_t *, - void (*) (void *)) __nonnull(1); + void (*) (void *)); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t *) __nonnull(1); -int pthread_mutexattr_destroy(pthread_mutexattr_t *) __nonnull(1); +int pthread_mutexattr_init(pthread_mutexattr_t *); +int pthread_mutexattr_destroy(pthread_mutexattr_t *); int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, - int *) __nonnull(1, 2); -int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *) - __nonnull(1, 2); -int pthread_mutexattr_settype(pthread_mutexattr_t *, int) - __nonnull(1); -int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int) - __nonnull(1); + int *); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); int pthread_mutex_destroy(pthread_mutex_t *__mutex) - __nonnull(1) __requires_unlocked(*__mutex); + __requires_unlocked(*__mutex); int pthread_mutex_init(pthread_mutex_t *__mutex, const pthread_mutexattr_t *) - __nonnull(1) __requires_unlocked(*__mutex); + __requires_unlocked(*__mutex); int pthread_mutex_lock(pthread_mutex_t *__mutex) - __nonnull(1) __locks_exclusive(*__mutex); + __locks_exclusive(*__mutex); int pthread_mutex_trylock(pthread_mutex_t *__mutex) - __nonnull(1) __trylocks_exclusive(0, *__mutex); + __trylocks_exclusive(0, *__mutex); int pthread_mutex_timedlock(pthread_mutex_t *__mutex, const struct timespec *) - __nonnull(1, 2) __trylocks_exclusive(0, *__mutex); + __trylocks_exclusive(0, *__mutex); int pthread_mutex_unlock(pthread_mutex_t *__mutex) - __nonnull(1) __unlocks(*__mutex); -int pthread_once(pthread_once_t *, void (*) (void)) __nonnull(1, 2); + __unlocks(*__mutex); +int pthread_once(pthread_once_t *, void (*) (void)); int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock) - __nonnull(1) __requires_unlocked(*__rwlock); + __requires_unlocked(*__rwlock); int pthread_rwlock_init(pthread_rwlock_t *__rwlock, const pthread_rwlockattr_t *) - __nonnull(1) __requires_unlocked(*__rwlock); + __requires_unlocked(*__rwlock); int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __locks_shared(*__rwlock); + __locks_shared(*__rwlock); int pthread_rwlock_timedrdlock(pthread_rwlock_t *__rwlock, const struct timespec *) - __nonnull(1, 2) __trylocks_shared(0, *__rwlock); + __trylocks_shared(0, *__rwlock); int pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock, const struct timespec *) - __nonnull(1, 2) __trylocks_exclusive(0, *__rwlock); + __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __trylocks_shared(0, *__rwlock); + __trylocks_shared(0, *__rwlock); int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __trylocks_exclusive(0, *__rwlock); + __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __unlocks(*__rwlock); + __unlocks(*__rwlock); int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock) - __nonnull(1) __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t *) - __nonnull(1); + __locks_exclusive(*__rwlock); +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, int *); int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, - int *) __nonnull(1, 2); -int pthread_rwlockattr_init(pthread_rwlockattr_t *) - __nonnull(1); + int *); +int pthread_rwlockattr_init(pthread_rwlockattr_t *); int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int) - __nonnull(1); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); @@ -310,20 +295,18 @@ int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_attr_getinheritsched(const pthread_attr_t *, int *); int pthread_attr_getschedparam(const pthread_attr_t *, - struct sched_param *) __nonnull(1, 2); -int pthread_attr_getschedpolicy(const pthread_attr_t *, int *) - __nonnull(1, 2); -int pthread_attr_getscope(const pthread_attr_t *, int *) - __nonnull(1, 2); + struct sched_param *); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); +int pthread_attr_getscope(const pthread_attr_t *, int *); int pthread_attr_setinheritsched(pthread_attr_t *, int); int pthread_attr_setschedparam(pthread_attr_t *, - const struct sched_param *) __nonnull(1, 2); -int pthread_attr_setschedpolicy(pthread_attr_t *, int) __nonnull(1); -int pthread_attr_setscope(pthread_attr_t *, int) __nonnull(1); + const struct sched_param *); +int pthread_attr_setschedpolicy(pthread_attr_t *, int); +int pthread_attr_setscope(pthread_attr_t *, int); int pthread_getschedparam(pthread_t pthread, int *, - struct sched_param *) __nonnull(2, 3); + struct sched_param *); int pthread_setschedparam(pthread_t, int, - const struct sched_param *) __nonnull(3); + const struct sched_param *); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); diff --git a/include/signal.h b/include/signal.h index b80fde4..dca19aa 100644 --- a/include/signal.h +++ b/include/signal.h @@ -78,10 +78,10 @@ int sigdelset(sigset_t *, int); int sigemptyset(sigset_t *); int sigfillset(sigset_t *); int sigismember(const sigset_t *, int); -int sigpending(sigset_t *) __nonnull(1); +int sigpending(sigset_t *); int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); -int sigsuspend(const sigset_t *) __nonnull(1); -int sigwait(const sigset_t * __restrict, int * __restrict) __nonnull(1, 2); +int sigsuspend(const sigset_t *); +int sigwait(const sigset_t * __restrict, int * __restrict); #endif #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 -- cgit v1.1