qthread_writeF(3)

πŸ“¦ version 1.22^20251007gitcedb1fc, in fedora 43, fedora 44

✨ qthread_writeF β€” the manual page, but make it cute ✨

okay bestie, so this is qthread_writeF(3) from libqthread, and it's literally one of my faves so buckle up πŸŽ€


🌸 NAME 🌸

qthread_writeF, qthread_writeF_const β€” fills an address with data πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qthread.h>

int
qthread_writeF (aligned_t * restrict dest, const aligned_t * restrict
src);

int
qthread_writeF_const (aligned_t *dest, aligned_t src);

πŸ’… DESCRIPTION πŸ’…

okay so these two functions?? they're like a collab between qthread_fill() and qthread_writeEF(). it's giving crossover episode, no cap. ✨

the thing about them: they do NOT wait around for memory to become empty (they're way too main character for that πŸ’…). instead they just do the write and set the state to full atomically β€” atomically with respect to other FEB-based actions, that is. data gets read from src and written to dest. simple. iconic. periodt. 🫢

the semantics of writeF are literally just:

  1. data is copied from src to dest πŸ’«
  2. dest's FEB state gets set to "full" πŸŽ€

⚠️ WARNING ⚠️

okay bestie, important one: this function, and all other FEB-related functions, currently operate exclusively on aligned data. that's the vibe. don't come at me with unaligned data, it's not gonna slay. πŸ’€

🌈 RETURN VALUE 🌈

on success, the memory address dest is marked full, dest gets filled with the contents of src, and 0 is returned. ate. πŸ’…

on error, a non-zero error code is returned. 😭


πŸ“ ERRORS πŸ“

  • ENOMEM β€” not enough memory could be allocated for bookkeeping structures. it's giving broke. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


libqthread Β· APRIL 2011 β€” yeah this page is old enough to have its own nostalgia arc but it still slays, ily bestie, go write some aligned data πŸ’–βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from