1port_alert(3C) Standard C Library Functions port_alert(3C)
2
3
4
6 port_alert - set a port in alert mode
7
9 #include <port.h>
10
11 int port_alert(int port, int flags, int events, void *user);
12
13
15 The port_alert() function transitions a port into or out of alert mode.
16 A port in alert mode immediately awakens all threads blocked in
17 port_get(3C) or port_getn(3C). These threads return with an alert noti‐
18 fication that consists of a single port_event_t structure with the
19 source PORT_SOURCE_ALERT. Subsequent threads trying to retrieve events
20 from a port that is in alert mode will return immediately with the
21 alert notification.
22
23
24 A port is transitioned into alert mode by calling the port_alert()
25 function with a non-zero events parameter. The specified events and
26 user parameters will be made available in the portev_events and the
27 portev_user members of the alert notification, respectively. The flags
28 argument determines the mode of operation of the alert mode:
29
30 o If flags is set to PORT_ALERT_SET, port_alert() sets the
31 port in alert mode independent of the current state of the
32 port. The portev_events and portev_user members are set or
33 updated accordingly.
34
35 o If flags is set to PORT_ALERT_UPDATE and the port is not in
36 alert mode, port_alert() transitions the port into alert
37 mode. The portev_events and portev_user members are set
38 accordingly.
39
40 o If flags is set to PORT_ALERT_UPDATE and the port is already
41 in alert mode, port_alert() returns with an error value of
42 EBUSY.
43
44
45 PORT_ALERT_SET and PORT_ALERT_UPDATE are mutually exclusive.
46
47
48 A port is transitioned out of alert mode by calling the port_alert()
49 function with a zero events parameter.
50
51
52 Events can be queued to a port that is in alert mode, but they will not
53 be retrievable until the port is transitioned out of alert mode.
54
56 Upon succesful completion, 0 is returned. Otherwise, -1 is returned and
57 errno is set to indicate the error.
58
60 The port_alert() function will fail if:
61
62 EBADF The port identifier is not valid.
63
64
65 EBADFD The port argument is not an event port file descriptor.
66
67
68 EBUSY The port is already in alert mode.
69
70
71 EINVAL Mutually exclusive flags are set.
72
73
75 See attributes(5) for descriptions of the following attributes:
76
77
78
79
80 ┌─────────────────────────────┬─────────────────────────────┐
81 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
82 ├─────────────────────────────┼─────────────────────────────┤
83 │Architecture │all │
84 ├─────────────────────────────┼─────────────────────────────┤
85 │Availability │SUNWcsr, SUNWhea │
86 ├─────────────────────────────┼─────────────────────────────┤
87 │Interface Stability │Evolving │
88 ├─────────────────────────────┼─────────────────────────────┤
89 │MT-Level │Safe │
90 └─────────────────────────────┴─────────────────────────────┘
91
93 port_associate(3C), port_create(3C), port_get(3C), port_send(3C),
94 attributes(5)
95
96
97
98SunOS 5.11 1 Oct 2003 port_alert(3C)