mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 22:14:49 +00:00
lib: time: add TIMEVAL_TO_TIMESPEC
Should be in system headers, but not specified by any standard. Not currently used anywhere yet. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
e0e2a99068
commit
39cea8220a
@ -28,6 +28,13 @@
|
||||
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
|
||||
} while (0)
|
||||
#endif
|
||||
#ifndef TIMEVAL_TO_TIMESPEC
|
||||
/* should be in sys/time.h on BSD & Linux libcs */
|
||||
#define TIMEVAL_TO_TIMESPEC(tv, ts) do { \
|
||||
(ts)->tv_sec = (tv)->tv_sec; \
|
||||
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
static inline time_t monotime(struct timeval *tvo)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user