Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] adding linux SYS_fchmodat2 syscall. #89819

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

devnexen
Copy link
Member

No description provided.

@llvmbot llvmbot added the libc label Apr 23, 2024
@llvmbot
Copy link

llvmbot commented Apr 23, 2024

@llvm/pr-subscribers-libc

Author: David CARLIER (devnexen)

Changes

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

1 Files Affected:

  • (modified) libc/config/linux/syscall_numbers.h.inc (+4)
diff --git a/libc/config/linux/syscall_numbers.h.inc b/libc/config/linux/syscall_numbers.h.inc
index 9f910c5f9042a8..4a19d9a08875e8 100644
--- a/libc/config/linux/syscall_numbers.h.inc
+++ b/libc/config/linux/syscall_numbers.h.inc
@@ -338,6 +338,10 @@
 #define SYS_fchmodat __NR_fchmodat
 #endif
 
+#ifdef __NR_fchmodat2
+#define SYS_fchmodat2 __NR_fchmodat2
+#endif
+
 #ifdef __NR_fchown
 #define SYS_fchown __NR_fchown
 #endif

@devnexen devnexen marked this pull request as draft April 23, 2024 20:03
@devnexen devnexen force-pushed the libc_linux_sycall_fchmodat2 branch from 983b70e to eaa29ad Compare April 23, 2024 20:48
Copy link

github-actions bot commented Apr 23, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this patch overall looks fine, I'll approve once you mark it not a draft, but it would be good to add something in the commit message about why this is being added.

#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."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add fchmodat2 to this list

@devnexen devnexen force-pushed the libc_linux_sycall_fchmodat2 branch from eaa29ad to 5a9be67 Compare April 23, 2024 21:20
@devnexen devnexen marked this pull request as ready for review April 23, 2024 21:20
SYS_fchmodat2 syscall had been available since Linux 6.6, being more
flexible than SYS_fchmodat to support AT_SYMLINK_NOFOLLOW.
@devnexen devnexen force-pushed the libc_linux_sycall_fchmodat2 branch from 5a9be67 to ad5461d Compare April 23, 2024 21:33
Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, feel free to ping me to merge if you don't have access.

@devnexen
Copy link
Member Author

No worries I m. member ;) thx for the review

@devnexen devnexen merged commit 4182120 into llvm:main Apr 23, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants