SD_BUS_GET_NAME_MACHINE_ID(3)
π sd_bus_get_name_machine_id(3) π
okay bestie, youβre looking at the systemd manual page named SD_BUS_GET...MACHINE_ID(3) β yes, the truncated header is right there, and the main character is sd_bus_get_name_machine_id, section 3. π¦
β¨ NAME β¨
sd_bus_get_name_machine_id β retrieve a bus client's machine identity. periodt.
πΈ SYNOPSIS πΈ
#include <systemd/sd-bus.h>
int sd_bus_get_name_machine_id(sd_bus *bus, const char *name,
sd_id128_t *machine);
π DESCRIPTION π
So like, sd_bus_get_name_machine_id() retrieves the D-Bus machine identity of the machine that the bus client identified by name is running on. π
Internally, it calls the GetMachineId method of the org.freedesktop.DBus.Peer interface. The D-Bus machine identity is a 128-bit UUID. On Linux systems running systemd, this corresponds to the contents of /etc/machine-id. On success, the machine identity is stored in machine. slay.
π₯ RETURN VALUE π₯
On success, this function returns a non-negative integer. On failure, it returns a negative errno-style error code. thatβs the whole deal.
π Errors π
Returned errors may indicate the following problems, bestie:
-EINVALβ an argument is invalid. rude.-ENOPKGβ the bus cannot be resolved. itβs giving unresolved-bus energy.-ECHILDβ the bus was created in a different process, library or module instance. awkward.-ENOMEMβ memory allocation failed. π
π§ NOTES π§
Functions described here are available as a shared library, which can be compiled against and linked to with the libsystemd pkg-config(1) file. π«Ά
All functions listed here are thread-agnostic and only a single thread may operate on a given object at any given time. Different threads may access the same object at different times. Multiple independent objects may be used from different threads in parallel.
The code described here uses getenv(3), which is declared to be not multi-thread-safe. This means that the code calling the functions described here must not call setenv(3) from a parallel thread. It is recommended to only do calls to setenv() from an early phase of the program when no other threads have been started. fr fr.
β οΈ caveat: that setenv(3) rule is not a suggestion, bestie β donβt be calling it from a parallel thread while this code is doing its thing.
π HISTORY π
sd_bus_get_name_machine_id() was added in version 221. iconic behavior.
π SEE ALSO π
cute sign-off: this page comes from systemd 261.3, and the footer label is SD_BUS_GET...MACHINE_ID(3). the original footer didnβt print a date, so no fake date from me, bestie π
β¨
π¦ 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