io_tryreadtimeout(3)
π io_tryreadtimeout β read from a descriptor without blocking π
okay bestie, welcome to io_tryreadtimeout(3), straight out of the Library Functions Manual. she's a lil function, she's polite, she does NOT make you wait. let's get into it π¦
β¨ NAME β¨
io_tryreadtimeout β read from a descriptor without blocking π
πΈ SYNTAX πΈ
#include <libowfat/io.h>
int io_tryreadtimeout(int64 fd,char* buf,int64 len);
that's it. that's the whole vibe. copy it exactly, don't freestyle the signature, she's sensitive π
π DESCRIPTION π
so here's the tea β β io_tryreadtimeout is identical to io_tryread, with literally one exception. one. singular. iconic behaviour, honestly.
if ALL THREE of these things are true at the same time:
io_tryreadreturns-1(meaning the descriptor is not ready for reading, she's not in the mood yet π), and- the descriptor has a timeout, and
- the read attempt happened after the descriptor's timeout π
then β and only then β io_tryreadtimeout instead returns -2, with errno set to ETIMEDOUT.
so like. she didn't just fail. she failed and she's telling you exactly why. -1 is "not ready bestie, try again", -2 is "girl. you're late. ETIMEDOUT. goodbye." π
no cap, if you only remember one thing:-1= not ready,-2= not ready and past the timeout, witherrno=ETIMEDOUT.
π SEE ALSO π
go read her friends, they're all part of the same squad fr fr:
and that's the whole page, babes π«Ά go forth and never block. this was io_tryreadtimeout(3) from the Library Functions Manual β mwah, slay, periodt β¨π
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms