1SD_BUS_ADD_OBJECT_MANAGER(3)sd_bus_add_object_manageSrD_BUS_ADD_OBJECT_MANAGER(3)
2
3
4
6 sd_bus_add_object_manager - Add a D-Bus object manager for a D-Bus
7 object sub-tree
8
10 #include <systemd/sd-bus.h>
11
12 int sd_bus_add_object_manager(sd_bus *bus, sd_bus_slot **slot,
13 const char *path);
14
16 sd_bus_add_object_manager() installs a handler for the given path that
17 implements the GetManagedObjects() method of the
18 org.freedesktop.DBus.ObjectManager interface. See
19 org.freedesktop.DBus.ObjectManager[1] for more information.
20
21 To implement the InterfacesAdded and InterfacesRemoved signals of the
22 org.freedesktop.DBus.ObjectManager interface, call
23 sd_bus_emit_interfaces_added(3) and sd_bus_emit_interfaces_removed(3)
24 whenever interfaces are added or removed from the sub-tree,
25 respectively.
26
27 When sd_bus_add_object_manager() succeeds, a slot is created
28 internally. If the output parameter slot is NULL, a "floating" slot
29 object is created, see sd_bus_slot_set_floating(3). Otherwise, a
30 pointer to the slot object is returned. In that case, the reference to
31 the slot object should be dropped when the object manager is not needed
32 anymore, see sd_bus_slot_unref(3).
33
35 On success, sd_bus_add_object_manager() returns a non-negative integer.
36 On failure, it returns a negative errno-style error code.
37
38 Errors
39 Returned errors may indicate the following problems:
40
41 -EINVAL
42 One of the required parameters is NULL or path is not a valid
43 object path.
44
45 -ENOPKG
46 The bus cannot be resolved.
47
48 -ECHILD
49 The bus was created in a different process.
50
51 -ENOMEM
52 Memory allocation failed.
53
55 These APIs are implemented as a shared library, which can be compiled
56 and linked to with the libsystemd pkg-config(1) file.
57
59 sd-bus(3), busctl(1), sd_bus_add_object_vtable(3),
60 sd_bus_emit_interfaces_added(3), sd_bus_slot_unref(3)
61
63 1. org.freedesktop.DBus.ObjectManager
64 https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager
65
66
67
68systemd 246 SD_BUS_ADD_OBJECT_MANAGER(3)