diff options
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r-- | src/libsystemd-bus/sd-event.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsystemd-bus/sd-event.c b/src/libsystemd-bus/sd-event.c index 3094d9e297..482e3bb8a5 100644 --- a/src/libsystemd-bus/sd-event.c +++ b/src/libsystemd-bus/sd-event.c @@ -1297,6 +1297,16 @@ int sd_event_source_get_time_accuracy(sd_event_source *s, uint64_t *usec) { return 0; } +int sd_event_source_get_child_pid(sd_event_source *s, pid_t *pid) { + assert_return(s, -EINVAL); + assert_return(pid, -EINVAL); + assert_return(s->type == SOURCE_CHILD, -EDOM); + assert_return(!event_pid_changed(s->event), -ECHILD); + + *pid = s->child.pid; + return 0; +} + int sd_event_source_set_prepare(sd_event_source *s, sd_prepare_handler_t callback) { int r; |