diff options
Diffstat (limited to 'lib/libc/sys/kqueue.2')
-rw-r--r-- | lib/libc/sys/kqueue.2 | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 4baaf69..5e84e8a 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -124,15 +124,18 @@ specified unlike If .Fa timeout is a non-NULL pointer, it specifies a maximum interval to wait -for an event, which will be interpreted as a struct timespec. If +for an event, which will be interpreted as a struct timespec. +If .Fa timeout is a NULL pointer, .Fn kevent -waits indefinitely. To effect a poll, the +waits indefinitely. +To effect a poll, the .Fa timeout argument should be non-NULL, pointing to a zero-valued .Va timespec -structure. The same array may be used for the +structure. +The same array may be used for the .Fa changelist and .Fa eventlist . @@ -165,7 +168,8 @@ Value used to identify this event. The exact interpretation is determined by the attached filter, but often is a file descriptor. .It filter -Identifies the kernel filter used to process this event. The pre-defined +Identifies the kernel filter used to process this event. +The pre-defined system filters are described below. .It flags Actions to perform on the event. @@ -182,9 +186,11 @@ The field can contain the following values: .Bl -tag -width XXXEV_ONESHOT .It EV_ADD -Adds the event to the kqueue. Re-adding an existing event +Adds the event to the kqueue. +Re-adding an existing event will modify the parameters of the original event, and not result -in a duplicate entry. Adding an event automatically enables it, +in a duplicate entry. +Adding an event automatically enables it, unless overridden by the EV_DISABLE flag. .It EV_ENABLE Permit @@ -193,19 +199,23 @@ to return the event if it is triggered. .It EV_DISABLE Disable the event so .Fn kevent -will not return it. The filter itself is not disabled. +will not return it. +The filter itself is not disabled. .It EV_DELETE -Removes the event from the kqueue. Events which are attached to +Removes the event from the kqueue. +Events which are attached to file descriptors are automatically deleted on the last close of the descriptor. .It EV_ONESHOT Causes the event to return only the first occurrence of the filter -being triggered. After the user retrieves the event from the kqueue, +being triggered. +After the user retrieves the event from the kqueue, it is deleted. .It EV_CLEAR After the event is retrieved by the user, its state is reset. This is useful for filters which report state transitions -instead of the current state. Note that some filters may automatically +instead of the current state. +Note that some filters may automatically set this flag internally. .It EV_EOF Filters may set this flag to indicate filter-specific EOF condition. @@ -283,7 +293,8 @@ contains the number of bytes available. .El .It EVFILT_WRITE Takes a descriptor as the identifier, and returns whenever -it is possible to write to the descriptor. For sockets, pipes +it is possible to write to the descriptor. +For sockets, pipes and fifos, .Va data will contain the amount of space remaining in the write buffer. @@ -319,7 +330,8 @@ Alternatively, a kevent structure may be initialized, with containing the descriptor of the kqueue, and the address of the kevent structure placed in the .Va aio_lio_opcode -field of the AIO request. However, this approach will not work on +field of the AIO request. +However, this approach will not work on architectures with 64-bit pointers, and should be considered deprecated. .It EVFILT_VNODE Takes a file descriptor as the identifier and the events to watch for in @@ -371,7 +383,8 @@ or similar call. .It NOTE_TRACK Follow a process across .Fn fork -calls. The parent process will return with NOTE_TRACK set in the +calls. +The parent process will return with NOTE_TRACK set in the .Va fflags field, while the child process will return with NOTE_CHILD set in .Va fflags @@ -392,9 +405,11 @@ This coexists with the .Fn signal and .Fn sigaction -facilities, and has a lower precedence. The filter will record +facilities, and has a lower precedence. +The filter will record all attempts to deliver a signal to a process, even if the signal has -been marked as SIG_IGN. Event notification happens after normal +been marked as SIG_IGN. +Event notification happens after normal signal delivery processing. .Va data returns the number of times the signal has occurred since the last call to |