The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
poll.h File Reference

waiting for file descriptors to become ready. More...

Go to the source code of this file.

Data Structures

struct  pollfd

Macros

#define POLLIN   0x001
#define POLLPRI   0x002
#define POLLOUT   0x004
#define POLLERR   0x008
#define POLLHUP   0x010
#define POLLNVAL   0x020

Typedefs

typedef unsigned int nfds_t

Functions

int poll (struct pollfd *fds, nfds_t nfds, int timeout)
 wait until one of a set of descriptors is ready.

Detailed Description

waiting for file descriptors to become ready.

the event bits and struct pollfd are ABI and must match the kernel side in src/kernel/vfs/poll.h and sys_io.c.

Macro Definition Documentation

◆ POLLIN

#define POLLIN   0x001

◆ POLLPRI

#define POLLPRI   0x002

◆ POLLOUT

#define POLLOUT   0x004

◆ POLLERR

#define POLLERR   0x008

◆ POLLHUP

#define POLLHUP   0x010

◆ POLLNVAL

#define POLLNVAL   0x020

Typedef Documentation

◆ nfds_t

typedef unsigned int nfds_t

Function Documentation

◆ poll()

int poll ( struct pollfd * fds,
nfds_t nfds,
int timeout )

wait until one of a set of descriptors is ready.

Parameters
fdsthe descriptors (at most 64).
nfdsthe number of entries.
timeoutmilliseconds to wait; negative waits without limit, 0 does not wait.
Returns
the number of entries with revents set, 0 on timeout, or -1 (errno set).