From b325c3832ce629f729816dad37a0f027603324ae Mon Sep 17 00:00:00 2001 From: Sergiu Moga Date: Mon, 17 Feb 2025 15:50:56 +0200 Subject: [PATCH] lib/vfscore: Register `creat` using the raw variant The `creat` has been registered as non-raw a long time ago, back when the registration policy was different. Now, all system calls should be registered as raw. Do so for `creat` as well and make it call the `uk_syscall_do_` variant of `open` in order to avoid invoking the system call enter/exit tables twice. Signed-off-by: Sergiu Moga Approved-by: Andrei Tatar Reviewed-by: Andrei Tatar GitHub-Closes: #1591 --- lib/vfscore/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c index 2b5c90212..d3caf4b0d 100644 --- a/lib/vfscore/main.c +++ b/lib/vfscore/main.c @@ -236,10 +236,11 @@ int openat(int dirfd, const char *pathname, int flags, ...) LFS64(openat); #endif /* UK_LIBC_SYSCALLS */ -UK_SYSCALL_DEFINE(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); + return uk_syscall_do_open((long int)pathname, + O_CREAT | O_WRONLY | O_TRUNC, + mode); } #ifdef creat64 -- 2.39.5