IXP_PENDING_WRITE(3)

NAME

ixp_pending_write, ixp_pending_pushfid, ixp_pending_clunk, ixp_pending_flush, ixp_pending_respond, IxpPending

SYNOPSIS
  #include <ixp_srvutil.h>

  void ixp_pending_write(IxpPending *pending, char *dat, long ndat);

  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

These functions aid in writing virtual files used for broadcasting events or writing data when it becomes available. When a file to be used with these functions is opened, ixp_pending_pushfid should be called with its IxpFid(3) as an argument. This sets the IxpFid's IpendingR member to true. Thereafter, for each file with its IpendingR member set, ixp_pending_respond should be called for each TRead request, ixp_pending_clunk for each TClunk request, and ixp_pending_flush for each TFlush request.

ixp_pending_write queues the data in IdatR of length IndatR to be written to each currently pending fid in IpendingR. If there is a read request pending for a given fid, the data is written immediately. Otherwise, it is written the next time ixp_pending_respond is called. Likewise, if there is data queued when ixp_pending_respond is called, it is written immediately, otherwise the request is queued.

The IxpPending data structure is opaque and should be initialized zeroed before using these functions for the first time.

RETURN VALUE

ixp_pending_clunk returns true if IpendingR has any more pending IxpFids.