diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-06-08 10:10:29 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-06-08 10:10:29 +0000 |
commit | 8cb9f5acecaded019a9a55454a31dcf4328d0d1b (patch) | |
tree | 7c69e28b9b9b5ac2d9f928324a663becf2efa2d7 /usr/src/man/man3c/select.3c | |
parent | 3a5445f1b9d90e4f1538503bd60913c8f302c17f (diff) | |
parent | 79809f9cf402f130667349b2d4007ecd65d63c6f (diff) | |
download | illumos-joyent-release-20170608.tar.gz |
[illumos-gate merge]release-20170608
commit 79809f9cf402f130667349b2d4007ecd65d63c6f
8269 dtrace stddev aggregation is normalized incorrectly
commit 22c8b9583d07895c16549075a53668d7bc988cf3
8108 zdb -l fails to read labels 2 and 3
commit 0255edcc85fc0cd1dda0e49bcd52eb66c06a1b16
8056 zfs send size estimate is inaccurate for some zvols
commit dbfd9f930004c390a2ce2cf850c71b4f880eef9c
8156 dbuf_evict_notify() does not need dbuf_evict_lock
commit 690031d326342fa4ea28b5e80f1ad6a16281519d
8168 NULL pointer dereference in zfs_create()
commit 7c4ab494ff60bbbcc0889e71388ae63e903bbf57
8276 rpcbind leaks memory due to libumem per thread caching.
commit f176a0a4cd61cbd708a7f25dc30d221f4d5902ba
8270 dnlc_reverse_lookup() is unsafe at any speed
commit 72d3dbb9ab4481606cb93caca98ba3b3a8eb6ce2
8300 fix man page issues found by mandoc 1.14.1
commit cb4d790db8fe85bce9f9647fe4e1bdc274c7af1c
8337 gss: misleading-indentation
commit f53522305c07915a44e86f2455cc62e7aac27037
8324 more: misleading-indentation
Conflicts:
usr/src/uts/common/fs/lookup.c
usr/src/man/man3c/thrd_equal.3c
Diffstat (limited to 'usr/src/man/man3c/select.3c')
-rw-r--r-- | usr/src/man/man3c/select.3c | 110 |
1 files changed, 63 insertions, 47 deletions
diff --git a/usr/src/man/man3c/select.3c b/usr/src/man/man3c/select.3c index 2cf0538f82..1752625126 100644 --- a/usr/src/man/man3c/select.3c +++ b/usr/src/man/man3c/select.3c @@ -125,7 +125,8 @@ The .Fn select function has no .Fa sigmask -argument. It behaves as +argument. +It behaves as .Fn pselect does when .Fa sigmask @@ -142,9 +143,9 @@ The .Fn select and .Fn pselect -functions support regular files, -terminal and pseudo-terminal devices, STREAMS-based files, FIFOs, pipes, and -sockets. The behavior of +functions support regular files, terminal and pseudo-terminal devices, +STREAMS-based files, FIFOs, pipes, and sockets. +The behavior of .Fn select and .Fn pselect @@ -192,13 +193,13 @@ Upon successful completion, the objects pointed to by the .Fa writefs , and .Fa errorfds -arguments are modified to indicate which file -descriptors are ready for reading, ready for writing, or have an error -condition pending, respectively, and return the total number of ready -descriptors in all the output sets. For each file descriptor less than +arguments are modified to indicate which file descriptors are ready for reading, +ready for writing, or have an error condition pending, respectively, and return +the total number of ready descriptors in all the output sets. +For each file descriptor less than .Fa nfds , -the corresponding bit will be set on successful completion if it -was set on input and the associated condition is true for that file descriptor. +the corresponding bit will be set on successful completion if it was set on +input and the associated condition is true for that file descriptor. .Pp If none of the selected descriptors are ready for the requested operation, the .Fn select @@ -206,24 +207,29 @@ or .Fn pselect function blocks until at least one of the requested operations becomes ready, until the timeout occurs, or until -interrupted by a signal. The +interrupted by a signal. +The .Fa timeout parameter controls how long the .Fn select or .Fn pselect -function takes before timing out. If the +function takes before timing out. +If the .Fa timeout parameter is not a null pointer, it specifies a maximum interval -to wait for the selection to complete. If the specified time interval expires -without any requested operation becoming ready, the function returns. If the +to wait for the selection to complete. +If the specified time interval expires without any requested operation becoming +ready, the function returns. +If the .Fa timeout parameter is a null pointer, then the call to .Fn select or .Fn pselect blocks indefinitely until at least one descriptor meets the -specified criteria. To effect a poll, the +specified criteria. +To effect a poll, the .Fa timeout parameter should not be a null pointer, and should point to a zero-valued .Vt timespec @@ -251,9 +257,10 @@ A descriptor is considered ready for reading when a call to an input function with .Dv O_NONBLOCK clear would not block, whether or not the function would -transfer data successfully. (The function might return data, an end-of-file -indication, or an error other than one indicating that it is blocked, and in -each of these cases the descriptor will be considered ready for reading.) +transfer data successfully. +(The function might return data, an end-of-file indication, or an error other +than one indicating that it is blocked, and in each of these cases the +descriptor will be considered ready for reading.) .Pp A descriptor is considered ready for writing when a call to an output function with @@ -262,10 +269,12 @@ clear would not block, whether or not the function would transfer data successfully. .Pp If a socket has a pending error, it is considered to have an exceptional -condition pending. Otherwise, what constitutes an exceptional condition is file -type-specific. For a file descriptor for use with a socket, it is -protocol-specific except as noted below. For other file types, if the operation -is meaningless for a particular file type, +condition pending. +Otherwise, what constitutes an exceptional condition is file type-specific. +For a file descriptor for use with a socket, it is protocol-specific except as +noted below. +For other file types, if the operation is meaningless for a particular file +type, .Fn select or .Fn pselect @@ -276,39 +285,41 @@ If a descriptor refers to a socket, the implied input function is the .Xr recvmsg 3XNET function with parameters requesting normal and ancillary data, such that the presence of either type causes the socket to be marked as -readable. The presence of out-of-band data is checked if the socket option +readable. +The presence of out-of-band data is checked if the socket option .Dv SO_OOBINLINE has been enabled, as out-of-band data is enqueued with -normal data. If the socket is currently listening, then it is marked as -readable if an incoming connection request has been received, and a call to the -accept function completes without blocking. +normal data. +If the socket is currently listening, then it is marked as readable if an +incoming connection request has been received, and a call to the accept function +completes without blocking. .Pp If a descriptor refers to a socket, the implied output function is the .Xr sendmsg 3XNET function supplying an amount of normal data equal to the current value of the .Dv SO_SNDLOWAT -option for the socket. If a non-blocking -call to the connect function has been made for a socket, and the connection -attempt has either succeeded or failed leaving a pending error, the socket is -marked as writable. +option for the socket. +If a non-blocking call to the connect function has been made for a socket, and +the connection attempt has either succeeded or failed leaving a pending error, +the socket is marked as writable. .Pp A socket is considered to have an exceptional condition pending if a receive operation with .Dv O_NONBLOCK clear for the open file description and with the .Dv MSG_OOB -flag set would return out-of-band data without blocking. (It -is protocol-specific whether the +flag set would return out-of-band data without blocking. +(It is protocol-specific whether the .Dv MSG_OOB -flag would be used to read out-of-band data.) A socket will also be considered -to have an exceptional condition pending if an out-of-band data mark is -present in the receive queue. +flag would be used to read out-of-band data.) +A socket will also be considered to have an exceptional condition pending if an +out-of-band data mark is present in the receive queue. .Pp A file descriptor for a socket that is listening for connections will indicate -that it is ready for reading, when connections are available. A file -descriptor for a socket that is connecting asynchronously will indicate that it -is ready for writing, when a connection has been established. +that it is ready for reading, when connections are available. +A file descriptor for a socket that is connecting asynchronously will indicate +that it is ready for writing, when a connection has been established. .Pp Selecting true for reading on a socket descriptor upon which a .Xr listen 3XNET @@ -321,8 +332,10 @@ If the argument is not a null pointer, it points to an object of type .Vt struct timeval that specifies a maximum interval to wait for the -selection to complete. If the \fItimeout\fR argument points to an object of -type +selection to complete. +If the +.Fa timeout +argument points to an object of type .Vt struct timeval whose members are 0, .Fn select @@ -332,8 +345,9 @@ If the argument is a null pointer, .Fn select blocks until an event causes one of the masks to be returned with a valid -(non-zero) value. If the time limit expires before any event occurs that -would cause one of the masks to be set to a non-zero value, +(non-zero) value. +If the time limit expires before any event occurs that would cause one of the +masks to be set to a non-zero value, .Fn select completes successfully and returns 0. .Pp @@ -349,7 +363,8 @@ argument is not a null pointer, or .Fn pselect blocks for the time specified, or until interrupted by a -signal. If the +signal. +If the .Fa readfds , .Fa writefds , and @@ -368,9 +383,9 @@ On failure, the objects pointed to by the .Fa writefds , and .Fa errorfds -arguments are not modified. If the timeout interval expires -without the specified condition being true for any of the specified file -descriptors, the objects pointed to by the +arguments are not modified. +If the timeout interval expires without the specified condition being true for +any of the specified file descriptors, the objects pointed to by the .Fa readfds , .Fa writefds , and @@ -422,7 +437,8 @@ On successful completion, and .Fn pselect return the total -number of bits set in the bit masks. Otherwise, +number of bits set in the bit masks. +Otherwise, .Sy 1 is returned and .Dv errno |