sched: use FD_SETSIZE if defined
This commit is contained in:
parent
6d8ffeefd6
commit
a2b40f527d
1 changed files with 6 additions and 6 deletions
12
sched.c
12
sched.c
|
@ -57,18 +57,18 @@ static unsigned int n_read_fds;
|
||||||
/* One more than the highest file descriptor that is registered */
|
/* One more than the highest file descriptor that is registered */
|
||||||
static unsigned int one_highest_fd;
|
static unsigned int one_highest_fd;
|
||||||
|
|
||||||
/* This assumes that fd_set is implemented as a fixed size array of
|
#ifndef FD_SETSIZE
|
||||||
bits, possibly embedded inside a record. It might therefore
|
/* If FD_SETSIZE is not defined, assume that fd_set is implemented
|
||||||
somewhat non-portable. */
|
as a fixed size array of bits, possibly embedded inside a record */
|
||||||
|
#define FD_SETSIZE (sizeof(fd_set) * 8)
|
||||||
#define FD_SET_SIZE (sizeof(fd_set) * 8)
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SCH_FileHandler handler;
|
SCH_FileHandler handler;
|
||||||
SCH_ArbitraryArgument arg;
|
SCH_ArbitraryArgument arg;
|
||||||
} FileHandlerEntry;
|
} FileHandlerEntry;
|
||||||
|
|
||||||
static FileHandlerEntry file_handlers[FD_SET_SIZE];
|
static FileHandlerEntry file_handlers[FD_SETSIZE];
|
||||||
|
|
||||||
/* Timestamp when last select() returned */
|
/* Timestamp when last select() returned */
|
||||||
static struct timeval last_select_ts, last_select_ts_raw;
|
static struct timeval last_select_ts, last_select_ts_raw;
|
||||||
|
|
Loading…
Reference in a new issue