KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches

POSIX threading and concurrency APIs. More...

Modules

 Events for the poll() function
 Masks representing event types for poll()
 

Files

file  poll.h
 Definitions for the poll() function.
 
file  pthread.h
 POSIX-compatibile (sorta) threading support.
 

Data Structures

struct  pollfd
 Structure representing a single file descriptor used by poll(). More...
 

Typedefs

typedef __uint32_t nfds_t
 Type representing a number of file descriptors.
 

Functions

int poll (struct pollfd fds[], nfds_t nfds, int timeout)
 Poll a group of file descriptors for activity.
 

Detailed Description

POSIX threading and concurrency APIs.

Typedef Documentation

◆ nfds_t

typedef __uint32_t nfds_t

Type representing a number of file descriptors.

Function Documentation

◆ poll()

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

Poll a group of file descriptors for activity.

This function will poll a group of file descriptors to check for the events specified on them. The function shall block for the specified period of time (in milliseconds) waiting for an event to occur. The function shall return as soon as at least one fd matches the events specified (or one of the error conditions), or when timeout expires.

Parameters
fdsThe file descriptors to check, and what events to look for on each.
nfdsNumber of elements in fds.
timeoutMaximum amount of time to block, in milliseconds. Pass 0 to ensure the function does not block and -1 to block for an "infinite" amount of time, until an event occurs.
Returns
-1 on error (sets errno as appropriate), or the number of file descriptors that matched the event flags before the function returns.
See also
Events for the poll() function