Markup improvements: use Dv for kqueue filters, events and note names
ok wiz@
This commit is contained in:
parent
25f00d5999
commit
2373d24da1
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: kqueue.2,v 1.47 2018/01/09 03:31:12 christos Exp $
|
||||
.\" $NetBSD: kqueue.2,v 1.48 2019/04/12 10:57:27 abhinav Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2000 Jonathan Lemon
|
||||
.\" All rights reserved.
|
||||
|
@ -198,31 +198,31 @@ The
|
|||
.Va flags
|
||||
field can contain the following values:
|
||||
.Bl -tag -width XXXEV_ONESHOT -offset indent
|
||||
.It EV_ADD
|
||||
.It Dv EV_ADD
|
||||
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,
|
||||
unless overridden by the EV_DISABLE flag.
|
||||
.It EV_ENABLE
|
||||
.It Dv EV_ENABLE
|
||||
Permit
|
||||
.Fn kevent
|
||||
to return the event if it is triggered.
|
||||
.It EV_DISABLE
|
||||
.It Dv EV_DISABLE
|
||||
Disable the event so
|
||||
.Fn kevent
|
||||
will not return it.
|
||||
The filter itself is not disabled.
|
||||
.It EV_DISPATCH
|
||||
.It Dv EV_DISPATCH
|
||||
Disable the event source immediately after delivery of an event.
|
||||
See
|
||||
.Dv EV_DISABLE
|
||||
above.
|
||||
.It EV_DELETE
|
||||
.It Dv EV_DELETE
|
||||
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_RECEIPT
|
||||
.It Dv EV_RECEIPT
|
||||
This flag is useful for making bulk changes to a kqueue without draining
|
||||
any pending events.
|
||||
When passed as input, it forces
|
||||
|
@ -231,18 +231,18 @@ to always be returned.
|
|||
When a filter is successfully added the
|
||||
.Va data
|
||||
field will be zero.
|
||||
.It EV_ONESHOT
|
||||
.It Dv 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, it is deleted.
|
||||
.It EV_CLEAR
|
||||
.It Dv 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 set this flag internally.
|
||||
.It EV_EOF
|
||||
.It Dv EV_EOF
|
||||
Filters may set this flag to indicate filter-specific EOF condition.
|
||||
.It EV_ERROR
|
||||
.It Dv EV_ERROR
|
||||
See
|
||||
.Sx RETURN VALUES
|
||||
below.
|
||||
|
@ -263,14 +263,14 @@ are supported on the file descriptor returned by
|
|||
to map a filter name to a filter number, and vice-versa (passing
|
||||
arguments in a structure described below):
|
||||
.Bl -tag -width KFILTER_BYFILTER -offset indent
|
||||
.It KFILTER_BYFILTER
|
||||
.It Dv KFILTER_BYFILTER
|
||||
Map
|
||||
.Va filter
|
||||
to
|
||||
.Va name ,
|
||||
which is of size
|
||||
.Va len .
|
||||
.It KFILTER_BYNAME
|
||||
.It Dv KFILTER_BYNAME
|
||||
Map
|
||||
.Va name
|
||||
to
|
||||
|
@ -297,7 +297,7 @@ fields in the kevent structure.
|
|||
.Pp
|
||||
The predefined system filters are:
|
||||
.Bl -tag -width EVFILT_SIGNAL
|
||||
.It EVFILT_READ
|
||||
.It Dv EVFILT_READ
|
||||
Takes a descriptor as the identifier, and returns whenever
|
||||
there is data available to read.
|
||||
The behavior of the filter is slightly different depending
|
||||
|
@ -350,7 +350,7 @@ This may be cleared by passing in EV_CLEAR, at which point the
|
|||
filter will resume waiting for data to become available before
|
||||
returning.
|
||||
.El
|
||||
.It EVFILT_WRITE
|
||||
.It Dv EVFILT_WRITE
|
||||
Takes a descriptor as the identifier, and returns whenever
|
||||
it is possible to write to the descriptor.
|
||||
For sockets, pipes, fifos, and ttys,
|
||||
|
@ -362,7 +362,7 @@ Note that this filter is not supported for vnodes.
|
|||
.Pp
|
||||
For sockets, the low water mark and socket error handling is
|
||||
identical to the EVFILT_READ case.
|
||||
.It EVFILT_AIO
|
||||
.It Dv EVFILT_AIO
|
||||
This is not implemented in
|
||||
.Nx .
|
||||
.ig
|
||||
|
@ -391,26 +391,26 @@ 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
|
||||
.It Dv EVFILT_VNODE
|
||||
Takes a file descriptor as the identifier and the events to watch for in
|
||||
.Va fflags ,
|
||||
and returns when one or more of the requested events occurs on the descriptor.
|
||||
The events to monitor are:
|
||||
.Bl -tag -width XXNOTE_RENAME
|
||||
.It NOTE_DELETE
|
||||
.It Dv NOTE_DELETE
|
||||
.Xr unlink 2
|
||||
was called on the file referenced by the descriptor.
|
||||
.It NOTE_WRITE
|
||||
.It Dv NOTE_WRITE
|
||||
A write occurred on the file referenced by the descriptor.
|
||||
.It NOTE_EXTEND
|
||||
.It Dv NOTE_EXTEND
|
||||
The file referenced by the descriptor was extended.
|
||||
.It NOTE_ATTRIB
|
||||
.It Dv NOTE_ATTRIB
|
||||
The file referenced by the descriptor had its attributes changed.
|
||||
.It NOTE_LINK
|
||||
.It Dv NOTE_LINK
|
||||
The link count on the file changed.
|
||||
.It NOTE_RENAME
|
||||
.It Dv NOTE_RENAME
|
||||
The file referenced by the descriptor was renamed.
|
||||
.It NOTE_REVOKE
|
||||
.It Dv NOTE_REVOKE
|
||||
Access to the file was revoked via
|
||||
.Xr revoke 2
|
||||
or the underlying file system was unmounted.
|
||||
|
@ -419,7 +419,7 @@ or the underlying file system was unmounted.
|
|||
On return,
|
||||
.Va fflags
|
||||
contains the events which triggered the filter.
|
||||
.It EVFILT_PROC
|
||||
.It Dv EVFILT_PROC
|
||||
Takes the process ID to monitor as the identifier and the events to watch for
|
||||
in
|
||||
.Va fflags ,
|
||||
|
@ -427,18 +427,18 @@ and returns when the process performs one or more of the requested events.
|
|||
If a process can normally see another process, it can attach an event to it.
|
||||
The events to monitor are:
|
||||
.Bl -tag -width XXNOTE_TRACKERR
|
||||
.It NOTE_EXIT
|
||||
.It Dv NOTE_EXIT
|
||||
The process has exited.
|
||||
The exit code of the process is stored in
|
||||
.Va data .
|
||||
.It NOTE_FORK
|
||||
.It Dv NOTE_FORK
|
||||
The process has called
|
||||
.Xr fork 2 .
|
||||
.It NOTE_EXEC
|
||||
.It Dv NOTE_EXEC
|
||||
The process has executed a new process via
|
||||
.Xr execve 2
|
||||
or similar call.
|
||||
.It NOTE_TRACK
|
||||
.It Dv NOTE_TRACK
|
||||
Follow a process across
|
||||
.Xr fork 2
|
||||
calls.
|
||||
|
@ -448,7 +448,7 @@ field, while the child process will return with NOTE_CHILD set in
|
|||
.Va fflags
|
||||
and the parent PID in
|
||||
.Va data .
|
||||
.It NOTE_TRACKERR
|
||||
.It Dv NOTE_TRACKERR
|
||||
This flag is returned if the system was unable to attach an event to
|
||||
the child process, usually due to resource limitations.
|
||||
.El
|
||||
|
@ -456,7 +456,7 @@ the child process, usually due to resource limitations.
|
|||
On return,
|
||||
.Va fflags
|
||||
contains the events which triggered the filter.
|
||||
.It EVFILT_SIGNAL
|
||||
.It Dv EVFILT_SIGNAL
|
||||
Takes the signal number to monitor as the identifier and returns
|
||||
when the given signal is delivered to the current process.
|
||||
This coexists with the
|
||||
|
@ -472,7 +472,7 @@ Event notification happens after normal signal delivery processing.
|
|||
returns the number of times the signal has occurred since the last call to
|
||||
.Fn kevent .
|
||||
This filter automatically sets the EV_CLEAR flag internally.
|
||||
.It EVFILT_TIMER
|
||||
.It Dv EVFILT_TIMER
|
||||
Establishes an arbitrary timer identified by
|
||||
.Va ident .
|
||||
When adding a timer,
|
||||
|
|
Loading…
Reference in New Issue