sock_putc(3z)
π sock_putc β the manual, but make it cute π
okay so this is a page from the z88dk Programmer's Manual, and it's all about sock_putc(3z) β one lil byte, one big vibe. let's get into it π¦
β¨ NAME β¨
sock_putc β write byte to a network socket
yes bestie, ONE byte. singular. we're being precise today π
β¨ SYNOPSIS β¨
#include <net/socket.h>
size_t sock_putc(char c, SOCKET *s);
look at that signature. clean. iconic. no notes. π
β¨ DESCRIPTION β¨
so the parameter s is a descriptor to an open socket β and not just any socket, one you made with sock_open(3z) or sock_listen(3z). gotta have it open first, no shortcuts, no cap π₯
then sock_putc() does its one job and its one job only: it writes a single byte c to the socket you specified with s. that's it. that's the whole function. main character energy, minimal plot π«Ά
β¨ RETURN VALUE β¨
so the return value here is the number of bytes written to the socket β which, given that we're writing literally one byte, means it's 0 or 1. very binary of it π
okay heads up, the page literally says "Thesock_write()function returnsβ¦" in this section β notsock_putc(). i'm quoting it exactly as written because that's the rule, and i am nothing if not a rule-follower when it comes to facts π
and if you hand it an illegal socket? the carry flag gets set, and the return value will be EPROTONOSUPPORT. so yeah. don't do that. vibe check failed, bestie π
β¨ SEE ALSO β¨
sock_write(3z)sock_puts(3z)
go read those too, they're giving the same energy fr fr πΈ
β¨ AUTHOR β¨
Dominic Morris <dom@jb.man.ac.uk> β the legend, the moment, the author π
and that's a wrap, gorgeous π this was the z88dk Programmer's Manual edition of sock_putc(3z), dated 18 February 2000 β yes, a vintage queen from the year 2000, still slaying β¨π bye bestie, go write exactly one byte π
π¦ 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