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

[UNIKRAFT PATCH 04/11] lib/vfscore: Register `mknod` to syscall_shim



Registers `mknod` 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        | 12 +++++-------
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/lib/vfscore/Makefile.uk b/lib/vfscore/Makefile.uk
index c2064d9..45d3bcb 100644
--- a/lib/vfscore/Makefile.uk
+++ b/lib/vfscore/Makefile.uk
@@ -45,4 +45,5 @@ UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += dup-1
 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
\ No newline at end of file
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += utimes-2
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += mknod-3
\ No newline at end of file
diff --git a/lib/vfscore/exportsyms.uk b/lib/vfscore/exportsyms.uk
index 44ff969..67f3fa8 100644
--- a/lib/vfscore/exportsyms.uk
+++ b/lib/vfscore/exportsyms.uk
@@ -89,6 +89,8 @@ truncate
 uk_syscall_e_truncate
 uk_syscall_r_truncate
 mknod
+uk_syscall_e_mknod
+uk_syscall_r_mknod
 preadv
 ioctl
 fdatasync
diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
index 51417b9..d9496bf 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -237,27 +237,25 @@ int __xmknod(int ver, const char *pathname, mode_t mode, 
dev_t *dev __unused)
 
        trace_vfs_mknod(pathname, mode, *dev);
        if ((error = task_conv(t, pathname, VWRITE, path)) != 0)
-               goto out_errno;
+               goto out_error;
 
        error = sys_mknod(path, mode);
        if (error)
-               goto out_errno;
+               goto out_error;
 
        trace_vfs_mknod_ret();
        return 0;
 
-       out_errno:
+       out_error:
        trace_vfs_mknod_err(error);
-       errno = error;
-       return -1;
+       return -error;
 }
 
-int mknod(const char *pathname, mode_t mode, dev_t dev)
+UK_SYSCALL_R_DEFINE(int, mknod, const char*, pathname, mode_t, mode, dev_t, 
dev)
 {
        return __xmknod(0, pathname, mode, &dev);
 }
 
-
 UK_TRACEPOINT(trace_vfs_lseek, "%d 0x%x %d", int, off_t, int);
 UK_TRACEPOINT(trace_vfs_lseek_ret, "0x%x", off_t);
 UK_TRACEPOINT(trace_vfs_lseek_err, "%d", int);
-- 
2.17.1




 


Rackspace

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