-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Conversation
@llvm/pr-subscribers-libc Author: David CARLIER (devnexen) ChangesFull diff: https://github.com/llvm/llvm-project/pull/89819.diff 1 Files Affected:
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
|
983b70e
to
eaa29ad
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this 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.
libc/src/sys/stat/linux/chmod.cpp
Outdated
#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." |
There was a problem hiding this comment.
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
eaa29ad
to
5a9be67
Compare
SYS_fchmodat2 syscall had been available since Linux 6.6, being more flexible than SYS_fchmodat to support AT_SYMLINK_NOFOLLOW.
5a9be67
to
ad5461d
Compare
There was a problem hiding this 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.
No worries I m. member ;) thx for the review |
No description provided.