Movatterモバイル変換


[0]ホーム

URL:


man7.org > Linux >man-pages

Linux/UNIX system programming training


sd_bus_set_description(3) — Linux manual page

NAME |SYNOPSIS |DESCRIPTION |RETURN VALUE |NOTES |HISTORY |SEE ALSO |NOTES |COLOPHON

SD_BUS_SET_DESCRIPTION(3) sd_bus_set_descriptionSD_BUS_SET_DESCRIPTION(3)

NAME        top

       sd_bus_set_description, sd_bus_get_description,       sd_bus_set_anonymous, sd_bus_is_anonymous, sd_bus_set_trusted,       sd_bus_is_trusted, sd_bus_set_allow_interactive_authorization,       sd_bus_get_allow_interactive_authorization, sd_bus_get_scope,       sd_bus_get_tid, sd_bus_get_unique_name - Set or query properties       of a bus object

SYNOPSIS        top

#include <systemd/sd-bus.h>int sd_bus_set_description(sd_bus *bus, const char *description);int sd_bus_get_description(sd_bus *bus, const char **description);int sd_bus_set_anonymous(sd_bus *bus, intb);int sd_bus_is_anonymous(sd_bus *bus);int sd_bus_set_trusted(sd_bus *bus, intb);int sd_bus_is_trusted(sd_bus *bus);int sd_bus_set_allow_interactive_authorization(sd_bus *bus,intb);int sd_bus_get_allow_interactive_authorization(sd_bus *bus);int sd_bus_get_scope(sd_bus *bus, const char **scope);int sd_bus_get_tid(sd_bus *bus, pid_t *tid);int sd_bus_get_unique_name(sd_bus *bus, const char **unique);

DESCRIPTION        top

sd_bus_set_description()sets the description string that is used       in logging to the specified string. The string is copied       internally and freed when the bus object is deallocated. Thedescription argument may beNULL, in which case the description is       unset. This function must be called before the bus is started.sd_bus_get_description()returns a description string indescription. This string may have been previously set withsd_bus_set_description()orsd_bus_open_with_description(3) or       similar. If not set this way, a default string like "system" or       "user" will be returned for the system or user buses, and-ENXIO       otherwise.sd_bus_set_anonymous()enables or disables "anonymous       authentication", i.e. lack of authentication, of the bus peer.       This function must be called before the bus is started. See theD-Bus Authentication Mechanisms[1] section of the D-Bus       specification for details.sd_bus_is_anonymous()returns true if the bus connection allows       anonymous authentication (in the sense described in previous       paragraph).sd_bus_set_trusted()sets the "trusted" state on thebus object.       If true, all connections on the bus are trusted and access to all       privileged and unprivileged methods is granted. This function must       be called before the bus is started.sd_bus_is_trusted()returns true if the bus connection is trusted       (in the sense described in previous paragraph).sd_bus_set_allow_interactive_authorization()enables or disables       interactive authorization for method calls. If true, messages are       marked with theALLOW_INTERACTIVE_AUTHORIZATIONflag specified by       theD-Bus[2] specification, informing the receiving side that the       caller is prepared to wait for interactive authorization, which       might take a considerable time to complete. If this flag is set,       the user may be queried for passwords or confirmation viapolkit[3] or a similar framework.sd_bus_get_allow_interactive_authorization()returns true if       interactive authorization is allowed and false if not.sd_bus_get_scope()stores the scope of the given bus object inscope. The scope of the system bus is "system". The scope of a       user session bus is "user". If the given bus object is not the       system or a user session bus,sd_bus_get_scope()returns an error.sd_bus_get_tid()stores the kernel thread id of the thread       associated with the given bus object intid. Ifbus is a default       bus object obtained by calling one of the functions of thesd_bus_default(3) family of functions, it stores the thread id of       the thread the bus object was created in. Otherwise, if the bus       object is attached to an event loop, it stores the thread id of       the thread the event loop object was created in. Ifbus is not a       default bus object and is not attached to an event loop,sd_bus_get_tid()returns an error.sd_bus_get_unique_name()stores the unique name of the bus object       on the bus inunique. SeeThe D-Bus specification[4] for more       information on bus names. Note that the caller does not own the       string stored inunique and should not free it.

RETURN VALUE        top

       On success, these functions return a non-negative integer. On       failure, they return a negative errno-style error code.Errors       Returned errors may indicate the following problems:-EINVAL           An argument is invalid.-ENOPKG           The bus cannot be resolved.-EPERM           The bus has already been started.-ECHILD           The bus was created in a different process, library or module           instance.-ENOMEM           Memory allocation failed.-ENODATA           The bus object passed tosd_bus_get_scope()was not a system           or user session bus.           Added in version 246.-ENXIO           The bus object passed tosd_bus_get_tid()was not a default           bus object and is not attached to an event loop.           The bus object passed tosd_bus_get_description()did not have           adescription.           Added in version 246.

NOTES        top

       Functions described here are available as a shared library, which       can be compiled against and linked to with thelibsystemd pkg-config(1) file.       The code described here usesgetenv(3), which is declared to be       not multi-thread-safe. This means that the code calling the       functions described here must not callsetenv(3) from a parallel       thread. It is recommended to only do calls tosetenv()from an       early phase of the program when no other threads have been       started.

HISTORY        top

sd_bus_set_description(),sd_bus_get_description(),sd_bus_set_anonymous(),sd_bus_set_trusted(),sd_bus_set_allow_interactive_authorization(), andsd_bus_get_allow_interactive_authorization()were added in version       240.sd_bus_is_anonymous(),sd_bus_is_trusted(),sd_bus_get_scope(),sd_bus_get_tid(), andsd_bus_get_unique_name()were added in       version 246.

SEE ALSO        top

systemd(1),sd-bus(3),sd_bus_default_user(3),sd_bus_default_system(3),sd_bus_open_user(3),sd_bus_open_system(3)

NOTES        top

        1. D-Bus Authentication Mechanisms           view-source:https://dbus.freedesktop.org/doc/dbus-specification.html#auth-mechanisms        2. D-Bus           view-source:https://dbus.freedesktop.org/doc/dbus-specification.html        3. polkithttps://www.freedesktop.org/wiki/Software/polkit        4. The D-Bus specificationhttps://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus

COLOPHON        top

       This page is part of thesystemd (systemd system and service       manager) project.  Information about the project can be found at       ⟨http://www.freedesktop.org/wiki/Software/systemd⟩.  If you have a       bug report for this manual page, see       ⟨http://www.freedesktop.org/wiki/Software/systemd/#bugreports⟩.       This page was obtained from the project's upstream Git repository       ⟨https://github.com/systemd/systemd.git⟩ on 2025-08-11.  (At that       time, the date of the most recent commit that was found in the       repository was 2025-08-11.)  If you discover any rendering       problems in this HTML version of the page, or you believe there is       a better or more up-to-date source for the page, or you have       corrections or improvements to the information in this COLOPHON       (which isnot part of the original manual page), send a mail to       man-pages@man7.orgsystemd 258~rc2SD_BUS_SET_DESCRIPTION(3)

Pages that refer to this page:sd-bus(3)sd_bus_add_object(3)sd_bus_creds_get_pid(3)sd_bus_default(3)sd_bus_message_new(3)sd_bus_message_set_expect_reply(3)systemd.directives(7)systemd.index(7)



HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface.

For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere.

Hosting byjambit GmbH.

Cover of TLPI


[8]ページ先頭

©2009-2025 Movatter.jp