summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/regression/kqueue/config.h1
-rw-r--r--tools/regression/kqueue/main.c5
-rw-r--r--tools/regression/kqueue/user.c27
3 files changed, 18 insertions, 15 deletions
diff --git a/tools/regression/kqueue/config.h b/tools/regression/kqueue/config.h
index 895872f..2a377db 100644
--- a/tools/regression/kqueue/config.h
+++ b/tools/regression/kqueue/config.h
@@ -1,5 +1,6 @@
/* AUTOMATICALLY GENERATED -- DO NOT EDIT */
/* $FreeBSD$ */
+#define HAVE_ERR_H
#define HAVE_SYS_EVENT_H
#define HAVE_EV_DISPATCH 1
#define HAVE_EV_RECEIPT 1
diff --git a/tools/regression/kqueue/main.c b/tools/regression/kqueue/main.c
index f1c15a4..182003c 100644
--- a/tools/regression/kqueue/main.c
+++ b/tools/regression/kqueue/main.c
@@ -235,7 +235,12 @@ main(int argc, char **argv)
int test_signal = 1;
int test_vnode = 1;
int test_timer = 1;
+#ifdef __FreeBSD__
int test_user = 1;
+#else
+ /* XXX-FIXME temporary */
+ int test_user = 0;
+#endif
while (argc) {
if (strcmp(argv[0], "--no-proc") == 0)
diff --git a/tools/regression/kqueue/user.c b/tools/regression/kqueue/user.c
index 800ee43..9ba25f9 100644
--- a/tools/regression/kqueue/user.c
+++ b/tools/regression/kqueue/user.c
@@ -45,12 +45,15 @@ event_wait(void)
test_begin(test_id);
+ test_no_kevents();
+
/* Add the event, and then trigger it */
- kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD, 0, 0, NULL);
+ kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD | EV_CLEAR, 0, 0, NULL);
kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
kev.fflags &= ~NOTE_FFCTRLMASK;
kev.fflags &= ~NOTE_TRIGGER;
+ kev.flags = EV_CLEAR;
kevent_cmp(&kev, kevent_get(kqfd));
test_no_kevents();
@@ -66,6 +69,8 @@ disable_and_enable(void)
test_begin(test_id);
+ test_no_kevents();
+
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD, 0, 0, NULL);
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_DISABLE, 0, 0, NULL);
@@ -76,7 +81,7 @@ disable_and_enable(void)
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ENABLE, 0, 0, NULL);
kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
- kev.flags = 0;
+ kev.flags = EV_CLEAR;
kev.fflags &= ~NOTE_FFCTRLMASK;
kev.fflags &= ~NOTE_TRIGGER;
kevent_cmp(&kev, kevent_get(kqfd));
@@ -92,26 +97,18 @@ oneshot(void)
test_begin(test_id);
- kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD | EV_ONESHOT, 0, 0, NULL);
+ test_no_kevents();
+
+ kevent_add(kqfd, &kev, 2, EVFILT_USER, EV_ADD | EV_ONESHOT, 0, 0, NULL);
puts(" -- event 1");
- kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
+ kevent_add(kqfd, &kev, 2, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
- kev.flags = 0;
+ kev.flags = EV_ONESHOT;
kev.fflags &= ~NOTE_FFCTRLMASK;
kev.fflags &= ~NOTE_TRIGGER;
kevent_cmp(&kev, kevent_get(kqfd));
- /* Try to trigger the event again. It is deleted, so that
- should be an error. However, on FreeBSD 8 it is not an error,
- so the event is ignored.
- */
- puts(" -- triggering an event that will be ignored");
- kev.flags = 0;
- kev.fflags |= NOTE_TRIGGER;
- if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0)
- err(1, "%s", test_id);
-
test_no_kevents();
success();
OpenPOWER on IntegriCloud