IXP_SRV_READBUF(3)

πŸ“¦ version 0-unstable-2022-04, in nixos 26.05, nixpkgs unstable

πŸ’– IXP_SRV_READBUF(3) πŸ’–

okay bestie, welcome to the Library Functions Manual for libixp β€” this page is your group-chat rundown of ixp_srv_readbuf and ixp_srv_writebuf, and yes they are the iconic duo. πŸ’…


✨ NAME ✨

  • ixp_srv_readbuf
  • ixp_srv_writebuf

πŸ“œ SYNOPSIS πŸ“œ

#include <ixp_srvutil.h>

void ixp_srv_readbuf(Ixp9Req *req, char *buf, uint len);

void ixp_srv_writebuf(Ixp9Req *req, char **buf, uint *len, uint max);

🌸 DESCRIPTION 🌸

okay so these are utility functions for handling TRead and TWrite requests for files backed by in-memory buffers. For both functions, buf points to a buffer and len specifies the length of the buffer. πŸ’–

In the case of ixp_srv_writebuf, these values add a level of pointer indirection, and it updates the values if they change. That’s why the signature has char **buf and uint *len, iykyk. ✨

If max has a value other than 0, ixp_srv_writebuf will truncate any writes to that point in the buffer. Otherwise, *buf is assumed to be malloc(3) allocated, and is reallocated to fit the new data as necessary. The buffer is always left nul-terminated. πŸŽ€


πŸ’€ BUGS πŸ’€

heads up, bestie: ixp_srv_writebuf always truncates its buffer to the end of the most recent write. no cap, that’s the whole bug note. 😭


xoxo, from the libixp Manual, stamped 2012 Dec πŸ’œπŸ¦‹

πŸ“¦ where this page comes from