---
name: "io_wait"
section: "3diet"
platform: "linux"
package: "libowfat-dev"
version: "0.28-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/io_wait/3diet"
---

# io\_wait(3diet)

wait for events

## NAME

io\_wait - wait for events

## SYNTAX

**#include \<io.h\>**

void **io\_wait**();

## DESCRIPTION

io\_wait() checks the descriptors that the program is interested in to see whether any of them are ready. If none of them are ready, io\_wait() tries to pause until one of them is ready, so that it does not take time away from other programs running on the same computer.

io\_wait pays attention to timeouts: if a descriptor reaches its timeout, and the program is interested in reading or writing that descriptor, io\_wait will return promptly.

Under some circumstances, io\_wait will return even though no interesting descriptors are ready. Do not assume that a descriptor is ready merely because io\_wait has returned.

io\_wait is not interrupted by the delivery of a signal. Programs that expect interruption are unreliable: they will block if the same signal is delivered a moment before io\_wait. The correct way to handle signals is with the self-pipe trick.

## SEE ALSO

[io\_waituntil(3)](/io_waituntil/3.md), [io\_check(3)](/io_check/3.md), [io\_wantread(3)](/io_wantread/3.md), [io\_wantwrite(3)](/io_wantwrite/3.md), [io\_fd(3)](/io_fd/3.md)
