iob_addbuf_free(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– iob_addbuf_free β€” bestie edition ✨

okay so real talk, this one lives in the libowfat manual, section 3, and it's called iob_addbuf_free. she's the buffer-adding girly who ALSO cleans up after herself. main character behaviour fr fr πŸŽ€


🌸 NAME 🌸

iob_addbuf_free β€” add a buffer to an I/O batch, but make it the deallocating kind πŸ’…


✨ SYNTAX ✨

#include <libowfat/iob.h>

int iob_addbuf_free(io_batch* b,const void* buf,uint64 n);

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically iob_addbuf_free books n bytes, starting at buf, to get written out with the I/O batch b. like, "hey bestie, queue this up for me" πŸ’Œ

and here's the iconic part: that buffer gets automatically deallocated by iob_reset. no cap, she handles the cleanup herself so you don't have to. self-care queen πŸ‘‘

⚠️ heads up though: because iob_reset is the one doing the deallocating, that's the whole vibe of this function versus plain old iob_addbuf β€” don't go freeing that buffer yourself on the side, that's giving double-free energy πŸ’€

🌈 RETURN VALUE 🌈

  • 1 β€” slay, it worked ✨
  • 0 β€” nope, it did not work

and in the failure case? the buffer was deallocated anyway. so like, even when she fails she still took the trash out πŸ—‘οΈ (so please don't free it again after that, iykyk)


🫢 SEE ALSO 🫢


and that's the whole page bestie, hope it ate πŸ’– this was the iob_addbuf_free(3) page from the Library Functions Manual, and yeah, the footer just says iob_addbuf_free(3) right back at you β€” no fancy version or date, she's mysterious like that πŸ™ˆβœ¨