aboutsummaryrefslogtreecommitdiffstats
path: root/include/signal.h
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2015-03-24 20:33:24 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2015-03-24 20:33:24 +0000
commit512cd1357ad02e6f7ac037013367b9dea2ed194a (patch)
tree12b8bf32a3239f2295454bcd1d384d931e12cf44 /include/signal.h
parent57e5a8b184c158424636b89c8979887688243452 (diff)
downloadsrc-512cd1357ad02e6f7ac037013367b9dea2ed194a.tar.gz
src-512cd1357ad02e6f7ac037013367b9dea2ed194a.zip
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
Notes
Notes: svn path=/head/; revision=280458
Diffstat (limited to 'include/signal.h')
-rw-r--r--include/signal.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/signal.h b/include/signal.h
index dca19aaa8613..b80fde4fb379 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