iob_addbuf_free(3)
π 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: becauseiob_resetis the one doing the deallocating, that's the whole vibe of this function versus plain oldiob_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 πβ¨
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms