Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163447654
D58327.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
973 B
Referenced Files
None
Subscribers
None
D58327.diff
View Options
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
@@ -493,16 +493,25 @@
procdesc_kqops_event(struct knote *kn, long hint)
{
struct procdesc *pd;
+ struct proc *p;
u_int event;
pd = kn->kn_fp->f_data;
if (hint == 0) {
/*
* Initial test after registration. Generate notes in
- * case the process already terminated before registration.
+ * case the process already terminated before
+ * registration, or is stopped, or traced, with an event
+ * pending.
*/
- event = (pd->pd_flags & PDF_EXITED) != 0 ? (NOTE_EXIT |
- NOTE_PDSIGCHLD) : 0;
+ p = pd->pd_proc;
+ if ((pd->pd_flags & PDF_EXITED) != 0)
+ event = NOTE_EXIT | NOTE_PDSIGCHLD;
+ else if ((atomic_load_int(&p->p_flag) & (P_STOPPED_SIG |
+ P_STOPPED_TRACE)) != 0)
+ event = NOTE_PDSIGCHLD;
+ else
+ event = 0;
} else {
/* Mask off extra data. */
event = (u_int)hint & NOTE_PCTRLMASK;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 7:07 AM (13 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35296987
Default Alt Text
D58327.diff (973 B)
Attached To
Mode
D58327: procdesc: report NOTE_PDSIGCHLD for traced/stopped process
Attached
Detach File
Event Timeline
Log In to Comment