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

πŸ’… io_block β€” bestie edition

okay so this is the manual page for io_block, a lil function from the Library Functions Manual that does exactly one thing and does it flawlessly: it flips a file descriptor back into blocking mode. that's it. that's the whole vibe. ✨


🌸 NAME 🌸

io_block β€” switch to blocking I/O 🫢

like. the name literally tells you. it blocks. it's giving "what it says on the tin."


✨ SYNTAX ✨

#include <libowfat/io.h>

void io_block(int64 fd);

yes bestie, that's int64 for the fd. no, we're not discussing it. it's iconic, it ate, moving on. πŸ’…


πŸ’– DESCRIPTION πŸ’–

so io_block takes your UNIX descriptor fd and puts it into ``blocking mode.'' periodt. that's the whole job. no side quests.

now here's the tea you actually need to know β˜• β€” file descriptors are normally in blocking mode already. like, that's the default, that's their natural state, that's their main character energy. except when they come from accept() or io_accept() and the listening socket was sitting in non-blocking mode. then your new fd inherited the non-blocking curse 😭 and it's out here reading like it's got somewhere better to be.

so if you've got one of those chaotic little non-blocking descriptors and you want it to just. wait. like a normal well-behaved fd. that's the moment. that's when you call io_block. πŸ¦‹

lowkey important: if your fd is already blocking, calling this is just... a vibe check. nothing dramatic happens. the manpage does not promise you anything extra, and neither do I. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

  • io_nonblock(3) β€” the flip side, the opposite queen, the one who does the exact reverse. if io_block is putting the phone down and waiting, io_nonblock is the one who can't sit still. check her out. πŸ’œ

and that's the whole page bestie!! πŸŽ€ no cap, that's every single detail β€” the #include <libowfat/io.h>, the void io_block(int64 fd);, the blocking mode, the accept() / io_accept() / listening-socket situation, and the io_nonblock(3) link. nothing dropped, nothing invented. πŸ’―

this lil beauty came out of the Library Functions Manual and lives under io_block(3) β€” same name up top, same name at the bottom, symmetrical, balanced, absolutely serving. ⭐ go forth and block, bestie. 🧚🌈