summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committersjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit65145fa4c81da358fcbc3b650156dab705dfa34e (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /include
parent60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff)
parente6b664c390af88d4a87208bc042ce503da664c3b (diff)
downloadFreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip
FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz
Merge sync of head
Diffstat (limited to 'include')
-rw-r--r--include/Makefile35
-rw-r--r--include/Makefile.depend1
-rw-r--r--include/iconv.h4
-rw-r--r--include/pthread.h221
-rw-r--r--include/semaphore.h2
-rw-r--r--include/signal.h6
-rw-r--r--include/stdio.h2
-rw-r--r--include/stdlib.h21
-rw-r--r--include/stringlist.h5
9 files changed, 157 insertions, 140 deletions
diff --git a/include/Makefile b/include/Makefile
index eb72491..756c8e1 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -42,15 +42,15 @@ LDIRS= bsm cam geom net net80211 netgraph netinet netinet6 \
LSUBDIRS= cam/ata cam/scsi \
dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \
dev/hwpmc \
- dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \
+ dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/nvme \
dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
- dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
- fs/cuse \
+ dev/speaker dev/utopia dev/vkbd dev/wi \
fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \
fs/procfs fs/smbfs fs/udf fs/unionfs \
geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
geom/mirror geom/mountver geom/multipath geom/nop \
geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \
+ net/altq \
netgraph/atm netgraph/netflow \
security/audit \
security/mac_biba security/mac_bsdextended security/mac_lomac \
@@ -59,12 +59,12 @@ LSUBDIRS= cam/ata cam/scsi \
LSUBSUBDIRS= dev/mpt/mpilib
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
-_dev_powermac_nvram= dev/powermac_nvram
+.if ${MK_BLUETOOTH} != "no"
+LSUBSUBDIRS+= netgraph/bluetooth/include
.endif
-.if ${MK_GPIB} != "no"
-_dev_ieee488= dev/ieee488
+.if ${MK_CUSE} != "no"
+LSUBDIRS+= fs/cuse
.endif
.if ${MK_GSSAPI} != "no"
@@ -76,15 +76,18 @@ INCS+= gssapi.h
INCS+= hesiod.h
.endif
-.if ${MK_BLUETOOTH} != "no"
-LSUBSUBDIRS+= netgraph/bluetooth/include
-.endif
-
# Handle the #define aliases for libiconv
.if ${MK_ICONV} == "yes"
INCS+= iconv.h
.endif
+.if ${MK_USB} != "no"
+LSUBDIRS+= dev/usb
+.endif
+
+.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
+_dev_powermac_nvram= dev/powermac_nvram
+.endif
# Define SHARED to indicate whether you want symbolic links to the system
# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
@@ -167,7 +170,7 @@ compat:
.endif
copies:
-.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
+.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \
${_MARCHS}
.if exists(${DESTDIR}${INCLUDEDIR}/$i)
cd ${DESTDIR}${INCLUDEDIR}/$i; \
@@ -202,9 +205,6 @@ copies:
cd ${.CURDIR}/../sys/dev/pci; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
${DESTDIR}${INCLUDEDIR}/dev/pci
- cd ${.CURDIR}/../sys/contrib/altq/altq; \
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
- ${DESTDIR}${INCLUDEDIR}/altq
cd ${.CURDIR}/../sys/fs/cd9660/; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
${DESTDIR}${INCLUDEDIR}/isofs/cd9660
@@ -305,11 +305,6 @@ symlinks:
ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
done
.endfor
- cd ${.CURDIR}/../sys/contrib/altq/altq; \
- for h in *.h; do \
- ln -fs ../../../sys/contrib/altq/altq/$$h \
- ${DESTDIR}${INCLUDEDIR}/altq; \
- done
.if ${MK_IPFILTER} != "no"
cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
for h in *.h; do \
diff --git a/include/Makefile.depend b/include/Makefile.depend
index 8b97128..482a633 100644
--- a/include/Makefile.depend
+++ b/include/Makefile.depend
@@ -3,6 +3,7 @@
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
DIRDEPS = \
+ bin/cat.host \
usr.bin/xinstall.host \
diff --git a/include/iconv.h b/include/iconv.h
index c07d02e..51f0603 100644
--- a/include/iconv.h
+++ b/include/iconv.h
@@ -53,7 +53,7 @@ typedef struct __tag_iconv_t *iconv_t;
__BEGIN_DECLS
iconv_t iconv_open(const char *, const char *);
-size_t iconv(iconv_t, const char ** __restrict,
+size_t iconv(iconv_t, char ** __restrict,
size_t * __restrict, char ** __restrict,
size_t * __restrict);
int iconv_close(iconv_t);
@@ -62,7 +62,7 @@ int iconv_close(iconv_t);
*/
int __iconv_get_list(char ***, size_t *, __iconv_bool);
void __iconv_free_list(char **, size_t);
-size_t __iconv(iconv_t, const char **, size_t *, char **,
+size_t __iconv(iconv_t, char **, size_t *, char **,
size_t *, __uint32_t, size_t *);
#define __ICONV_F_HIDE_INVALID 0x0001
diff --git a/include/pthread.h b/include/pthread.h
index c6356de..8b59223 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -33,7 +33,7 @@
* $FreeBSD$
*/
#ifndef _PTHREAD_H_
-#define _PTHREAD_H_
+#define _PTHREAD_H_
/*
* Header files.
@@ -49,71 +49,71 @@
/*
* Run-time invariant values:
*/
-#define PTHREAD_DESTRUCTOR_ITERATIONS 4
-#define PTHREAD_KEYS_MAX 256
-#define PTHREAD_STACK_MIN __MINSIGSTKSZ
-#define PTHREAD_THREADS_MAX __ULONG_MAX
-#define PTHREAD_BARRIER_SERIAL_THREAD -1
+#define PTHREAD_DESTRUCTOR_ITERATIONS 4
+#define PTHREAD_KEYS_MAX 256
+#define PTHREAD_STACK_MIN __MINSIGSTKSZ
+#define PTHREAD_THREADS_MAX __ULONG_MAX
+#define PTHREAD_BARRIER_SERIAL_THREAD -1
/*
* Flags for threads and thread attributes.
*/
-#define PTHREAD_DETACHED 0x1
-#define PTHREAD_SCOPE_SYSTEM 0x2
-#define PTHREAD_INHERIT_SCHED 0x4
-#define PTHREAD_NOFLOAT 0x8
+#define PTHREAD_DETACHED 0x1
+#define PTHREAD_SCOPE_SYSTEM 0x2
+#define PTHREAD_INHERIT_SCHED 0x4
+#define PTHREAD_NOFLOAT 0x8
-#define PTHREAD_CREATE_DETACHED PTHREAD_DETACHED
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_EXPLICIT_SCHED 0
+#define PTHREAD_CREATE_DETACHED PTHREAD_DETACHED
+#define PTHREAD_CREATE_JOINABLE 0
+#define PTHREAD_SCOPE_PROCESS 0
+#define PTHREAD_EXPLICIT_SCHED 0
/*
* Flags for read/write lock attributes
*/
-#define PTHREAD_PROCESS_PRIVATE 0
-#define PTHREAD_PROCESS_SHARED 1
+#define PTHREAD_PROCESS_PRIVATE 0
+#define PTHREAD_PROCESS_SHARED 1
/*
* Flags for cancelling threads
*/
-#define PTHREAD_CANCEL_ENABLE 0
-#define PTHREAD_CANCEL_DISABLE 1
-#define PTHREAD_CANCEL_DEFERRED 0
-#define PTHREAD_CANCEL_ASYNCHRONOUS 2
-#define PTHREAD_CANCELED ((void *) 1)
+#define PTHREAD_CANCEL_ENABLE 0
+#define PTHREAD_CANCEL_DISABLE 1
+#define PTHREAD_CANCEL_DEFERRED 0
+#define PTHREAD_CANCEL_ASYNCHRONOUS 2
+#define PTHREAD_CANCELED ((void *) 1)
/*
* Flags for once initialization.
*/
-#define PTHREAD_NEEDS_INIT 0
-#define PTHREAD_DONE_INIT 1
+#define PTHREAD_NEEDS_INIT 0
+#define PTHREAD_DONE_INIT 1
/*
- * Static once initialization values.
+ * Static once initialization values.
*/
-#define PTHREAD_ONCE_INIT { PTHREAD_NEEDS_INIT, NULL }
+#define PTHREAD_ONCE_INIT { PTHREAD_NEEDS_INIT, NULL }
/*
- * Static initialization values.
+ * Static initialization values.
*/
-#define PTHREAD_MUTEX_INITIALIZER NULL
-#define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP ((pthread_mutex_t)1)
-#define PTHREAD_COND_INITIALIZER NULL
-#define PTHREAD_RWLOCK_INITIALIZER NULL
+#define PTHREAD_MUTEX_INITIALIZER NULL
+#define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP ((pthread_mutex_t)1)
+#define PTHREAD_COND_INITIALIZER NULL
+#define PTHREAD_RWLOCK_INITIALIZER NULL
/*
* Default attribute arguments (draft 4, deprecated).
*/
#ifndef PTHREAD_KERNEL
-#define pthread_condattr_default NULL
-#define pthread_mutexattr_default NULL
-#define pthread_attr_default NULL
+#define pthread_condattr_default NULL
+#define pthread_mutexattr_default NULL
+#define pthread_attr_default NULL
#endif
-#define PTHREAD_PRIO_NONE 0
-#define PTHREAD_PRIO_INHERIT 1
-#define PTHREAD_PRIO_PROTECT 2
+#define PTHREAD_PRIO_NONE 0
+#define PTHREAD_PRIO_INHERIT 1
+#define PTHREAD_PRIO_PROTECT 2
/*
* Mutex types (Single UNIX Specification, Version 2, 1997).
@@ -133,7 +133,7 @@ enum pthread_mutextype {
PTHREAD_MUTEX_TYPE_MAX
};
-#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK
+#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK
struct _pthread_cleanup_info {
__uintptr_t pthread_cleanup_pad[8];
@@ -144,19 +144,25 @@ 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_all;
+int pthread_attr_getstacksize(const pthread_attr_t *, size_t *)
+ __nonnull_all;
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_all;
+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 +170,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,98 +186,109 @@ 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_all;
+int pthread_condattr_getpshared(const pthread_condattr_t *, int *)
+ __nonnull_all;
+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_all __requires_exclusive(*__mutex);
int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *__mutex)
- __requires_exclusive(*__mutex);
+ __nonnull_all __requires_exclusive(*__mutex);
int pthread_create(pthread_t *, const pthread_attr_t *,
- void *(*) (void *), void *);
+ void *(*) (void *), void *) __nonnull(1) __nonnull(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_all;
+int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *)
+ __nonnull_all;
+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_all __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_all;
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_all __trylocks_shared(0, *__rwlock);
int pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock,
const struct timespec *)
- __trylocks_exclusive(0, *__rwlock);
+ __nonnull_all __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_all;
+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 *);
int pthread_spin_init(pthread_spinlock_t *__spin, int)
- __requires_unlocked(*__spin);
+ __requires_unlocked(*__spin);
int pthread_spin_destroy(pthread_spinlock_t *__spin)
- __requires_unlocked(*__spin);
+ __requires_unlocked(*__spin);
int pthread_spin_lock(pthread_spinlock_t *__spin)
- __locks_exclusive(*__spin);
+ __locks_exclusive(*__spin);
int pthread_spin_trylock(pthread_spinlock_t *__spin)
- __trylocks_exclusive(0, *__spin);
+ __trylocks_exclusive(0, *__spin);
int pthread_spin_unlock(pthread_spinlock_t *__spin)
- __unlocks(*__spin);
+ __unlocks(*__spin);
int pthread_cancel(pthread_t);
int pthread_setcancelstate(int, int *);
int pthread_setcanceltype(int, int *);
@@ -295,18 +312,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_all;
+int pthread_attr_getschedpolicy(const pthread_attr_t *, int *)
+ __nonnull_all;
+int pthread_attr_getscope(const pthread_attr_t *, int *)
+ __nonnull_all;
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) __nonnull(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) __nonnull(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/semaphore.h b/include/semaphore.h
index 218de99..c42a8d2 100644
--- a/include/semaphore.h
+++ b/include/semaphore.h
@@ -36,6 +36,8 @@
#include <sys/_types.h>
#include <sys/_umtx.h>
+#include <machine/_limits.h>
+
struct _sem {
__uint32_t _magic;
struct _usem2 _kern;
diff --git a/include/signal.h b/include/signal.h
index dca19aa..895ccc3 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_all;
#endif
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600
diff --git a/include/stdio.h b/include/stdio.h
index 512e60e..eaebff8 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -166,7 +166,7 @@ __END_DECLS
#define __SRW 0x0010 /* open for reading & writing */
#define __SEOF 0x0020 /* found EOF */
#define __SERR 0x0040 /* found error */
-#define __SMBF 0x0080 /* _buf is from malloc */
+#define __SMBF 0x0080 /* _bf._base is from malloc */
#define __SAPP 0x0100 /* fdopen()ed in append mode */
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
#define __SOPT 0x0400 /* do fseek() optimization */
diff --git a/include/stdlib.h b/include/stdlib.h
index 2f580dc..d5506ff 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -87,21 +87,22 @@ int atoi(const char *);
long atol(const char *);
void *bsearch(const void *, const void *, size_t,
size_t, int (*)(const void *, const void *));
-void *calloc(size_t, size_t) __malloc_like;
+void *calloc(size_t, size_t) __malloc_like __result_use_check
+ __alloc_size(1) __alloc_size(2);
div_t div(int, int) __pure2;
_Noreturn void exit(int);
void free(void *);
char *getenv(const char *);
long labs(long) __pure2;
ldiv_t ldiv(long, long) __pure2;
-void *malloc(size_t) __malloc_like;
+void *malloc(size_t) __malloc_like __result_use_check __alloc_size(1);
int mblen(const char *, size_t);
size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
void qsort(void *, size_t, size_t,
int (*)(const void *, const void *));
int rand(void);
-void *realloc(void *, size_t);
+void *realloc(void *, size_t) __result_use_check __alloc_size(2);
void srand(unsigned);
double strtod(const char * __restrict, char ** __restrict);
float strtof(const char * __restrict, char ** __restrict);
@@ -155,7 +156,8 @@ _Noreturn void _Exit(int);
* If we're in a mode greater than C99, expose C11 functions.
*/
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
-void * aligned_alloc(size_t, size_t) __malloc_like;
+void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1)
+ __alloc_size(2);
int at_quick_exit(void (*)(void));
_Noreturn void
quick_exit(int);
@@ -170,7 +172,8 @@ char *realpath(const char * __restrict, char * __restrict);
int rand_r(unsigned *); /* (TSF) */
#endif
#if __POSIX_VISIBLE >= 200112
-int posix_memalign(void **, size_t, size_t); /* (ADV) */
+int posix_memalign(void **, size_t, size_t) __nonnull(1) __alloc_align(2)
+ __alloc_size(3); /* (ADV) */
int setenv(const char *, const char *, int);
int unsetenv(const char *);
#endif
@@ -277,9 +280,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);
@@ -301,7 +304,9 @@ void qsort_r(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *));
int radixsort(const unsigned char **, int, const unsigned char *,
unsigned);
-void *reallocf(void *, size_t);
+void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2)
+ __alloc_size(3);
+void *reallocf(void *, size_t) __alloc_size(2);
int rpmatch(const char *);
void setprogname(const char *);
int sradixsort(const unsigned char **, int, const unsigned char *,
diff --git a/include/stringlist.h b/include/stringlist.h
index d3154b3..7222b31 100644
--- a/include/stringlist.h
+++ b/include/stringlist.h
@@ -12,11 +12,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Christos Zoulas.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
OpenPOWER on IntegriCloud