diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-12 01:49:52 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-12 01:49:52 +0200 |
commit | 8323bc1f907ff558df5ccd6bdf1e14debed5cf2e (patch) | |
tree | 6aaf16b8b61a2c3771473b422b7ddb5b75cf9885 /src/libsystemd-bus/bus-message.c | |
parent | f9be01f3b4784affa269694a4f5cdcb87f06f2f7 (diff) |
bus: also parse PID starttime out of kdbus message
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 092654ff45..aac49f486e 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -692,6 +692,16 @@ int sd_bus_message_get_tid(sd_bus_message *m, pid_t *tid) { return 0; } +int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec) { + if (!m) + return -EINVAL; + if (m->pid_starttime <= 0) + return -ENOENT; + + *usec = m->pid_starttime; + return 0; +} + const char *sd_bus_message_get_label(sd_bus_message *m) { if (!m) return NULL; @@ -2910,7 +2920,8 @@ int bus_message_dump(sd_bus_message *m) { printf("\tuid=%lu\n", (unsigned long) m->uid); if (m->gid_valid) printf("\tgid=%lu\n", (unsigned long) m->gid); - + if (m->pid_starttime != 0) + printf("\tpid_starttime=%llu\n", (unsigned long long) m->pid_starttime); r = sd_bus_message_rewind(m, true); if (r < 0) { |