Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Data Structures | Macros | Typedefs | Functions
poll.h File Reference
#include <signal.h>
#include <stdint.h>
Include dependency graph for poll.h:

Go to the source code of this file.

Data Structures

struct  pollfd
 

Macros

#define POLLIN   1
 
#define POLLOUT   4
 
#define POLLNVAL   32
 

Typedefs

typedef uint32_t nfds_t
 

Functions

int poll (struct pollfd *fds, nfds_t nfds, int timeout)
 Wait for one of a set of file descriptors to become ready to perform I/O. More...
 
int ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts, const sigset_t *sigmask)
 Wait for one of the descriptors to become ready, with the timeout given as a timespec. Tenok blocks no signal, so the mask is accepted and has nothing to do. More...
 

Function Documentation

◆ poll()

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

Wait for one of a set of file descriptors to become ready to perform I/O.

Parameters
fdsA set of file descriptors with events to wait.
nfdsNumber of the provided fds.
timeoutThe number of milliseconds that poll() should block waiting for a file descriptor to become ready. Negative value means an infinite timeout and zero causes poll() to return immediately.
Return values
intThe number of the ready descriptors on success and -1 on error, with the reason left in errno.

◆ ppoll()

int ppoll ( struct pollfd fds,
nfds_t  nfds,
const struct timespec timeout_ts,
const sigset_t *  sigmask 
)

Wait for one of the descriptors to become ready, with the timeout given as a timespec. Tenok blocks no signal, so the mask is accepted and has nothing to do.

Parameters
fdsThe descriptors to wait on.
nfdsHow many of them there are.
timeout_tsHow long to wait, or a null pointer to wait forever.
sigmaskThe signals to block while waiting. Not used.
Return values
intThe number of the ready descriptors on success and -1 on error, with the reason left in errno.