buffer_puterror2(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

πŸ’– buffer_puterror2 β€” from the Library Functions Manual πŸ’–

okay bestie, gather round, because this one is a tiny little icon and you're gonna love her. she lives in the Library Functions Manual, her whole name is buffer_puterror2(3), and she does exactly one job and does it flawlessly. no cap. 🫢


✨ NAME ✨

buffer_puterror2 β€” write error string to buffer and flush 🌸


✨ SYNTAX ✨

first things first, you gotta let her in the door:

#include <libowfat/buffer.h>

int buffer_puterror2(buffer* b,int errnum);

so like, two args, one int coming back at you. simple. elegant. main character energy. πŸ’…


✨ DESCRIPTION ✨

okay so here's the vibe: buffer_puterror2 takes the error message that goes with the error number you dropped into errnum, and writes it into the buffer. that's it, that's the whole thing. πŸ¦‹

like, for example, if you hand her ENOENT, she gives you back "No such file or directory". literally the error string, straight into your buffer. iconic behavior honestly. 😭


✨ RETURN VALUE ✨

  • 0 β€” everything is fine and we're thriving πŸ’–
  • -1 β€” something went wrong, and it sets errno so you can go find out what. dramatic but fair. πŸ’€

✨ SEE ALSO ✨

her friendship circle, go say hi πŸ‘‘:


and that's the whole page, bestie, we ate and left no crumbs πŸŽ€ bye luv u ✨

sign-off cuteness: this one's straight out of the Library Functions Manual, and the footer at the bottom just says buffer_puterror2(3) β€” that's the whole thing, no date or version info hanging out down there, so that's all we've got to report. πŸ™ˆπŸ’œ