diff --git a/src/kernel/emulation/linux/CMakeLists.txt b/src/kernel/emulation/linux/CMakeLists.txt index bf090456f..2a6650f31 100644 --- a/src/kernel/emulation/linux/CMakeLists.txt +++ b/src/kernel/emulation/linux/CMakeLists.txt @@ -178,6 +178,7 @@ set(emulation_sources misc/csrctl.c misc/fsgetpath.c misc/abort_with_payload.c + misc/clonefile.c fcntl/open.c fcntl/openat.c fcntl/fcntl.c diff --git a/src/kernel/emulation/linux/misc/clonefile.c b/src/kernel/emulation/linux/misc/clonefile.c new file mode 100644 index 000000000..f521bcc6d --- /dev/null +++ b/src/kernel/emulation/linux/misc/clonefile.c @@ -0,0 +1,11 @@ +#include "clonefile.h" +#include "../duct_errno.h" +#include + +long sys_clonefileat(int src_fd, const char* src_path, int dest_fd, const char* dest_path, uint32_t flags) { + return -ENOSYS; +}; + +long sys_fclonefileat(int src_fd, int dest_fd, const char* dest_path, uint32_t flags) { + return -ENOSYS; +}; diff --git a/src/kernel/emulation/linux/misc/clonefile.h b/src/kernel/emulation/linux/misc/clonefile.h new file mode 100644 index 000000000..af667444b --- /dev/null +++ b/src/kernel/emulation/linux/misc/clonefile.h @@ -0,0 +1,9 @@ +#ifndef LINUX_CLONEFILE_H +#define LINUX_CLONEFILE_H + +#include + +long sys_clonefileat(int src_fd, const char* src_path, int dest_fd, const char* dest_path, uint32_t flags); +long sys_fclonefileat(int src_fd, int dest_fd, const char* dest_path, uint32_t flags); + +#endif // LINUX_CLONEFILE_H diff --git a/src/kernel/emulation/linux/syscalls.c b/src/kernel/emulation/linux/syscalls.c index f166d6bdd..98e3bfcb6 100644 --- a/src/kernel/emulation/linux/syscalls.c +++ b/src/kernel/emulation/linux/syscalls.c @@ -124,6 +124,7 @@ #include "misc/fileport_makeport.h" #include "misc/fileport_makefd.h" #include "misc/csrctl.h" +#include "misc/clonefile.h" #include "synch/semwait_signal.h" #include "fcntl/open.h" #include "fcntl/openat.h" @@ -453,6 +454,7 @@ void* __bsd_syscall_table[600] = { [442] = sys_guarded_close_np, [443] = sys_guarded_kqueue_np, [461] = sys_getattrlistbulk, + [462] = sys_clonefileat, [463] = sys_openat, [464] = sys_openat_nocancel, [465] = sys_renameat, @@ -471,6 +473,7 @@ void* __bsd_syscall_table[600] = { [500] = sys_getentropy, [515] = sys_ulock_wait, [516] = sys_ulock_wake, + [517] = sys_fclonefileat, [521] = sys_abort_with_payload, [524] = sys_setattrlistat, };