iob_addfile_close(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_addfile_close β€” from the libowfat crew, section 3 of the Library Functions Manual πŸ’–

okay bestie, buckle up, we're doing a syscall-adjacent glow-up πŸ¦‹


✨ NAME ✨

iob_addfile_close β€” add a file region to your I/O batch πŸŽ€


✨ SYNTAX ✨

#include <libowfat/iob.h>

int iob_addfile_close(io_batch* b,int64 fd,uint64 off,uint64 n);

✨ DESCRIPTION ✨

so basically iob_addfile_close is the queen who schedules n bytes from the file descriptor fd, starting at offset off, to be written with the I/O batch b. she's putting it on the calendar, not doing it right this second. main character scheduling energy πŸ‘‘

🚨 IMPORTANT, NO CAP: you may not close fd before iob_send indicates it is done. do NOT do it. the vibe check will fail and you will be sad 😭

also, heads up: iob_reset will call io_close(fd). so the cleanup is handled, but like… on iob_reset's terms, iykyk πŸ’…


✨ RETURN VALUE ✨

  • 1 β€” success, slay, we ate ✨
  • 0 β€” failure. and in the failure case, the file descriptor has been closed already. so like, don't double-close it, that's a whole thing πŸ’€

✨ SEE ALSO ✨

go read them, they're all part of the same little friend group 🫢


and that's the whole page, bestie!! this one lives in the Library Functions Manual, section 3, and the footer at the bottom is just iob_addfile_close(3) echoing the name back at you like a little mirror selfie πŸͺž β€” no version number, no date, just vibes and a (3). stay batched, stay unclosed-until-iob_send-says-so, and drink some water πŸ“πŸ§šπŸ’œ