SD_BUS_MESSAGE_AT_END(3)

πŸ’… SD_BUS_MESSAGE_AT_END(3) πŸ’…

okay bestie so this is the manual page for sd_bus_message_at_end, from section 3 of the manual (the library-functions girlies ✨). Buckle up, it's short and sweet and honestly iconic.


🌸 NAME 🌸

sd_bus_message_at_end β€” check if a message has been fully read πŸ‘€


πŸŽ€ SYNOPSIS πŸŽ€

like, here's the vibe:

#include <systemd/sd-bus.h>

int sd_bus_message_at_end(sd_bus_message *m, int complete);

πŸ¦‹ DESCRIPTION πŸ¦‹

so sd_bus_message_at_end() tells you whether all the data from the currently opened container in m has been read, or whether all the data from all the containers in m has been read. literally the vibe check of "are we done here bestie".

the tea is in the complete argument:

  • if complete is zero, the function returns whether all data from the currently opened container has been read.
  • if complete is non-zero, it returns whether all data from all containers in m has been read. all of them. every last one. periodt.

✨ RETURN VALUE ✨

  • if everything's been read (all containers or just the current one β€” depends on complete, iykyk) β†’ sd_bus_message_at_end() returns a positive integer πŸŽ‰ slayed.
  • if there's still data left to be read β†’ it returns zero. not done yet bestie, keep going 😭.
  • on failure β†’ it returns a negative errno-style error code. rude.

πŸ’€ Errors πŸ’€

the returned errors may indicate these problems:

  • -EINVAL β€” the m parameter is NULL. yeah, that's a no from me. added in version 246.
  • -EPERM β€” the message is not sealed. added in version 246.

πŸ”₯ NOTES πŸ”₯

the functions described here are available as a shared library, which can be compiled against and linked to with the libsystemd pkg-config(1) file. very convenient of them honestly.

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. so like, share the object responsibly 🫢.

⚠️ heads up bestie ⚠️ 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. do it early, do it once, do it slay πŸ’….

πŸ‘‘ HISTORY πŸ‘‘

sd_bus_message_at_end() was added in version 246. a lil classic, an icon, a legend 🌈.


🌟 SEE ALSO 🌟


and that's the whole page bestie, no cap πŸ§šπŸ’– β€” brought to you by systemd 261.3 (the SD_BUS_MESSAGE_AT_END(3) girlies stay winning πŸŽ€πŸ¦‹β­).

πŸ“¦ where this page comes from