[libc-commits] [libc] [libc] adding linux SYS_fchmodat2 syscall. (PR #89819)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Tue Apr 23 14:05:10 PDT 2024


================
@@ -21,9 +21,12 @@ namespace LIBC_NAMESPACE {
 LLVM_LIBC_FUNCTION(int, chmod, (const char *path, mode_t mode)) {
 #ifdef SYS_chmod
   int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_chmod, path, mode);
+#elif defined(SYS_fchmodat2)
+  int ret =
+      LIBC_NAMESPACE::syscall_impl<int>(SYS_fchmodat2, AT_FDCWD, path, mode, 0, AT_SYMLINK_NOFOLLOW);
 #elif defined(SYS_fchmodat)
   int ret =
-      LIBC_NAMESPACE::syscall_impl<int>(SYS_fchmodat, AT_FDCWD, path, mode);
+      LIBC_NAMESPACE::syscall_impl<int>(SYS_fchmodat, AT_FDCWD, path, mode, 0);
 #else
 #error "chmod and fchmodat syscalls not available."
----------------
michaelrj-google wrote:

nit: add `fchmodat2` to this list

https://github.com/llvm/llvm-project/pull/89819


More information about the libc-commits mailing list