Movatterモバイル変換


[0]ホーム

URL:


man7.org > Linux >man-pages

Linux/UNIX system programming training


sd_bus_message_get_type(3) — Linux manual page

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

SD_BUS_M..._GET_TYPE(3)  sd_bus_message_get_typeSD_BUS_M..._GET_TYPE(3)

NAME        top

       sd_bus_message_get_type, sd_bus_message_get_error,       sd_bus_message_get_errno, sd_bus_message_get_creds,       sd_bus_message_is_signal, sd_bus_message_is_method_call,       sd_bus_message_is_method_error - Query bus message       addressing/credentials metadata

SYNOPSIS        top

#include <systemd/sd-bus.h>int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type);sd_bus_error* sd_bus_message_get_error(sd_bus_message *m);int sd_bus_message_get_errno(sd_bus_message *m);sd_bus_creds* sd_bus_message_get_creds(sd_bus_message *m);int sd_bus_message_is_signal(sd_bus_message *m,const char *interface,const char *member);int sd_bus_message_is_method_call(sd_bus_message *m,const char *interface,const char *member);int sd_bus_message_is_method_error(sd_bus_message *m,const char *name);

DESCRIPTION        top

sd_bus_message_get_type()returns the type of a message in the       output parametertype, one ofSD_BUS_MESSAGE_METHOD_CALL,SD_BUS_MESSAGE_METHOD_RETURN,SD_BUS_MESSAGE_METHOD_ERROR,SD_BUS_MESSAGE_SIGNAL. This type is either specified as a       parameter when the message is created usingsd_bus_message_new(3),       or is set automatically when the message is created usingsd_bus_message_new_signal(3),sd_bus_message_new_method_call(3),sd_bus_message_new_method_error(3) and similar functions.sd_bus_message_get_error()returns the error stored in the messagem, if there is any. Otherwise, it returnsNULL.sd_bus_message_get_errno()returns the error stored in the messagem as a positive errno-style value, if there is any. Otherwise, it       returns zero. Errors are mapped to errno values according to the       default and any additional registered error mappings. Seesd-bus-errors(3) andsd_bus_error_add_map(3).sd_bus_message_get_creds()returns the message credentials       attached to the messagem. If no credentials are attached to the       message, it returnsNULL. Ownership of the credentials instance is       not transferred to the caller and hence should not be freed.sd_bus_message_is_signal()checks if messagem is a signal       message. Ifinterface is non-null, it also checks if the message       has the same interface set. Ifmember is non-null, it also checks       if the message has the same member set. Also seesd_bus_message_new_signal(3). It returns true when all checks       pass.sd_bus_message_is_method_call()checks if messagem is a method       call message. Ifinterface is non-null, it also checks if the       message has the same interface set. Ifmember is non-null, it also       checks if the message has the same member set. Also seesd_bus_message_new_method_call(3). It returns true when all checks       pass.sd_bus_message_is_method_error()checks if messagem is an error       reply message. Ifname is non-null, it also checks if the message       has the same error identifier set. Also seesd_bus_message_new_method_error(3). It returns true when all       checks pass.

RETURN VALUE        top

       On success, these functions (exceptsd_bus_message_get_error()andsd_bus_message_get_creds()) return a non-negative integer. On       failure, they return a negative errno-style error code.sd_bus_message_get_errno()always returns a non-negative integer,       even on failure.Errors       Returned errors may indicate the following problems:-EINVAL           The message parameterm or an output parameter isNULL.

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_message_get_type(),sd_bus_message_is_signal(),sd_bus_message_is_method_call(), andsd_bus_message_is_method_error()were added in version 240.sd_bus_message_get_error(),sd_bus_message_get_errno(), andsd_bus_message_get_creds()were added in version 246.

SEE ALSO        top

systemd(1),sd-bus(3),sd_bus_message_new(3),sd_bus_message_set_destination(3),sd-bus-errors(3),sd_bus_error_add_map(3)

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_M..._GET_TYPE(3)

Pages that refer to this page:sd-bus(3)sd_bus_call(3)sd_bus_creds_get_pid(3)sd_bus_creds_new_from_pid(3)sd_bus_negotiate_fds(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