#include "../../SDL_internal.h"
#include "SDL_assert.h"
#include "SDL_poll.h"
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
Go to the source code of this file.
◆ SDL_IOReady()
int SDL_IOReady |
( |
int |
fd, |
|
|
SDL_bool |
forWrite, |
|
|
int |
timeoutMS |
|
) |
| |
Definition at line 38 of file SDL_poll.c.
References NULL, and SDL_assert.
50 info.events = POLLOUT;
52 info.events = POLLIN | POLLPRI;
54 result = poll(&info, 1, timeoutMS);
56 fd_set rfdset, *rfdp =
NULL;
57 fd_set wfdset, *wfdp =
NULL;
58 struct timeval tv, *tvp =
NULL;
74 tv.tv_sec = timeoutMS / 1000;
75 tv.tv_usec = (timeoutMS % 1000) * 1000;
79 result = select(
fd + 1, rfdp, wfdp,
NULL, tvp);
82 }
while ( result < 0 && errno == EINTR );
#define SDL_assert(condition)