[libc-commits] [libc] d00e97d - [libc][Obvious] Fix typo is chmod implementation.
Siva Chandra via libc-commits
libc-commits at lists.llvm.org
Tue Aug 23 15:06:46 PDT 2022
Author: Siva Chandra
Date: 2022-08-23T15:01:21-07:00
New Revision: d00e97df0fe8c67f694c4d027297f4382ce72b38
URL: https://github.com/llvm/llvm-project/commit/d00e97df0fe8c67f694c4d027297f4382ce72b38
DIFF: https://github.com/llvm/llvm-project/commit/d00e97df0fe8c67f694c4d027297f4382ce72b38.diff
LOG: [libc][Obvious] Fix typo is chmod implementation.
This now allows enabling the chmod function on aarch64.
Added:
Modified:
libc/config/linux/aarch64/entrypoints.txt
libc/src/sys/stat/linux/chmod.cpp
Removed:
################################################################################
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index 17c7c41365318..684fd0a4906a9 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -101,6 +101,7 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.sys.mman.munmap
# sys/stat.h entrypoints
+ libc.src.sys.stat.chmod
libc.src.sys.stat.fchmod
libc.src.sys.stat.mkdir
libc.src.sys.stat.mkdirat
diff --git a/libc/src/sys/stat/linux/chmod.cpp b/libc/src/sys/stat/linux/chmod.cpp
index 6297e5cd051c1..5e092f24461a3 100644
--- a/libc/src/sys/stat/linux/chmod.cpp
+++ b/libc/src/sys/stat/linux/chmod.cpp
@@ -21,8 +21,8 @@ namespace __llvm_libc {
LLVM_LIBC_FUNCTION(int, chmod, (const char *path, mode_t mode)) {
#ifdef SYS_chmod
long ret = __llvm_libc::syscall(SYS_chmod, path, mode);
-#elif defined(SYS_chmodat)
- long ret = __llvm_libc::syscall(SYS_chmodat, AT_FDCWD, path, mode);
+#elif defined(SYS_fchmodat)
+ long ret = __llvm_libc::syscall(SYS_fchmodat, AT_FDCWD, path, mode);
#else
#error "chmod and chmodat syscalls not available."
#endif
More information about the libc-commits
mailing list