summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-12 01:57:53 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-12 01:57:53 +0200
commitacb5a3cb20d075782e088362d4ec9aa9f3996d90 (patch)
treeb9ec82bf6de0c438c02e2d1eee5cc56a9f7a60a4 /src/libsystemd-bus/bus-message.c
parent8323bc1f907ff558df5ccd6bdf1e14debed5cf2e (diff)
bus: parse and expose kdbus message timestamps
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r--src/libsystemd-bus/bus-message.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index aac49f486e..467b519039 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -709,6 +709,17 @@ const char *sd_bus_message_get_label(sd_bus_message *m) {
return m->label;
}
+int sd_bus_message_get_timestamp(sd_bus_message *m, uint64_t *usec) {
+ if (!m)
+ return -EINVAL;
+
+ if (m->timestamp <= 0)
+ return -ENOENT;
+
+ *usec = m->timestamp;
+ return 0;
+}
+
int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member) {
if (!m)
return -EINVAL;
@@ -2922,6 +2933,8 @@ int bus_message_dump(sd_bus_message *m) {
printf("\tgid=%lu\n", (unsigned long) m->gid);
if (m->pid_starttime != 0)
printf("\tpid_starttime=%llu\n", (unsigned long long) m->pid_starttime);
+ if (m->timestamp)
+ printf("\ttimestamp=%llu\n", (unsigned long long) m->timestamp);
r = sd_bus_message_rewind(m, true);
if (r < 0) {