aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/pdfork.2
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2014-04-07 18:10:49 +0000
committerEd Schouten <ed@FreeBSD.org>2014-04-07 18:10:49 +0000
commit38219d6acdfd2a273e4a08b278aea6cdb3e4945e (patch)
tree86add6f815ce421c32d599a69a835b29dee9b881 /lib/libc/sys/pdfork.2
parent29aa8ff1dd2f68f62c866c8f64748406ddb38bae (diff)
downloadsrc-38219d6acdfd2a273e4a08b278aea6cdb3e4945e.tar.gz
src-38219d6acdfd2a273e4a08b278aea6cdb3e4945e.zip
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@
Notes
Notes: svn path=/head/; revision=264231
Diffstat (limited to 'lib/libc/sys/pdfork.2')
-rw-r--r--lib/libc/sys/pdfork.29
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libc/sys/pdfork.2 b/lib/libc/sys/pdfork.2
index 87f2c8cd8e31..a4895159f2ab 100644
--- a/lib/libc/sys/pdfork.2
+++ b/lib/libc/sys/pdfork.2
@@ -32,7 +32,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 4, 2014
+.Dd April 7, 2014
.Dt PDFORK 2
.Os
.Sh NAME
@@ -117,6 +117,13 @@ and
allow waiting for process state transitions; currently only
.Dv POLLHUP
is defined, and will be raised when the process dies.
+Process state transitions can also be monitored using
+.Xr kqueue 2
+filter
+.Dv EVFILT_PROCDESC ;
+currently only
+.Dv NOTE_EXIT
+is implemented.
.Pp
.Xr close 2
will close the process descriptor unless