81 int dp_timeout;
82 }
83
84
85
86 The dp_fds points to a buffer that holds an array of returned pollfd
87 structures. The dp_nfds field specifies the size of the buffer in terms
88 of the number of pollfd entries it contains. The dp_nfds field also
89 indicates the maximum number of file descriptors from which poll
90 information can be obtained. If there is no interested events on any
91 of the polled file descriptors, the DP_POLL ioctl call will wait
92 dp_timeout milliseconds before returning. If dp_timeout is 0, the ioctl
93 call returns immediately. If dp_timeout is -1, the call blocks until an
94 interested poll events is available or the call is interrupted. Upon
95 return, if the ioctl call has failed, -1 is returned. The memory
96 content pointed by dp_fds is not modified. A return value 0 means the
97 ioctl is timed out. In this case, the memory content pointed by dp_fds
98 is not modified. If the call is successful, it returns the number of
99 valid pollfd entries in the array pointed by dp_fds; the contents of
100 the rest of the buffer is undefined. For each valid pollfd entry, the
101 fd field indicates the file desciptor on which the polled events
102 happened. The events field is the user specified poll events. The
103 revents field contains the events occurred. -1 is returned if the
104 call fails.
105
106
107 DP_ISPOLLED ioctl allows you to query if a file descriptor is already
108 in the monitored set represented by fd. The fd field of the pollfd
109 structure indicates the file descriptor of interest. The DP_ISPOLLED
110 ioctl returns 1 if the file descriptor is in the set. The events
111 field contains 0. The revents field contains the currently polled
112 events. The ioctl returns 0 if the file descriptor is not in the set.
113 The pollfd structure pointed by pfd is not modified. The ioctl
114 returns a -1 if the call fails.
115
116 EXAMPLES
117 The following example shows how /dev/poll may be used.
118
119 {
120 ...
121 /*
297 multithreaded application, careful coordination among threads doing
298 close and DP_POLL ioctl is recommended for consistent results.
299
300
301 The /dev/poll driver caches a list of polled file descriptors, which
302 are specific to a process. Therefore, the /dev/poll file descriptor of
303 a process will be inherited by its child process, just like any other
304 file descriptors. But the child process will have very limited access
305 through this inherited /dev/poll file descriptor. Any attempt to write
306 or do ioctl by the child process will result in an EACCES error. The
307 child process should close the inherited /dev/poll file descriptor and
308 open its own if desired.
309
310
311 The /dev/poll driver does not yet support polling. Polling on a
312 /dev/poll file descriptor will result in POLLERR being returned in the
313 revents field of pollfd structure.
314
315
316
317 April 9, 2016 POLL(7D)
|
81 int dp_timeout;
82 }
83
84
85
86 The dp_fds points to a buffer that holds an array of returned pollfd
87 structures. The dp_nfds field specifies the size of the buffer in terms
88 of the number of pollfd entries it contains. The dp_nfds field also
89 indicates the maximum number of file descriptors from which poll
90 information can be obtained. If there is no interested events on any
91 of the polled file descriptors, the DP_POLL ioctl call will wait
92 dp_timeout milliseconds before returning. If dp_timeout is 0, the ioctl
93 call returns immediately. If dp_timeout is -1, the call blocks until an
94 interested poll events is available or the call is interrupted. Upon
95 return, if the ioctl call has failed, -1 is returned. The memory
96 content pointed by dp_fds is not modified. A return value 0 means the
97 ioctl is timed out. In this case, the memory content pointed by dp_fds
98 is not modified. If the call is successful, it returns the number of
99 valid pollfd entries in the array pointed by dp_fds; the contents of
100 the rest of the buffer is undefined. For each valid pollfd entry, the
101 fd field indicates the file descriptor on which the polled events
102 happened. The events field is the user specified poll events. The
103 revents field contains the events occurred. -1 is returned if the
104 call fails.
105
106
107 DP_ISPOLLED ioctl allows you to query if a file descriptor is already
108 in the monitored set represented by fd. The fd field of the pollfd
109 structure indicates the file descriptor of interest. The DP_ISPOLLED
110 ioctl returns 1 if the file descriptor is in the set. The events
111 field contains 0. The revents field contains the currently polled
112 events. The ioctl returns 0 if the file descriptor is not in the set.
113 The pollfd structure pointed by pfd is not modified. The ioctl
114 returns a -1 if the call fails.
115
116 EXAMPLES
117 The following example shows how /dev/poll may be used.
118
119 {
120 ...
121 /*
297 multithreaded application, careful coordination among threads doing
298 close and DP_POLL ioctl is recommended for consistent results.
299
300
301 The /dev/poll driver caches a list of polled file descriptors, which
302 are specific to a process. Therefore, the /dev/poll file descriptor of
303 a process will be inherited by its child process, just like any other
304 file descriptors. But the child process will have very limited access
305 through this inherited /dev/poll file descriptor. Any attempt to write
306 or do ioctl by the child process will result in an EACCES error. The
307 child process should close the inherited /dev/poll file descriptor and
308 open its own if desired.
309
310
311 The /dev/poll driver does not yet support polling. Polling on a
312 /dev/poll file descriptor will result in POLLERR being returned in the
313 revents field of pollfd structure.
314
315
316
317 January 10, 2020 POLL(7D)
|