save process exit status in kevent NOTE_EXIT



Any reason why this may be a bad idea? I think it'd be useful
for a pwait(1)-like utility (from Solaris).

Index: lib/libc/sys/kqueue.2
===================================================================
RCS file: /home/ncvs/src/lib/libc/sys/kqueue.2,v
retrieving revision 1.44
diff -u -p -r1.44 kqueue.2
--- lib/libc/sys/kqueue.2 17 Sep 2006 21:27:34 -0000 1.44
+++ lib/libc/sys/kqueue.2 17 Nov 2006 18:50:48 -0000
@@ -364,6 +364,8 @@ The events to monitor are:
.Bl -tag -width XXNOTE_TRACKERR
.It NOTE_EXIT
The process has exited.
+The exit status will be stored in
+.Va data .
.It NOTE_FORK
The process has called
.Fn fork .
Index: sys/kern/kern_event.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_event.c,v
retrieving revision 1.106
diff -u -p -r1.106 kern_event.c
--- sys/kern/kern_event.c 25 Sep 2006 01:29:48 -0000 1.106
+++ sys/kern/kern_event.c 17 Nov 2006 18:50:49 -0000
@@ -396,6 +396,7 @@ filt_proc(struct knote *kn, long hint)
if (!(kn->kn_status & KN_DETACHED))
knlist_remove_inevent(&p->p_klist, kn);
kn->kn_flags |= (EV_EOF | EV_ONESHOT);
+ kn->kn_data = kn->kn_ptr.p_proc->p_xstat;
kn->kn_ptr.p_proc = NULL;
return (1);
}
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Tidying src/release/*/{dokern.sh,drivers.conf}
    ... > It finds missing GENERIC entries and cross-checks ... > dokern.sh and drivers.conf for redundant entries. ... > retrieving revision 1.72 ... I assume that they were trimmed for a reason. ...
    (freebsd-current)
  • Re: 2.6.2-rc2 nfsd+xfs spins in i_size_read()
    ... what about this little patch?: ... > retrieving revision 1.212 ... There was some reason this was only necessary on directories, ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • BUS_DMA_ISA unused, planning on removing
    ... and he's cool with removing it. ... reason not to GC this? ... retrieving revision 1.10 ... diff -u -r1.10 isa_dma.c ...
    (freebsd-arch)
  • GCL 2.6.5 Solaris errata
    ... The solaris machine to which I have access just upgraded its ... gcc, ... retrieving revision 1.15 ... unsigned int address,n; ...
    (comp.lang.lisp)