sys_poll [fs/select.c]
Waits for an event on a file descriptor. Arguments
eax | 168
ebx | Pointer to an array of a pollfd structures
`struc pollfd { fd rd 1 events rw 1 revents rw 1 }`
`pollfd members: fd` `File descriptor of an open file.` `events` `A bit-mask specifying the events the application is interested in. Available flags are:`
`POLLIN` | `There is data to read`
`POLLPRI` | `There is urgent data to read`
`POLLOUT` | `Writing now will not block`
`POLLERR` | `Error condition`
`POLLHUP` | `Hung up`
`POLLNVAL` | `Invalid request: fd not open`
`POLLRDNORM` | `Normal data may be read`
`POLLRDBAND` | `Priority data may be read`
`POLLWRNORM` | `Writing now will not block`
`POLLWRBAND` | `Priority data may be written`
`POLLMSG` | `*to be documented*`
`POLLREMOVE` | `*to be documented*`
`POLLRDHUP` | `*to be documented*`
`revents` `This member is filled by the kernel with the events that actually occurred.`
ecx | Specifies the number of elements in the array of pollfd structures.
edx | Specifies the maximum length of time (in milliseconds) to wait for at least one of the specified events to occur. If this value is -1, sys_poll does not return until at least one of the specified events has occurred. If this value is 0, sys_poll does not wait for an event to occur but returns immediately, even if none of the specified events have occurred.
Return values If the system call succeeds the return value is a positive number which denotes the number of structures which have non-zero revents fields (in other words, those descriptors with events or errors reported). A value of 0 indicates that the call timed out and no file descriptors have been selected. If the system call fails the return value is one of the following errno values:
`-EBADF` | `An invalid file descriptor was given in one of the sets.`
`-ENOMEM` | `There was no space to allocate file descriptor tables.`
`-EFAULT` | `The array given as argument was not contained in the calling program's address space.`
`-EINTR` | `A signal occurred before any requested event.`
`-EINVAL` | `The ecx value exceeds the RLIMIT_NOFILE value.`
Remarks n/a Compatibility n/a