diff options
author | 2013-05-31 19:01:56 +0000 | |
---|---|---|
committer | 2013-05-31 19:01:56 +0000 | |
commit | 00b96b7b7fa3b2bfe014cf1f70acc6e56cdf39ac (patch) | |
tree | 55fdc834564d1ee364d922cb9bcb5975a3ab7336 | |
parent | add shm_open and friends which i have been told ports programs would (diff) | |
download | wireguard-openbsd-00b96b7b7fa3b2bfe014cf1f70acc6e56cdf39ac.tar.xz wireguard-openbsd-00b96b7b7fa3b2bfe014cf1f70acc6e56cdf39ac.zip |
On NOTE_EXIT event of EVFILT_PROC, store the exit status in kn_data.
ok guenther tedu deraadt
-rw-r--r-- | lib/libc/sys/kqueue.2 | 9 | ||||
-rw-r--r-- | sys/kern/kern_event.c | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 55266bff364..a678aeed158 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: kqueue.2,v 1.25 2012/04/12 14:25:57 deraadt Exp $ +.\" $OpenBSD: kqueue.2,v 1.26 2013/05/31 19:01:56 yasuoka Exp $ .\" .\" Copyright (c) 2000 Jonathan Lemon .\" All rights reserved. @@ -26,7 +26,7 @@ .\" .\" $FreeBSD: src/lib/libc/sys/kqueue.2,v 1.18 2001/02/14 08:48:35 guido Exp $ .\" -.Dd $Mdocdate: April 12 2012 $ +.Dd $Mdocdate: May 31 2013 $ .Dt KQUEUE 2 .Os .Sh NAME @@ -368,6 +368,10 @@ The events to monitor are: .Bl -tag -width XXNOTE_TRACKERR .It Dv NOTE_EXIT The process has exited. +The exit status will be stored in +.Va data +in the same format as the status set by +.Xr wait 2 . .It Dv NOTE_FORK The process has called .Fn fork . @@ -505,6 +509,7 @@ The specified process to attach to does not exist. .Xr read 2 , .Xr select 2 , .Xr sigaction 2 , +.Xr wait 2 , .Xr write 2 , .Xr signal 3 .Sh HISTORY diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 9a57e8e6672..3a7132d7445 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.49 2013/04/24 09:52:54 nicm Exp $ */ +/* $OpenBSD: kern_event.c,v 1.50 2013/05/31 19:01:56 yasuoka Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -292,6 +292,7 @@ filt_proc(struct knote *kn, long hint) kn->kn_status |= KN_DETACHED; kn->kn_flags |= (EV_EOF | EV_ONESHOT); + kn->kn_data = pr->ps_mainproc->p_xstat; SLIST_REMOVE(&pr->ps_klist, kn, knote, kn_selnext); return (1); } |