mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 06:00:02 +08:00
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:
parent
0bc8807943
commit
9d3ac2b51a
9
rtemsbsd/freebsd/sys/limits.h
Normal file
9
rtemsbsd/freebsd/sys/limits.h
Normal 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 */
|
||||||
|
|
||||||
|
|
10
rtemsbsd/freebsd/sys/timespec.h
Normal file
10
rtemsbsd/freebsd/sys/timespec.h
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user