mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-10 03:40:29 +00:00
Update redbean unix.poll documentation.
This commit is contained in:
parent
e76a08a597
commit
65c4f9da12
1 changed files with 19 additions and 3 deletions
|
@ -2754,9 +2754,25 @@ UNIX MODULE
|
|||
keys are ignored by poll(). The returned table will be a subset of
|
||||
the supplied file descriptors.
|
||||
|
||||
`timeoutms` is the number of seconds to block. If this is set to -1
|
||||
then that means block as long as it takes until there's an event or
|
||||
an interrupt. If the timeout expires, an empty table is returned.
|
||||
`events` and `revents` may be any combination (using bitwise OR) of:
|
||||
|
||||
- `POLLIN` (events, revents): There is data to read.
|
||||
- `POLLOUT` (events, revents): Writing is now possible, although may
|
||||
still block if available space in a socket or pipe is exceeded
|
||||
(unless `O_NONBLOCK` is set).
|
||||
- `POLLPRI` (events, revents): There is some exceptional condition
|
||||
(for example, out-of-band data on a TCP socket).
|
||||
- `POLLRDHUP` (events, revents): Stream socket peer closed
|
||||
connection, or shut down writing half of connection.
|
||||
- `POLLERR` (revents): Some error condition.
|
||||
- `POLLHUP` (revents): Hang up. When reading from a channel such as
|
||||
a pipe or a stream socket, this event merely indicates that the
|
||||
peer closed its end of the channel.
|
||||
- `POLLNVAL` (revents): Invalid request.
|
||||
|
||||
`timeoutms` is the number of milliseconds to block. If this is set to
|
||||
-1 then that means block as long as it takes until there's an event
|
||||
or an interrupt. If the timeout expires, an empty table is returned.
|
||||
|
||||
unix.gethostname()
|
||||
├─→ host:str
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue