plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit cd8b4ed59912a3c2dc4dff79a98fec91da1d1f73
parent e8042f95fb79bf5af63da2e29ae995ff4f11449e
Author: ssnf <ssnf@ssnf.xyz>
Date:   Sun, 15 Jun 2025 16:34:50 +0000

add clunk callback in lib9p

Diffstat:
Minclude/9p.h | 1+
Msrc/lib9p/srv.c | 2++
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/9p.h b/include/9p.h @@ -191,6 +191,7 @@ struct Srv { void (*create)(Req*); void (*read)(Req*); void (*write)(Req*); + void (*clunk)(Req*); void (*remove)(Req*); void (*flush)(Req*); void (*stat)(Req*); diff --git a/src/lib9p/srv.c b/src/lib9p/srv.c @@ -554,6 +554,8 @@ sclunk(Srv *srv, Req *r) { if((r->fid = removefid(srv->fpool, r->ifcall.fid)) == nil) respond(r, Eunknownfid); + else if (srv->clunk) + srv->clunk(r); else respond(r, nil); }