aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/cofile.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/9pfs/cofile.c')
-rw-r--r--hw/9pfs/cofile.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c
index 4b0d96c703..e552999666 100644
--- a/hw/9pfs/cofile.c
+++ b/hw/9pfs/cofile.c
@@ -81,3 +81,19 @@ int v9fs_co_open2(V9fsState *s, V9fsFidState *fidp, char *fullname, gid_t gid,
});
return err;
}
+
+int v9fs_co_close(V9fsState *s, V9fsFidState *fidp)
+{
+ int fd;
+ int err;
+
+ fd = fidp->fs.fd;
+ v9fs_co_run_in_worker(
+ {
+ err = s->ops->close(&s->ctx, fd);
+ if (err < 0) {
+ err = -errno;
+ }
+ });
+ return err;
+}