KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Definitions for the select() function. More...
#include <sys/cdefs.h>
#include <sys/types.h>
#include <newlib.h>
#include <kos/opts.h>
#include <time.h>
#include <sys/time.h>
Go to the source code of this file.
Data Structures | |
struct | fd_set |
Represents a set of file descriptors. More... | |
Macros | |
#define | _SYS_TYPES_FD_SET |
#define | NFDBITS 32 |
#define | FD_SET(n, p) |
#define | FD_CLR(n, p) |
#define | FD_ISSET(n, p) |
#define | FD_ZERO(p) |
Functions | |
int | select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout) |
Wait for activity on a group of file descriptors. | |
Definitions for the select() function.
This file contains the definitions needed for using the select() function, as directed by the POSIX 2008 standard (aka The Open Group Base Specifications Issue 7). Currently the functionality defined herein only really works for sockets, and that is likely how it will stay for some time.
#define _SYS_TYPES_FD_SET |
#define FD_CLR | ( | n, | |
p ) |
#define FD_ZERO | ( | p | ) |
#define NFDBITS 32 |
int select | ( | int | nfds, |
fd_set * | readfds, | ||
fd_set * | writefds, | ||
fd_set * | errorfds, | ||
struct timeval * | timeout ) |
Wait for activity on a group of file descriptors.
This function will check the specified group of file descriptors for activity and wait for activity (up to the timeout specified) if there is not any pending events already.
nfds | The maximum fd specified in any of the sets, plus 1. |
readfds | File descriptors to check for the ability to read without blocking. |
writefds | File descriptors to check for the ability to write without blocking. |
errorfds | File descriptors to check for error/exceptional conditions. |
timeout | Maximum amount of time to block. Passing a 0 timeout will make the function not block, Passing NULL here will make the function block indefinitely. |