Add custom limits.h and timespec.h

These will be needed for added a version of select that is
closer to bsd's select.
This commit is contained in:
Jennifer Averett 2012-11-26 09:24:57 -06:00
parent 0bc8807943
commit 9d3ac2b51a
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#include <sys/types.h>
#include <limits.h>
#define __FD_SETSIZE 1024
#define FD_SETSIZE __FD_SETSIZE
#define __CHAR_BIT CHAR_BIT /* number of bits in a char */

View File

@ -0,0 +1,10 @@
#define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
} while (0)
#define TIMESPEC_TO_TIMEVAL(tv, ts) \
do { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
} while (0)