Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F169093283
D58123.id181596.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D58123.id181596.diff
View Options
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -3682,6 +3682,7 @@
*/
p->p_pptr->p_flag |= P_STATCHILD;
wakeup(p->p_pptr);
+ procdesc_jobstate(p);
ps = p->p_pptr->p_sigacts;
mtx_lock(&ps->ps_mtx);
diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c
--- a/sys/kern/sys_procdesc.c
+++ b/sys/kern/sys_procdesc.c
@@ -64,6 +64,7 @@
#include <sys/param.h>
#include <sys/capsicum.h>
+#include <sys/event.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
@@ -342,7 +343,7 @@
return (1);
}
selwakeup(&pd->pd_selinfo);
- KNOTE_LOCKED(&pd->pd_selinfo.si_note, NOTE_EXIT);
+ KNOTE_LOCKED(&pd->pd_selinfo.si_note, NOTE_EXIT | NOTE_PDSIGCHLD);
PROCDESC_UNLOCK(pd);
/* Wakeup all waiters for this procdesc' process exit. */
@@ -350,6 +351,21 @@
return (0);
}
+void
+procdesc_jobstate(struct proc *p)
+{
+ struct procdesc *pd;
+
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+ pd = p->p_procdesc;
+ if (pd == NULL)
+ return;
+
+ PROCDESC_LOCK(pd);
+ KNOTE_LOCKED(&pd->pd_selinfo.si_note, NOTE_PDSIGCHLD);
+ PROCDESC_UNLOCK(pd);
+}
+
/*
* When a process descriptor is reaped, perhaps as a result of close(), release
* the process's reference on the process descriptor.
diff --git a/sys/sys/event.h b/sys/sys/event.h
--- a/sys/sys/event.h
+++ b/sys/sys/event.h
@@ -205,6 +205,7 @@
#define NOTE_EXIT 0x80000000 /* process exited */
#define NOTE_FORK 0x40000000 /* process forked */
#define NOTE_EXEC 0x20000000 /* process exec'd */
+#define NOTE_PDSIGCHLD NOTE_FORK /* pdwait() info available */
#define NOTE_PCTRLMASK 0xf0000000 /* mask for hint bits */
#define NOTE_PDATAMASK 0x000fffff /* mask for pid */
diff --git a/sys/sys/procdesc.h b/sys/sys/procdesc.h
--- a/sys/sys/procdesc.h
+++ b/sys/sys/procdesc.h
@@ -102,6 +102,7 @@
* In-kernel interfaces to process descriptors.
*/
int procdesc_exit(struct proc *);
+void procdesc_jobstate(struct proc *p);
int procdesc_find(struct thread *, int fd, const cap_rights_t *,
struct proc **);
int kern_pdgetpid(struct thread *, int fd, const cap_rights_t *,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 1, 9:40 AM (1 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37800499
Default Alt Text
D58123.id181596.diff (2 KB)
Attached To
Mode
D58123: procdesc: add NOTE_PDSIGCHLD
Attached
Detach File
Event Timeline
Log In to Comment