PORT_ALERT(3C) | Standard C Library Functions | PORT_ALERT(3C) |
port_alert - set a port in alert mode
#include <port.h> int port_alert(int port, int flags, int events, void *user);
The port_alert() function transitions a port into or out of alert mode. A port in alert mode immediately awakens all threads blocked in port_get(3C) or port_getn(3C). These threads return with an alert notification that consists of a single port_event_t structure with the source PORT_SOURCE_ALERT. Subsequent threads trying to retrieve events from a port that is in alert mode will return immediately with the alert notification.
A port is transitioned into alert mode by calling the port_alert() function with a non-zero events parameter. The specified events and user parameters will be made available in the portev_events and the portev_user members of the alert notification, respectively. The flags argument determines the mode of operation of the alert mode:
PORT_ALERT_SET and PORT_ALERT_UPDATE are mutually exclusive.
A port is transitioned out of alert mode by calling the port_alert() function with a zero events parameter.
Events can be queued to a port that is in alert mode, but they will not be retrievable until the port is transitioned out of alert mode.
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
The port_alert() function will fail if:
EBADF
EBADFD
EBUSY
EINVAL
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Architecture | all |
Interface Stability | Evolving |
MT-Level | Safe |
port_associate(3C), port_create(3C), port_get(3C), port_send(3C), attributes(7)
April 9, 2016 | OmniOS |