sock_read(3z)
π sock_read(3z) π
okay bestie, welcome to z88dk Programmer's Manual β yes we're reading a manpage for fun, and yes it's gonna slay π«Ά
β¨ NAME β¨
sock_read β read bytes from a network socket ππ«
β¨ SYNOPSIS β¨
#include <net/socket.h>
size_t sock_read(SOCKET * s, void * dp , size_t len);
β¨ DESCRIPTION β¨
so like, the parameter s? that's a descriptor to an open socket that you made earlier with sock_open(3z) or sock_listen(3z). you can't just rock up with a random socket, it has to be one of those two, iykyk π
and then sock_read() does the thing: it reads at most len bytes from the socket s and drops them at dp. cute right? it's giving "delivery service but for bytes" π¦β¨
heads up bestie: dp should be in the lower 16k of the memory map. like, don't be putting it anywhere else, fr fr π that's a real constraint, not a vibe suggestion.
β¨ RETURN VALUE β¨
sock_read() returns the number of bytes read from the socket. that's it, that's the number πΈ
but β and this is the part where you go π β if you supply an illegal socket, the carry flag will be set, and the return value will be EPROTONOSUPPORT. so like, check your sockets before you ship, no cap.
β¨ AUTHOR β¨
Dominic Morris <dom@jb.man.ac.uk> β the icon, the legend, the one who wrote this π
and that's the whole page bestie, you ate it up π π
z88dk Programmer's Manual Β· sock_read(3z) Β· 18 February 2000 β yeah she's an oldie but she's iconic, periodt ππ
π¦ where this page comes from
- fedora 43: z88dk 1.10.1-33.20150709cvs.fc43 Β· ClArtistic
- fedora 44: z88dk 1.10.1-33.20150709cvs.fc43 Β· ClArtistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms