SD_BUS_ME...SIGNATURE(3)
π SD_BUS_ME...SIGNATURE β query bus message signature π
okay bestie, this is part of the sd-bus crew (that's the systemd D-Bus library, iykyk), and it's literally just three little functions that tell you what a message's signature is. no cap, that's it. let's go β¨
πΈ SYNOPSIS πΈ
#include <systemd/sd-bus.h>
const char* sd_bus_message_get_signature(sd_bus_message *message,
int complete);
int sd_bus_message_is_empty(sd_bus_message *message);
int sd_bus_message_has_signature(sd_bus_message *message,
const char *signature);
π¦ DESCRIPTION π¦
sd_bus_message_get_signature()
so this one returns the signature of message. but here's the tea: if complete is true, you get the signature of the whole entire message back. if it's not true, you just get the signature of the currently open container. that's the whole mood. π
sd_bus_message_is_empty()
returns true if the message is empty β which lowkey just means its signature is empty. simple as that. π«Ά
sd_bus_message_has_signature()
returns true if the signature of message matches the signature you handed it. and yes, signature is allowed to be NULL β that gets treated exactly like an empty string, which means it's literally the same as calling sd_bus_message_is_empty(). iconic behaviour, honestly. β¨
β RETURN VALUE β
when it works, sd_bus_message_get_signature() gives you the signature β and NULL if something went wrong. π
the other two? they return 0 or a positive integer on success. if they fail, you get a negative errno-style error code. that's the vibe check failing, bestie. π
π Errors
the errors you might get handed are giving:
-EINVALβ the message parameter isNULL. yeah. that happened.NULLβ the message parameter isNULL. (yes it's listed again, yes I'm telling you again, we don't gatekeep) π₯
π NOTES π
- everything described here lives in a shared library, so you can compile against it and link it up using the
libsystemdpkg-config(1)file. π - all the functions on this page are thread-agnostic, and only a single thread may operate on a given object at any given time. different threads can access the same object at different times though. and multiple independent objects? those can totally be used from different threads in parallel. slay. π
- the code described here uses
getenv(3), which is declared to be not multi-thread-safe. translation: whatever's calling these functions must not callsetenv(3)from a parallel thread. you're recommended to only dosetenv()calls in an early phase of your program, back when no other threads have been started yet. do not skip this part, fr fr. β οΈ
π HISTORY π
sd_bus_message_get_signature(), sd_bus_message_is_empty(), and sd_bus_message_has_signature() all showed up in version 240. glow-up era. πΈ
π§ SEE ALSO π§
systemd(1), sd-bus(3), sd_bus_message_new(3)
okay that's the whole page, bestie β you're officially signature-literate π and yeah, this is systemd 261.3, dated SD_BUS_ME...SIGNATURE(3) at the bottom of the original. periodt. π
π
π¦ where this page comes from
- ubuntu stonking: libsystemd-dev 261.3-0ubuntu3 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms