From 161dec53bcf767cb95dfa47fb8fe4fd330d66d7b Mon Sep 17 00:00:00 2001 From: wcc0 <917033401@qq.com> Date: Thu, 12 Aug 2021 16:09:49 +0800 Subject: [PATCH] fix: add fchdir add fchdir and testcases Change-Id: Idb62087ddc46b3b7db4ceaef478d7b9192115628 Signed-off-by: wcc0 <917033401@qq.com> --- porting/liteos_a/user/src/stdio/flockfile.c | 12 ------------ porting/liteos_a/user/src/unistd/fchdir.c | 18 ------------------ 2 files changed, 30 deletions(-) delete mode 100644 porting/liteos_a/user/src/stdio/flockfile.c delete mode 100644 porting/liteos_a/user/src/unistd/fchdir.c diff --git a/porting/liteos_a/user/src/stdio/flockfile.c b/porting/liteos_a/user/src/stdio/flockfile.c deleted file mode 100644 index eb1771bc..00000000 --- a/porting/liteos_a/user/src/stdio/flockfile.c +++ /dev/null @@ -1,12 +0,0 @@ -#include - -#include "stdio_impl.h" -#include "pthread_impl.h" - -void flockfile(FILE *f) -{ - unsupported_api(__FUNCTION__); - if (!ftrylockfile(f)) return; - __lockfile(f); - __register_locked_file(f, __pthread_self()); -} diff --git a/porting/liteos_a/user/src/unistd/fchdir.c b/porting/liteos_a/user/src/unistd/fchdir.c deleted file mode 100644 index 54f9eb23..00000000 --- a/porting/liteos_a/user/src/unistd/fchdir.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include -#include - -#include "syscall.h" - -int fchdir(int fd) -{ - unsupported_api(__FUNCTION__); - int ret = __syscall(SYS_fchdir, fd); - if (ret != -EBADF || __syscall(SYS_fcntl, fd, F_GETFD) < 0) - return __syscall_ret(ret); - - char buf[15+3*sizeof(int)]; - __procfdname(buf, fd); - return syscall(SYS_chdir, buf); -} -- GitLab