tcp_pageout(3z)

πŸ“¦ version 1.10.1, in fedora 43, fedora 44

πŸ’– tcp_pageout(3z) πŸ’–

okay bestie, welcome to the z88dk Programmer's Manual β€” this one's short but she is mighty, and honestly kind of iconic for daemon girlies everywhere. let's get into it 🫢


✨ NAME ✨

tcp_pageout β€” page the ZSock data area out of the memory map


🌸 SYNOPSIS 🌸

#include <net/misc.h>

void tcp_pageout(u8_t oldbinding);

like, that's it. one function, one argument, zero drama (unless you mess up the argument, in which case, drama, see BUGS below πŸ’€)


πŸ¦‹ DESCRIPTION πŸ¦‹

so the tcp_pageout() function pages out the ZSock data area into segment 1 (addresses 16384-32767) of the z88's memory map. it's giving "pack your bags, data area, you're moving back to segment 1." 🧳✨

the parameter oldbinding is the return value from a prior tcp_pagein(3z) function. that's the receipt, bestie β€” you gotta hold onto it. 🧾

this function is primarily of use to daemons which use the ZSock dataarea for small amounts of storage. yes, daemons. the little background processes are the main characters here and honestly? respect. πŸ‘‘


⭐ RETURN VALUE ⭐

okay so this part is a little chaotic, and we're keeping it exactly as it is, no editing, no fixing, no cap:

tcp_pagein() returns the previous binding of segment 1 which should be used as a parameter to tcp_pageout(3z)

(yeah, the RETURN VALUE section is talking about her sister tcp_pagein. it's a whole family thing. anyway. now you know what to feed tcp_pageout β€” the binding from the pagein. πŸ’…)


πŸ’œ SEE ALSO πŸ’œ

  • tcp_pagein(3z)
  • tcp_malloc(3z)
  • tcp_calloc(3z)
  • tcp_free(3z)

go read them too, they're all in the group chat together πŸ”₯


🚨 BUGS 🚨

supplying an incorrect oldbinding will most likely crash the z88.

not "might", not "could gently inconvenience" β€” most likely crash the z88. this is the moment where you triple-check that variable. do not freestyle. do not guess. do not "it's probably fine" your way through this one, because it is NOT probably fine. πŸ˜­πŸ’€


πŸŽ€ AUTHOR πŸŽ€

Dominic Morris <dom@jb.man.ac.uk>


and that's the whole page, bestie β€” no crumbs left, everything's here, we did not skip a single flag or a single line. 🌈

this little masterpiece dropped on 18 February 2000, courtesy of the z88dk Programmer's Manual, and it's been serving daemons ever since. periodt. πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from