[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v4 16/22] lib/vfscore: introduce fdclose



Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 lib/vfscore/main.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
index 1164b30b..4d3f83cc 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -205,6 +205,20 @@ TRACEPOINT(trace_vfs_close, "%d", int);
 TRACEPOINT(trace_vfs_close_ret, "");
 TRACEPOINT(trace_vfs_close_err, "%d", int);
 
+int fdclose(int fd)
+{
+       struct vfscore_file *fp;
+
+       fp = vfscore_get_file(fd);
+       if (!fp)
+               return EBADF;
+
+       vfscore_put_fd(fd);
+       fdrop(fp);
+
+       return 0;
+}
+
 int close(int fd)
 {
        int error;
-- 
2.19.2


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.