io_wantwrite(3)
π io_wantwrite β signal that you want to write to a descriptor π
okay bestie, you're reading io_wantwrite(3) from the Library Functions Manual and honestly? it's giving "I have something to say and I need the event loop to know" πΈ
β¨ SYNTAX β¨
#include <libowfat/io.h>
void io_wantwrite(int64 fd);
π¦ DESCRIPTION π¦
okay so io_wantwrite is you sliding into the DMs of the next io_wait() to be like "hey. I want to write to this descriptor." that's it. that's the whole vibe. π
and if you change your mind? no worries, just call io_dontwantwrite() again and we pretend it never happened π
the next time you call io_wait(), it will look whether this descriptor becomes writeable, too. and then you can use io_canwrite() to check whether the descriptor has become writable. so the pipeline is: you say you want it, io_wait() goes and peeks, io_canwrite() tells you if the moment has arrived. iconic teamwork, no cap π«Ά
β οΈ but listen β you have to have calledio_fdon the descriptor first. not optional.io_pipeandio_socketpairdo this for you though, so if you came in through one of those doors you're already slaying π
and here's the lowkey important part: waiting on descriptors only works for sockets, fifos and pipes. it may also work on devices and TTYs, but that is platform dependent β you should not rely on that. fr fr, don't build your whole personality on it π
π SEE ALSO π
io_wait(3)io_canwrite(3)io_wantwrite(3)β yes it's listing itself, main character energy, we love a self-referential queen πio_fd(3)
and that's the page, bestie π this was io_wantwrite(3) straight outta the Library Functions Manual, brought to you by the fine folks who make your event loop go brrr. go forth and write β¨ππ¦
π¦ 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