1SD_BUS_ADD_OBJECT_MANAGER(3)sd_bus_add_object_manageSrD_BUS_ADD_OBJECT_MANAGER(3)
2
3
4

NAME

6       sd_bus_add_object_manager - Add a D-Bus object manager for a D-Bus
7       object sub-tree
8

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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, library or module
50           instance.
51
52       -ENOMEM
53           Memory allocation failed.
54

NOTES

56       Functions described here are available as a shared library, which can
57       be compiled against and linked to with the libsystemd pkg-config(1)
58       file.
59
60       The code described here uses getenv(3), which is declared to be not
61       multi-thread-safe. This means that the code calling the functions
62       described here must not call setenv(3) from a parallel thread. It is
63       recommended to only do calls to setenv() from an early phase of the
64       program when no other threads have been started.
65

SEE ALSO

67       sd-bus(3), busctl(1), sd_bus_add_object_vtable(3),
68       sd_bus_emit_interfaces_added(3), sd_bus_slot_unref(3)
69

NOTES

71        1. org.freedesktop.DBus.ObjectManager
72           https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager
73
74
75
76systemd 254                                       SD_BUS_ADD_OBJECT_MANAGER(3)
Impressum