[osv-dev] [PATCH] vfs: implement renameat()

2022-05-20 Thread Waldemar Kozaczuk
This patch implements the renameat() function and enhances tst-rename.cc to unit test it. This patch also exposes renameat as a syscall. #Refs 1188 Signed-off-by: Waldemar Kozaczuk --- exported_symbols/osv_ld-musl.so.1.symbols | 1 + exported_symbols/osv_libc.so.6.symbols| 1 + fs/vfs/ma

[osv-dev] [PATCH] multibyte: add __mbstowcs_chk

2022-05-20 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- Makefile| 1 + libc/multibyte/__mbstowcs_chk.c | 17 + 2 files changed, 18 insertions(+) create mode 100644 libc/multibyte/__mbstowcs_chk.c diff --git a/Makefile b/Makefile index 3e87a16d..19a4571b 100644 --- a/Makefi

[osv-dev] [PATCH V2] syscall: implement getdents64

2022-05-20 Thread Waldemar Kozaczuk
V2: The only difference is removed delete_dir() function was accidentally left from previous attempts to implement this syscall. It looks like the golang apps that need to iterate over entries in a directory use a system call getdents64 which is documented in https://man7.org/linux/man-pages/man2/

[osv-dev] [PATCH] syscall: implement getcwd

2022-05-20 Thread Waldemar Kozaczuk
#Refs 1188 Signed-off-by: Waldemar Kozaczuk --- linux.cc | 15 +++ tests/tst-syscall.cc | 7 +++ 2 files changed, 22 insertions(+) diff --git a/linux.cc b/linux.cc index dd0dabd1..85c08981 100644 --- a/linux.cc +++ b/linux.cc @@ -366,6 +366,20 @@ static int sys_exit

[osv-dev] [PATCH V2] vfs: implement symlinkat

2022-05-20 Thread Waldemar Kozaczuk
V2: The implementation uses vfs_fun_at2() instead of vfs_fun_at() to further simplify code. We also expose symlinkat though syscall. This patch implements the symlinkat() function and enhances tst-symlink.cc to unit test it. #Refs 1188 Signed-off-by: Waldemar Kozaczuk --- exported_symbols/osv_

[osv-dev] [PATCH V2] unlinkat: fill the gaps in the implementation

2022-05-20 Thread Waldemar Kozaczuk
V2: The implementation uses vfs_fun_at2() instead of vfs_fun_at() to further simplify code. We also expose unlinkat though syscall. This patch enhances the unlinkat() implementation to handle the AT_FDCWD dirfd and AT_REMOVEDIR flags. We also enhance tst-remove.cc to test unlinkat. #Refs 1188

[osv-dev] [PATCH V2] vfs: refactor the *at() functions

2022-05-20 Thread Waldemar Kozaczuk
Comparing to the 1st version, this one adds another helper function - vfs_fun_at2() - which calls supplied lambda if dirfd == AT_FDCWD or pathname is an absolute path and otherwise delegates to vfs_fun_at(). It also checks if pathname is not null. The __fxstatat() and futimesat() call vfs_fun_at()