IXP_PENDING_WRITE(3)
π IXP_PENDING_WRITE β bestie's guide to pending writes π
okay so this is a page from the libixp manual, and it's literally all about the ixp_pending_* girlies (plus their bestie IxpPending). they live in <ixp_srvutil.h> and they are everything if you're out here serving virtual files that broadcast events or write data whenever it finally shows up. no cap.
β¨ NAME β¨
ixp_pending_write, ixp_pending_print, ixp_pending_vprint, ixp_pending_pushfid, ixp_pending_clunk, ixp_pending_flush, ixp_pending_respond, IxpPending β the whole friend group π«Ά
π SYNOPSIS π
#include <ixp_srvutil.h>
void ixp_pending_write(IxpPending *pending, const char *dat, long ndat);
int ixp_pending_print(IxpPending *pending, const char *fmt, ...);
int ixp_pending_vprint(IxpPending *pending, const char *fmt, va_list ap);
void ixp_pending_pushfid(IxpPending *pending, IxpFid *fid);
bool ixp_pending_clunk(Ixp9Req *req);
void ixp_pending_flush(Ixp9Req *req);
void ixp_pending_respond(Ixp9Req *req);
typedef struct IxpPending IxpPending;
struct IxpPending {
/* Private members */
...
}
π¦ DESCRIPTION π¦
so these functions? they're the main character energy for writing virtual files β the kind you use for broadcasting events or for writing data when it finally becomes available. it's giving "the data's not here yet but bestie it WILL be" β¨
when a file that's gonna use these functions gets opened, you should call ixp_pending_pushfid with its IxpFid(3) as the argument. that sets the IxpFid's pending member to true. periodt.
and then, for every file that has its pending member set, here's the choreography, no skipping steps:
- call
ixp_pending_respondfor eachTReadrequest πΈ - call
ixp_pending_clunkfor eachTClunkrequest π - call
ixp_pending_flushfor eachTFlushrequest π
ixp_pending_write queues the data in dat of length ndat to be written to each currently pending fid in pending. and here's the vibe check: if there's already a read request pending for a given fid, the data gets written immediately. otherwise? it gets written the next time ixp_pending_respond is called. and like, same energy in reverse β if there's data queued when ixp_pending_respond is called, it's written immediately; otherwise the request gets queued. iykyk π₯
ixp_pending_print and ixp_pending_vprint call ixp_pending_write after formatting their arguments with ixp_vsmprint(3). slay, formatting handled.
π«Ά heads up bestie: the IxpPending data structure is opaque β so don't go poking at its private members β and it should be initialized zeroed before you use these functions for the first time. do that or it's gonna be a mess π
π RETURN VALUE π
ixp_pending_clunk returns true if pending has any more pending IxpFids. that's the whole vibe β true when there's still more pending, periodt.
okay that's the whole page, and before i go β this one's from the libixp manual, dated 2012 Dec, source/version IXP_PENDING_WRITE(3). iconic little archival moment, mwah π π β
π¦ where this page comes from
- nixos 26.05: libixp 0-unstable-2022-04-04
- nixpkgs unstable: libixp 0-unstable-2022-04-04
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms