summaryrefslogtreecommitdiffstats
path: root/sys/sys/event.h
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2014-04-07 18:10:49 +0000
committered <ed@FreeBSD.org>2014-04-07 18:10:49 +0000
commit87c17a9c6666c07778d84cde29bff0fe8830ca77 (patch)
tree86add6f815ce421c32d599a69a835b29dee9b881 /sys/sys/event.h
parentb9ab124041f69613e738fb1f1f6916cca7b0f786 (diff)
downloadFreeBSD-src-87c17a9c6666c07778d84cde29bff0fe8830ca77.zip
FreeBSD-src-87c17a9c6666c07778d84cde29bff0fe8830ca77.tar.gz
Implement kqueue(2) for procdesc(4).
kqueue(2) already supports EVFILT_PROC. Add an EVFILT_PROCDESC that behaves the same, but operates on a procdesc(4) instead. Only implement NOTE_EXIT for now. The nice thing about NOTE_EXIT is that it also returns the exit status of the process, meaning that we can now obtain this value, even if pdwait4(2) is still unimplemented. Notes: - Simply reuse EVFILT_NETDEV for EVFILT_PROCDESC. As both of these will be used on totally different descriptor types, this should not clash. - Let procdesc_kqops_event() reuse the same structure as filt_proc(). The only difference is that procdesc_kqops_event() should also be able to deal with the case where the process was already terminated after registration. Simply test this when hint == 0. - Fix some style(9) issues in filt_proc() to keep it consistent with the newly added procdesc_kqops_event(). - Save the exit status of the process in pd->pd_xstat, as we cannot pick up the proctree_lock from within procdesc_kqops_event(). Discussed on: arch@ Reviewed by: kib@
Diffstat (limited to 'sys/sys/event.h')
-rw-r--r--sys/sys/event.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/event.h b/sys/sys/event.h
index 3b765c0..1f27c4d 100644
--- a/sys/sys/event.h
+++ b/sys/sys/event.h
@@ -38,7 +38,7 @@
#define EVFILT_PROC (-5) /* attached to struct proc */
#define EVFILT_SIGNAL (-6) /* attached to struct proc */
#define EVFILT_TIMER (-7) /* timers */
-/* EVFILT_NETDEV (-8) no longer supported */
+#define EVFILT_PROCDESC (-8) /* attached to process descriptors */
#define EVFILT_FS (-9) /* filesystem events */
#define EVFILT_LIO (-10) /* attached to lio requests */
#define EVFILT_USER (-11) /* User events */
@@ -120,7 +120,7 @@ struct kevent {
#define NOTE_REVOKE 0x0040 /* vnode access was revoked */
/*
- * data/hint flags for EVFILT_PROC, shared with userspace
+ * data/hint flags for EVFILT_PROC and EVFILT_PROCDESC, shared with userspace
*/
#define NOTE_EXIT 0x80000000 /* process exited */
#define NOTE_FORK 0x40000000 /* process forked */
OpenPOWER on IntegriCloud