summaryrefslogtreecommitdiffstats
path: root/tools/regression/kqueue/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/regression/kqueue/proc.c')
-rw-r--r--tools/regression/kqueue/proc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/regression/kqueue/proc.c b/tools/regression/kqueue/proc.c
index d4e863e..6288ee6 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)
+ errx(1, "kqueue inherited across fork! (%s() at %s:%d)",
+ __func__, __FILE__, __LINE__);
+
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);
OpenPOWER on IntegriCloud