[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v2 17/23] lib/vfscore: introduce fdclose
Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx> --- lib/vfscore/main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c index 1164b30b..0ff8d390 100644 --- a/lib/vfscore/main.c +++ b/lib/vfscore/main.c @@ -205,6 +205,25 @@ 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); + /* vfscore_get_file increases the f_count. The first fdrop is + * to decrement it back. The second is an actual reducing we + * are supposed to do while performing fdclose() + */ + fdrop(fp); + 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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |