Page MenuHomeFreeBSD

kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT
ClosedPublic

Authored by vangyzen on Jan 12 2016, 7:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 4:36 AM
Unknown Object (File)
Tue, Nov 12, 9:45 PM
Unknown Object (File)
Sep 18 2024, 3:44 AM
Unknown Object (File)
Sep 16 2024, 4:34 AM
Unknown Object (File)
Sep 8 2024, 2:32 PM
Unknown Object (File)
Sep 8 2024, 8:32 AM
Unknown Object (File)
Sep 7 2024, 7:52 AM
Unknown Object (File)
Aug 30 2024, 7:43 AM
Subscribers

Details

Summary

NOTE_CHILD and NOTE_EXIT return something in kevent.data: the parent
pid (ppid) for NOTE_CHILD and the exit status for NOTE_EXIT.
Do not let the two events be combined, since one would overwrite
the other's data.

PR: 180385
MFC after: 2 weeks
Submitted by: David A. Bright <david_a_bright@dell.com>
Sponsored by: Dell Inc.

Test Plan

A unit test is included.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vangyzen retitled this revision from to kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT.
vangyzen updated this object.
vangyzen edited the test plan for this revision. (Show Details)
vangyzen edited edge metadata.

On the surface I think this looks good. Keeping NOTE_CHILD and NOTE_EXIT separate is definitely the right approach to avoid losing data.

tests/sys/kqueue/proc.c
98 ↗(On Diff #12217)

I would probably say that a pipe() is best for a test, even if it is more work than a bare sleep().

194 ↗(On Diff #12217)

s/CHILD/EXIT/

Use a pipe, instead of sleeping, for process synchronization.

Fix a copy-and-paste-o.

tests/sys/kqueue/proc.c
98 ↗(On Diff #12225)

Agreed. In fact, the code that found this uses a pipe.

This revision was automatically updated to reflect the committed changes.