logind,machined: expose bus properties for leader PID fd ids, too
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "bus-get-properties.h"
|
||||
#include "bus-message-util.h"
|
||||
#include "pidref.h"
|
||||
#include "rlimit-util.h"
|
||||
#include "string-util.h"
|
||||
|
||||
@@ -188,3 +189,23 @@ int bus_property_get_string_set(
|
||||
|
||||
return bus_message_append_string_set(reply, *s);
|
||||
}
|
||||
|
||||
int bus_property_get_pidfdid(
|
||||
sd_bus *bus,
|
||||
const char *path,
|
||||
const char *interface,
|
||||
const char *property,
|
||||
sd_bus_message *reply,
|
||||
void *userdata,
|
||||
sd_bus_error *error) {
|
||||
|
||||
PidRef *pidref = ASSERT_PTR(userdata);
|
||||
|
||||
assert(bus);
|
||||
assert(property);
|
||||
assert(reply);
|
||||
|
||||
(void) pidref_acquire_pidfd_id(pidref);
|
||||
|
||||
return sd_bus_message_append(reply, "t", pidref->fd_id);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ int bus_property_get_rlimit(sd_bus *bus, const char *path, const char *interface
|
||||
|
||||
int bus_property_get_string_set(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
|
||||
|
||||
int bus_property_get_pidfdid(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
|
||||
|
||||
#define BUS_DEFINE_PROPERTY_GET_GLOBAL(function, bus_type, val) \
|
||||
int function(sd_bus *bus, \
|
||||
const char *path, \
|
||||
|
||||
Reference in New Issue
Block a user