SD_BUS_MESSAGE_SKIP(3)

πŸ’… SD_BUS_MESSAGE_SKIP(3) β€” the manual page, bestie edition πŸŽ€

okay so this is the sd_bus_message_skip page from the sd_bus_message_skip manual, and no cap, it's about skipping stuff in a bus message. stay with me, it's actually iconic ✨


🌸 NAME 🌸

sd_bus_message_skip β€” skip elements in a bus message πŸ’¨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <systemd/sd-bus.h>

int sd_bus_message_skip(sd_bus_message *m, const char* types);

✨ DESCRIPTION ✨

so sd_bus_message_skip() is lowkey giving sd_bus_message_read(3), but here's the twist: instead of actually reading the contents of the message, it only moves the "read pointer". that's it. that's the whole vibe 🫢

the way that means subsequent read operations will read the elements that come after the ones you skipped. so you're basically telling the message "nah, we're not doing that part, moving on" πŸ’…

the types argument has the same meaning as in sd_bus_message_read(). it may also be NULL, which skips a single element of any type. versatile queen πŸ‘‘


πŸ”₯ RETURN VALUE πŸ”₯

on success, sd_bus_message_skip() returns 0 or a positive integer. on failure, it returns a negative errno-style error code. simple as that, periodt πŸ’€

😭 Errors 😭

the errors it might throw back at you mean the following things, fr fr:

  • -EINVAL β€” the m parameter is NULL. you gave it nothing, bestie, what did you expect 🫠
  • -EBADMSG β€” the message cannot be parsed. it's giving unreadable 😬
  • -EPERM β€” the message is not sealed. nope, not allowed, sorry 😀
  • -ENXIO β€” the message end has been reached and the requested elements cannot be read. you ran out of message, babe 🌈
  • -ENOMEM β€” memory allocation failed. the computer is out of room πŸ’€

πŸ‘‘ NOTES πŸ‘‘

okay important stuff, don't skip this part (ironic, i know) πŸ™ˆ

functions described here are available as a shared library, which can be compiled against and linked to with the libsystemd pkg-config(1) file. slay, linking is handled 🌸

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. basically: share the object, but not at the same exact moment, iykyk πŸ’…

the code described here uses getenv(3), which is declared to be not multi-thread-safe. this means 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. so like... do your setenv() era first, before the threads show up, okay? 😭

🧚 HISTORY 🧚

sd_bus_message_skip() was added in version 240. a whole era πŸ”₯


🌈 SEE ALSO 🌈

go read those too, bestie, they're all part of the same friend group 🫢


and that's the page!! brought to you by systemd 261.3, with the manual name SD_BUS_MESSAGE_SKIP(3) folded in right at the top like a little crown πŸ‘‘βœ¨ mwah, love you, go skip some message elements responsibly πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from