buffer_flush(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_flush(3) πŸ’–

from the Library Functions Manual, bestie 🫢


🌸 NAME 🌸

buffer_flush β€” feed buffer to write function. that's the whole assignment, no cap. πŸ’Œ

✨ SYNTAX ✨

#include <libowfat/buffer.h>

int buffer_flush(buffer* b);

πŸ’… DESCRIPTION πŸ’…

okay so bestie, here's the tea β˜•: buffer_flush feeds a string d[0], d[1], ..., d[dlen-1] to the write operation by calling

op(fd,d,dlen)

then the rules for op are giving very specific contract energy:

  • If op successfully handles one or more bytes at the beginning of the string, it must return the number of bytes handled. πŸ’― If this number is smaller than dlen, buffer_flush will call op again with the rest of the string. no cap.
  • If op does not handle any bytes, and does not encounter an error, it must return 0, or return -1 with errno set to EINTR; in either case, buffer_flush will immediately call op again. πŸ”
  • If op encounters an error, it must return -1 with errno set to something other than EINTR; buffer_flush will pass the error to the caller. 🚨

On success, buffer_flush returns 0. ✨ On error, buffer_flush returns -1, setting errno appropriately. 😭

πŸ‘€ SEE ALSO πŸ‘€


mwah πŸ’‹ β€” that's the whole thing from the Library Functions Manual, buffer_flush(3), footer vibes only: no version/date drama, just the page name, iconic. πŸ’…βœ¨