diff options
author | ngie <ngie@FreeBSD.org> | 2017-02-10 02:29:39 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-02-10 02:29:39 +0000 |
commit | ce43e48bc4fe37e414f63ac9b8bc9b234b4fed23 (patch) | |
tree | 1ab8bb5792dcd0c52153ba1559b010b2697b293d /contrib/netbsd-tests | |
parent | f5e842db1726ddc62bc2e708eadd72596a4d88c1 (diff) | |
download | FreeBSD-src-ce43e48bc4fe37e414f63ac9b8bc9b234b4fed23.zip FreeBSD-src-ce43e48bc4fe37e414f63ac9b8bc9b234b4fed23.tar.gz |
MFC r305468:
Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...
proc2_test must be skipped because the invariant tested
(`ke.fflags & NOTE_TRACKERR`) doesn't pass.
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r-- | contrib/netbsd-tests/kernel/kqueue/t_proc2.c | 3 | ||||
-rw-r--r-- | contrib/netbsd-tests/kernel/kqueue/t_proc3.c | 3 | ||||
-rw-r--r-- | contrib/netbsd-tests/kernel/kqueue/t_sig.c | 13 | ||||
-rw-r--r-- | contrib/netbsd-tests/kernel/kqueue/t_vnode.c | 3 |
4 files changed, 22 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/kernel/kqueue/t_proc2.c b/contrib/netbsd-tests/kernel/kqueue/t_proc2.c index e70fcb2..2d8d7f7 100644 --- a/contrib/netbsd-tests/kernel/kqueue/t_proc2.c +++ b/contrib/netbsd-tests/kernel/kqueue/t_proc2.c @@ -34,6 +34,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); __RCSID("$NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +#ifdef __FreeBSD__ +#include <sys/types.h> +#endif #include <sys/event.h> #include <sys/time.h> #include <sys/types.h> diff --git a/contrib/netbsd-tests/kernel/kqueue/t_proc3.c b/contrib/netbsd-tests/kernel/kqueue/t_proc3.c index b77510b..eac2f9c 100644 --- a/contrib/netbsd-tests/kernel/kqueue/t_proc3.c +++ b/contrib/netbsd-tests/kernel/kqueue/t_proc3.c @@ -32,6 +32,9 @@ #include <sys/cdefs.h> __RCSID("$NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +#ifdef __FreeBSD__ +#include <sys/types.h> +#endif #include <sys/event.h> #include <sys/time.h> #include <sys/types.h> diff --git a/contrib/netbsd-tests/kernel/kqueue/t_sig.c b/contrib/netbsd-tests/kernel/kqueue/t_sig.c index e367c41..ebbd76e 100644 --- a/contrib/netbsd-tests/kernel/kqueue/t_sig.c +++ b/contrib/netbsd-tests/kernel/kqueue/t_sig.c @@ -34,6 +34,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); __RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $"); +#ifdef __FreeBSD__ +#include <sys/types.h> +#endif #include <sys/event.h> #include <sys/ioctl.h> #include <sys/param.h> @@ -60,9 +63,13 @@ ATF_TC_HEAD(sig, tc) ATF_TC_BODY(sig, tc) { struct timespec timeout; +#ifdef __NetBSD__ struct kfilter_mapping km; +#endif struct kevent event[1]; +#ifdef __NetBSD__ char namebuf[32]; +#endif pid_t pid, child; int kq, n, num, status; @@ -84,16 +91,22 @@ ATF_TC_BODY(sig, tc) RL(kq = kqueue()); +#ifdef __NetBSD__ (void)strlcpy(namebuf, "EVFILT_SIGNAL", sizeof(namebuf)); km.name = namebuf; RL(ioctl(kq, KFILTER_BYNAME, &km)); (void)printf("got %d as filter number for `%s'.\n", km.filter, km.name); +#endif /* ignore the signal to avoid taking it for real */ REQUIRE_LIBC(signal(SIGUSR1, SIG_IGN), SIG_ERR); event[0].ident = SIGUSR1; +#ifdef __NetBSD__ event[0].filter = km.filter; +#else + event[0].filter = EVFILT_SIGNAL; +#endif event[0].flags = EV_ADD | EV_ENABLE; RL(kevent(kq, event, 1, NULL, 0, NULL)); diff --git a/contrib/netbsd-tests/kernel/kqueue/t_vnode.c b/contrib/netbsd-tests/kernel/kqueue/t_vnode.c index e87c2b2..06ef683 100644 --- a/contrib/netbsd-tests/kernel/kqueue/t_vnode.c +++ b/contrib/netbsd-tests/kernel/kqueue/t_vnode.c @@ -1,3 +1,6 @@ +#ifdef __FreeBSD__ +#include <sys/types.h> +#endif #include <sys/event.h> #include <sys/stat.h> #include <sys/time.h> |