summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-01-22 03:36:05 +0000
committerHavoc Pennington <hp@redhat.com>2003-01-22 03:36:05 +0000
commitd6d50a29945ded04a17b3f42a3a1074449250ec0 (patch)
tree7a7df9b568a6e7f7b6a184f525d60bd77e527bb2 /dbus/dbus-sysdeps.c
parent9e1199fed2c96fe305a27e5d3d4e1950ed2f0d0f (diff)
2003-01-21 Havoc Pennington <hp@pobox.com>
(patch untested because can't compile) * bus/driver.c (create_unique_client_name): make this function never recycle client names. Also, caller should initialize the DBusString. * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
Diffstat (limited to 'dbus/dbus-sysdeps.c')
-rw-r--r--dbus/dbus-sysdeps.c20
1 files changed, 20 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 */