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

πŸ’– ndelay_off(3) β€” the blocking-mode button, bestie πŸ’–

Library Functions Manual ✨ yes we are literally in the library functions section, this is a libowfat moment, iykyk.


πŸŽ€ NAME πŸŽ€

ndelay_off β€” put a file descriptor in blocking mode πŸ›‘β³


✨ SYNTAX ✨

okay so first you gotta invite the header in, no cap:

#include <libowfat/ndelay.h>

extern int ndelay_off(int fd);

that's it. that's the whole vibe. she's a function, she takes an int fd, she gives you back an int. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so ndelay_off does the thing where it puts a file descriptor into blocking mode. like, that's her whole job, that's her main character energy. πŸ‘‘

and bestie, what does blocking actually mean? it means when you're reading from and writing to blocking network sockets, FIFOs or device files, the call will possibly not return immediately β€” it'll just sit there and wait on more input or buffer space for output. she's patient. she's not in a rush. she's giving "i'll get back to you when i feel like it" energy and honestly? iconic. πŸ’€

not me just sitting in a syscall waiting for data like it's a situationship 😭

and if something goes wrong? if an error occurred, ndelay_off will return nonzero and set errno accordingly. so like, always check your return value, bestie, errno is literally telling you what happened. fr fr. πŸ™ˆ


🌈 SEE ALSO 🌈

go read these next, they're in the group chat too:


and that's the whole page, periodt ✨

this lil cutie came from the Library Functions Manual, and the page signs itself ndelay_off(3) at the bottom β€” no date stamp on this one, so we're just gonna vibe with it as-is. stay blocking (when you want to), bestie πŸ«ΆπŸŒΈπŸ’œ