Index: lib/libutil/tests/pidfile_test.c
===================================================================
--- lib/libutil/tests/pidfile_test.c
+++ lib/libutil/tests/pidfile_test.c
@@ -30,6 +30,7 @@
 
 #include <sys/param.h>
 #include <sys/wait.h>
+#include <sys/event.h>
 
 #include <fcntl.h>
 #include <errno.h>
@@ -43,8 +44,8 @@
 #include <libutil.h>
 
 /*
- * We need a signal handler so kill(2) will interrupt our child's
- * select(2) instead of killing it.
+ * We need a signal handler so kill(2) will interrupt the child
+ * instead of killing it.
  */
 static void
 signal_handler(int sig)
@@ -129,7 +130,9 @@
 	struct pidfh *pf = NULL;
 	pid_t other = 0, pid = 0;
 	int fd[2], serrno, status;
+	struct kevent event, ke;
 	char ch;
+	int kq;
 
 	unlink(fn);
 	if (pipe(fd) != 0)
@@ -167,9 +170,17 @@
 			_exit(1);
 		if (pidfile_write(pf) != 0)
 			_exit(1);
+		kq = kqueue();
+		EV_SET(&ke, SIGINT, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL);
+		/* Attach event to the kqueue. */
+		if (kevent(kq, &ke, 1, NULL, 0, NULL) != 0)
+			_exit(1);
+		/* Inform the parent we are ready to receive SIGINT */
 		if (write(fd[1], "*", 1) != 1)
 			_exit(1);
-		select(0, 0, 0, 0, 0);
+		/* Wait for SIGINT received */
+		if (kevent(kq, NULL, 0, &event, 1, NULL) != 1)
+			_exit(1);
 		_exit(0);
 	}
 	// parent