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

Re: [UNIKRAFT PATCH 05/11] lib/vfscore: Register `rmdir` to syscall_shim



Looks good.

Reviewed-by: Daniel Dinca <dincadaniel97@xxxxxxxxx>

On 02.05.2020 21:18, Constantin Raducanu wrote:
Registers `rmdir` system call to syscall_shim library.

Signed-off-by: Constantin Raducanu <raducanu.costi@xxxxxxxxx>
---
  lib/vfscore/Makefile.uk   |  3 ++-
  lib/vfscore/exportsyms.uk |  2 ++
  lib/vfscore/main.c        | 14 +++++++-------
  3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/lib/vfscore/Makefile.uk b/lib/vfscore/Makefile.uk
index 45d3bcb..56d3e4f 100644
--- a/lib/vfscore/Makefile.uk
+++ b/lib/vfscore/Makefile.uk
@@ -46,4 +46,5 @@ UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += dup3-3
  UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += dup2-2
  UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += pwritev-4
  UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += utimes-2
-UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += mknod-3
\ No newline at end of file
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += mknod-3
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += rmdir-1
\ No newline at end of file
diff --git a/lib/vfscore/exportsyms.uk b/lib/vfscore/exportsyms.uk
index 67f3fa8..d615eb8 100644
--- a/lib/vfscore/exportsyms.uk
+++ b/lib/vfscore/exportsyms.uk
@@ -100,6 +100,8 @@ rewinddir
  telldir
  seekdir
  rmdir
+uk_syscall_e_rmdir
+uk_syscall_r_rmdir
  fchdir
  uk_syscall_e_fchdir
  uk_syscall_r_fchdir
diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
index d9496bf..b0af047 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -879,7 +879,7 @@ UK_TRACEPOINT(trace_vfs_rmdir, "\"%s\"", const char*);
  UK_TRACEPOINT(trace_vfs_rmdir_ret, "");
  UK_TRACEPOINT(trace_vfs_rmdir_err, "%d", int);
-int rmdir(const char *pathname)
+UK_SYSCALL_R_DEFINE(int, rmdir, const char*, pathname)
  {
        struct task *t = main_task;
        char path[PATH_MAX];
@@ -888,19 +888,19 @@ int rmdir(const char *pathname)
        trace_vfs_rmdir(pathname);
        error = ENOENT;
        if (pathname == NULL)
-               goto out_errno;
+               goto out_error;
        if ((error = task_conv(t, pathname, VWRITE, path)) != 0)
-               goto out_errno;
+               goto out_error;
error = sys_rmdir(path);
        if (error)
-               goto out_errno;
+               goto out_error;
        trace_vfs_rmdir_ret();
        return 0;
-       out_errno:
+
+       out_error:
        trace_vfs_rmdir_err(error);
-       errno = error;
-       return -1;
+       return -error;
  }
static void




 


Rackspace

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