In POSIX systems, SIGPOLL is a signal sent to a process to inform about a change in state that is running in the background of asynchronous I / O.
| Description: | Asynchronous I / O signal |
|---|---|
| Default: | process completion |
| SA_SIGINFO codes | |
POLL_IN | input available |
POLL_OUT | possible conclusion |
POLL_MSG | new message available |
POLL_ERR | input / output error |
POLL_PRI | high priority input |
POLL_HUP | connection closed |
SIGPOLL is an integer constant defined in the signal.h header file. The symbolic names of the signals are used instead of numbers, since in different implementations the signal numbers may vary.
The SIGIO signal in Linux is synonymous with SIGPOLL .
Etymology
SIG - general prefix of signals (from the English signal ), POLL - shortened spelling of the English. polling - poll, in the context of the poll system call, IO - short for English. I / O (input-output) - input-output.
Usage
According to POSIX, SIGPOLL is the default signal sent when the state of an open file changes (for example, readiness for input or output), for which the I_SETSIG flag was set with the ioctl system call. Using this mechanism, the program can perform asynchronous input-output without the need for additional multiplexing, which is necessary when using the select() function. A possible disadvantage of this method is the loss of continuity in the program code and turning it into an unreadable "spaghetti" , with the potential for errors like race condition .
POSIX 1003.1 ( 2003 ) recommends the use of standardized system calls for asynchronous I / O, defined by the aio.h header file. All I / O requests using these functions are queued for asynchronous execution, their results and status can be obtained through the aio_return() and aio_error() functions.