table of contents
- stretch 232-25+deb9u11
- testing 241-5
- stretch-backports 241-3~bpo9+1
- unstable 241-5
- experimental 242-2
SD_BUS_REQUEST_NAME(3) | sd_bus_request_name | SD_BUS_REQUEST_NAME(3) |
NAME¶
sd_bus_request_name, sd_bus_release_name - Request or release a well-known service name on a busSYNOPSIS¶
#include <systemd/sd-bus.h>
int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags);
int sd_bus_release_name(sd_bus *bus, const char *name);
DESCRIPTION¶
sd_bus_request_name() requests a well-known service name on a bus. It takes a bus connection, a valid bus name and a flags parameter. The flags parameter is a combination of the following flags:SD_BUS_NAME_ALLOW_REPLACEMENT
SD_BUS_NAME_REPLACE_EXISTING
SD_BUS_NAME_QUEUE
sd_bus_release_name() releases an acquired well-known name. It takes a bus connection and a valid bus name as parameters.
RETURN VALUE¶
On success, these calls return 0 or a positive integer. On failure, these calls return a negative errno-style error code.If SD_BUS_NAME_QUEUE is specified, sd_bus_request_name() will return 0 when the name is already taken by another peer and the client has been added to the queue for the name. In that case, the caller can subscribe to "NameOwnerChanged" signals to be notified when the name is successfully acquired. sd_bus_request_name() returns > 0 when the name has immediately been acquired successfully.
ERRORS¶
Returned errors may indicate the following problems:-EALREADY
-EEXIST
-ESRCH
-EADDRINUSE
-EINVAL
-ENOTCONN
-ECHILD
NOTES¶
The sd_bus_acquire_name() and sd_bus_release_name() interfaces are available as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.SEE ALSO¶
systemd(1), sd-bus(3), sd_bus_new(3)systemd 232 |