diff options
author | ngie <ngie@FreeBSD.org> | 2014-10-23 06:24:36 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2014-10-23 06:24:36 +0000 |
commit | 9441ef13dc99c6c750151b49a7ca87c8b1709082 (patch) | |
tree | d71ffd87140045b1c2a29fbe1d84512050303f11 /contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c | |
parent | 67e9e5ed09508d7d5ae7b4e2720f3b3c1bfb7387 (diff) | |
download | FreeBSD-src-9441ef13dc99c6c750151b49a7ca87c8b1709082.zip FreeBSD-src-9441ef13dc99c6c750151b49a7ca87c8b1709082.tar.gz |
- Mark unused parameters __unused in handler
- Call sigqueue with getpid() instead of 0 -- the latter idiom appears to only
be valid on NetBSD
In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c b/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c index f9e0c63..ac7d3ad 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c @@ -46,7 +46,11 @@ static void handler(int, siginfo_t *, void *); static int value; static void +#if defined(__FreeBSD__) +handler(int signo __unused, siginfo_t *info __unused, void *data __unused) +#else handler(int signo, siginfo_t *info, void *data) +#endif { value = info->si_value.sival_int; kill(0, SIGINFO); @@ -72,7 +76,15 @@ ATF_TC_BODY(sigqueue_basic, tc) sv.sival_int = VALUE; +#if defined(__FreeBSD__) + /* + * From kern_sig.c: + * Specification says sigqueue can only send signal to single process. + */ + if (sigqueue(getpid(), SIGUSR1, sv) != 0) +#else if (sigqueue(0, SIGUSR1, sv) != 0) +#endif atf_tc_fail("sigqueue failed"); sched_yield(); |