Changeset View
Changeset View
Standalone View
Standalone View
lib/libsys/kqueue.2
| Show First 20 Lines • Show All 586 Lines • ▼ Show 20 Lines | ||||||||||
| and returns when the associated process performs one or more of the | and returns when the associated process performs one or more of the | |||||||||
| requested events. | requested events. | |||||||||
| The events to monitor are: | The events to monitor are: | |||||||||
| .Bl -tag -width "Dv NOTE_PDSIGCHLD" | .Bl -tag -width "Dv NOTE_PDSIGCHLD" | |||||||||
| .It Dv NOTE_EXIT | .It Dv NOTE_EXIT | |||||||||
| The process has exited. | The process has exited. | |||||||||
| The exit status will be stored in | The exit status will be stored in | |||||||||
| .Va data . | .Va data . | |||||||||
| .It Dv NOTE_FORK | ||||||||||
| The process has forked. | ||||||||||
| The process identifier | ||||||||||
markjUnsubmitted Done Inline Actions
markj: | ||||||||||
Done Inline Actions
since you use it below. Or write, The process identifier (PID) of the ... markj: since you use it below. Or write, `The process identifier (PID) of the ...` | ||||||||||
| .Pq PID | ||||||||||
| of the most recently forked child is returned in the | ||||||||||
| .Va data | ||||||||||
| field. | ||||||||||
Done Inline Actions
markj: | ||||||||||
| .Pp | ||||||||||
Done Inline Actions
Also, if the process raises NOTE_EXIT, the last PID will be overwritten (but I think we will return NOTE_FORK | NOTE_EXIT). markj: Also, if the process raises NOTE_EXIT, the last PID will be overwritten (but I think we will… | ||||||||||
| The identifier is advisory; | ||||||||||
| if several children were spawned before the event is returned, | ||||||||||
| only one of the PIDs is returned. | ||||||||||
Done Inline ActionsPerhaps mention ptrace(2) explicitly? markj: Perhaps mention ptrace(2) explicitly? | ||||||||||
Done Inline Actions
markj: | ||||||||||
| Other mechanisms provide reliable reporting of fork events. | ||||||||||
Done Inline Actions
markj: | ||||||||||
| For instance, debugging the process with a subscription for relevant | ||||||||||
| events would serialize forks. | ||||||||||
| See | ||||||||||
| .Xr ptrace 2 | ||||||||||
| and the description of the | ||||||||||
| .Dv PT_FOLLOW_FORK | ||||||||||
| request. | ||||||||||
| .Pp | ||||||||||
| Unlike the | ||||||||||
| .Dv EVFILT_PROC | ||||||||||
| filter, | ||||||||||
| the | ||||||||||
| .Dv NOTE_TRACK | ||||||||||
| pseudo-event is not supported. | ||||||||||
| .Pp | ||||||||||
| If both | ||||||||||
| .Dv NOTE_EXIT | ||||||||||
| and | ||||||||||
| .Dv NOTE_FORK | ||||||||||
| events are reported, then the | ||||||||||
| .Va data | ||||||||||
| field contains the exit status of the process, | ||||||||||
| and the last child's PID is not returned. | ||||||||||
Done Inline Actions
markj: | ||||||||||
| .It Dv NOTE_PDSIGCHLD | .It Dv NOTE_PDSIGCHLD | |||||||||
| Activates on events that are reported through | Activates on events that are reported through | |||||||||
| .Xr pdwait 2 | .Xr pdwait 2 | |||||||||
| on the process descriptor. | on the process descriptor. | |||||||||
| After the event is reported, the | After the event is reported, the | |||||||||
| .Xr pdwait 2 | .Xr pdwait 2 | |||||||||
| can be called to obtain the information about the process | can be called to obtain the information about the process | |||||||||
| status change. | status change. | |||||||||
| ▲ Show 20 Lines • Show All 395 Lines • Show Last 20 Lines | ||||||||||