pollset.h File
Purpose
Defines structures and flags that are used by pollset subroutines.
Description
The /usr/include/sys/pollset.h file defines several structures that are used
by the pollset subroutines. The pollset_poll subroutine or the
pollset_poll_ext subroutine checks the I/O status of the file descriptors specified
by an array of poll_ctl or poll_ctl_ext structures. The following
tables lists the commands that are defined in the /usr/include/sys/pollset.h
file. These commands can be used with the pollset_poll subroutine or the
pollset_poll_ext subroutine.
| Command | Description |
|---|---|
| PS_ADD | Add a valid open file descriptor to the set of pollset file
descriptors. |
| PS_MOD | If the file descriptor is already present in the pollset file descriptors, bits from the
events field that is defined in the poll_ctl structure or the
pollfd structure, are added to the events that are monitored by the kernel and
user-specified data is updated with a new value. If the file descriptor is not present in the
pollset file descriptors, the file descriptor is added to the pollset file
descriptors. |
| PS_DELETE | Remove a file descriptor from the set of pollset file descriptors. |
| PS_REPLACE | If the file descriptor is already present in the set of pollset file
descriptors, replace the value in the events field and user-specified data of the
pollset file descriptors set, with a new value specified in the
poll_ctl structure. |
The poll_ctl structure or the poll_ctl_ext structure is used to
perform operations on the pollset structure, and the pollset
structure is passed as an input to the pollset_ctl subroutine or the
pollset_ctl_ext subroutine. Two versions of the poll_ctl structure
or the poll_ctl_ext structure are compatible with the pollset_ctl
subroutine or the pollset_ctl_ext subroutine.
poll_ctl structure or the
poll_ctl_ext structure that is defined in the pollset.h
file:
| Item | Description |
|---|---|
version |
The version field has the following values:
|
command |
Specifies the pollset command that is used to read data from the structure
and to determine how to modify the pollset file descriptor. |
events |
Indicates events that are being tracked by the kernel. The events field can also contain one
of the following flags:
|
poll_ctl structure or the
poll_ctl_ext structure, or these structures can be populated directly.
| Item | Description |
|---|---|
POLL_CTL_INIT(struct poll_ctl *, command, events, fd) |
Initializes the poll_ctl structure. |
POLL_CTL_EXT_INIT_V1(struct poll_ctl_ext *, command, events, fd,
data) |
Initializes the poll_ctl_ext structure with an extended format that supports
user-specified data. |