diff options
| author | Jonathan Anderson <jonathan@FreeBSD.org> | 2011-07-07 18:07:03 +0000 |
|---|---|---|
| committer | Jonathan Anderson <jonathan@FreeBSD.org> | 2011-07-07 18:07:03 +0000 |
| commit | 0136244a52e8bf8391a286a95830567b864211c7 (patch) | |
| tree | f40dbd027ae029159206ef752c984c56ebb54415 /tools | |
| parent | 4fe84775390405218ac1e5f46d8e91902bd37587 (diff) | |
Notes
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/regression/kqueue/config.h | 8 | ||||
| -rw-r--r-- | tools/regression/kqueue/main.c | 3 | ||||
| -rw-r--r-- | tools/regression/kqueue/proc.c | 16 |
3 files changed, 21 insertions, 6 deletions
diff --git a/tools/regression/kqueue/config.h b/tools/regression/kqueue/config.h index 2a377db5887a..9ca8cde17eba 100644 --- a/tools/regression/kqueue/config.h +++ b/tools/regression/kqueue/config.h @@ -1,7 +1,7 @@ -/* AUTOMATICALLY GENERATED -- DO NOT EDIT */ -/* $FreeBSD$ */ -#define HAVE_ERR_H -#define HAVE_SYS_EVENT_H +# $FreeBSD$ + +#define HAVE_ERR_H 1 +#define HAVE_SYS_EVENT_H 1 #define HAVE_EV_DISPATCH 1 #define HAVE_EV_RECEIPT 1 #undef HAVE_NOTE_TRUNCATE diff --git a/tools/regression/kqueue/main.c b/tools/regression/kqueue/main.c index 182003c32aa5..f76c4e23be12 100644 --- a/tools/regression/kqueue/main.c +++ b/tools/regression/kqueue/main.c @@ -18,6 +18,7 @@ #include <sys/types.h> +#include "config.h" #include "common.h" int testnum = 1; @@ -230,7 +231,7 @@ test_kqueue_close(void) int main(int argc, char **argv) { - int test_proc = 0; /* XXX-FIXME */ + int test_proc = 1; int test_socket = 1; int test_signal = 1; int test_vnode = 1; diff --git a/tools/regression/kqueue/proc.c b/tools/regression/kqueue/proc.c index d4e863eefe02..2835c649e772 100644 --- a/tools/regression/kqueue/proc.c +++ b/tools/regression/kqueue/proc.c @@ -16,6 +16,11 @@ * $FreeBSD$ */ +#include <sys/stat.h> + +#include <err.h> + +#include "config.h" #include "common.h" static int sigusr1_caught = 0; @@ -37,6 +42,11 @@ add_and_delete(void) /* Create a child that waits to be killed and then exits */ pid = fork(); if (pid == 0) { + struct stat s; + if ((fstat(kqfd, &s) != -1) || (errno != EBADF)) + err(1, "%s:%d - %s: fstat(kqfd) in child did not return EBADF", + __FILE__, __LINE__, __func__); + pause(); exit(2); } @@ -52,6 +62,7 @@ add_and_delete(void) test_begin("kevent(EVFILT_PROC, EV_DELETE)"); + sleep(1); test_no_kevents(); kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_DELETE, 0, 0, NULL); if (kill(pid, SIGKILL) < 0) @@ -63,6 +74,7 @@ add_and_delete(void) } +#ifdef TODO static void event_trigger(void) { @@ -93,7 +105,6 @@ event_trigger(void) success(); } -#ifdef TODO void test_kevent_signal_disable(void) { @@ -225,7 +236,10 @@ test_evfilt_proc() signal(SIGUSR1, sig_handler); add_and_delete(); + +#if TODO event_trigger(); +#endif signal(SIGUSR1, SIG_DFL); |
