1SD_BUS_SLOT_REF(3)              sd_bus_slot_ref             SD_BUS_SLOT_REF(3)
2
3
4

NAME

6       sd_bus_slot_ref, sd_bus_slot_unref, sd_bus_slot_unrefp - Create and
7       destroy references to a bus slot object
8

SYNOPSIS

10       #include <systemd/sd-bus.h>
11
12       sd_bus_slot *sd_bus_slot_ref(sd_bus_slot *slot);
13
14       sd_bus_slot *sd_bus_slot_unref(sd_bus_slot *slot);
15
16       void sd_bus_slot_unrefp(sd_bus_slot **slotp);
17

DESCRIPTION

19       sd_bus_slot_ref() increases the internal reference counter of slot by
20       one.
21
22       sd_bus_slot_unref() decreases the internal reference counter of slot by
23       one. Once the reference count has dropped to zero, slot object is
24       destroyed and cannot be used anymore, so further calls to
25       sd_bus_slot_ref() or sd_bus_slot_unref() are illegal.
26
27       sd_bus_slot_unrefp() is similar to sd_bus_slot_unref() but takes a
28       pointer to a pointer to an sd_bus_slot object. This call is useful in
29       conjunction with GCC's and LLVM's Clean-up Variable Attribute[1]. See
30       sd_bus_new(3) for an example how to use the cleanup attribute.
31
32       sd_bus_slot_ref() and sd_bus_slot_unref() execute no operation if the
33       passed in bus object address is NULL.  sd_bus_slot_unrefp() will first
34       dereference its argument, which must not be NULL, and will execute no
35       operation if that is NULL.
36

RETURN VALUE

38       sd_bus_slot_ref() always returns the argument.
39
40       sd_bus_slot_unref() always returns NULL.
41

NOTES

43       Functions described here are available as a shared library, which can
44       be compiled against and linked to with the libsystemd pkg-config(1)
45       file.
46
47       The code described here uses getenv(3), which is declared to be not
48       multi-thread-safe. This means that the code calling the functions
49       described here must not call setenv(3) from a parallel thread. It is
50       recommended to only do calls to setenv() from an early phase of the
51       program when no other threads have been started.
52

SEE ALSO

54       systemd(1), sd-bus(3), sd_bus_new(3), sd_bus_message_new(3),
55       sd_bus_call_method_async(3)
56

NOTES

58        1. Clean-up Variable Attribute
59           https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
60
61
62
63systemd 254                                                 SD_BUS_SLOT_REF(3)
Impressum