sd_bus_request_name, sd_bus_release_name — Request or release a well-known name on a bus
|const char *name,|
|const char *name|
a well-known 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
After acquiring the
name successfully, permit other peers
to take over the name when they try to
acquire it with the
flag set. If
is not set on the original request,
such a request by other peers will be
Take over the name
if it is already acquired by another
peer, and that other peer has permitted
takeover by setting
while acquiring it.
Queue the acquisition of the name when the name is already taken.
an acquired well-known name. It takes a bus connection
and a valid bus name as parameters.
On success, these calls return 0 or a positive integer. On failure, these calls return a negative errno-style error code.
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 "
signals to be notified when the name is successfully
returns > 0 when the name has immediately been
Returned errors may indicate the following problems:
The caller already is the owner of the specified name.
The name has already been acquired by a different peer, and SD_BUS_NAME_REPLACE_EXISTING was not specified or the other peer did not specify SD_BUS_NAME_ALLOW_REPLACEMENT while acquiring the name.
It was attempted to release a name that is currently not registered on the bus.
It was attempted to release a name that is owned by a different peer on the bus.
A specified parameter is invalid.
The bus connection has been disconnected.
The bus connection has been created in a different process than the current one.
interfaces are available as a shared library, which can
be compiled and linked to with the