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

[UNIKRAFT PATCH 5/8] lib/vfscore: Register `creat` to syscall_shim



Registers `creat` 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        | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/vfscore/Makefile.uk b/lib/vfscore/Makefile.uk
index 8f04e45..5b2c4fb 100644
--- a/lib/vfscore/Makefile.uk
+++ b/lib/vfscore/Makefile.uk
@@ -58,4 +58,5 @@ UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += flock-2
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += unlink-1
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += stat-2
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += open-3
-UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += mkdir-2
\ No newline at end of file
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += mkdir-2
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += creat-2
\ No newline at end of file
diff --git a/lib/vfscore/exportsyms.uk b/lib/vfscore/exportsyms.uk
index 307dd5f..34c6540 100644
--- a/lib/vfscore/exportsyms.uk
+++ b/lib/vfscore/exportsyms.uk
@@ -16,6 +16,8 @@ open
 uk_syscall_e_open
 uk_syscall_r_open
 creat
+uk_syscall_e_creat
+uk_syscall_r_creat
 write
 uk_syscall_e_write
 uk_syscall_r_write
diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
index e5b3a16..c026796 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -185,11 +185,12 @@ int openat(int dirfd, const char *pathname, int flags, 
...)
 }
 LFS64(openat);
 
-int creat(const char *pathname, mode_t mode)
+UK_SYSCALL_R_DEFINE(int, creat, const char*, pathname, mode_t, mode)
 {
        return uk_syscall_e_open((long int) pathname,
                O_CREAT|O_WRONLY|O_TRUNC, mode);
 }
+
 LFS64(creat);
 
 UK_TRACEPOINT(trace_vfs_close, "%d", int);
-- 
2.17.1




 


Rackspace

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