diff options
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-sysdeps.c | 20 | ||||
-rw-r--r-- | dbus/dbus-sysdeps.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index a4074828..c91a06ff 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -983,4 +983,24 @@ _dbus_sleep_milliseconds (int milliseconds) #endif } +/** + * Get current time, as in gettimeofday(). + * + * @param tv_sec return location for number of seconds + * @param tv_usec return location for number of microseconds (thousandths) + */ +void +_dbus_get_current_time (long *tv_sec, + long *tv_usec) +{ + struct timeval t; + + gettimeofday (&t, NULL); + + if (tv_sec) + *tv_sec = t.tv_sec; + if (tv_usec) + *tv_usec = t.tv_usec; +} + /** @} end of sysdeps */ diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index c76c691a..5b9a0c09 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -118,6 +118,9 @@ int _dbus_poll (DBusPollFD *fds, void _dbus_sleep_milliseconds (int milliseconds); +void _dbus_get_current_time (long *tv_sec, + long *tv_usec); + DBUS_END_DECLS; #endif /* DBUS_SYSDEPS_H */ |