Skip to content

Commit

Permalink
Support fchmodat2
Browse files Browse the repository at this point in the history
Resolves #3772
  • Loading branch information
rocallahan committed Jun 29, 2024
1 parent a97d660 commit a2b50f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/syscalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ def __init__(self, **kwargs):
futex_waitv = UnsupportedSyscall(all=449)
set_mempolicy_home_node = UnsupportedSyscall(all=450)
cachestat = UnsupportedSyscall(all=451)
fchmodat2 = UnsupportedSyscall(all=452)
fchmodat2 = EmulatedSyscall(all=452)
map_shadow_stack = UnsupportedSyscall(all=453)
futex_wake = UnsupportedSyscall(all=454)
futex_wait = UnsupportedSyscall(all=455)
Expand Down
7 changes: 3 additions & 4 deletions src/test/chmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ int main(void) {
test_assert(0 == access(file_path, R_OK));
test_assert(0 == fchmod(fd, 0200));
test_assert(0 == access(file_path, W_OK));
test_assert(0 == fchmodat(AT_FDCWD, file_path, 0400, 0));
test_assert(0 == syscall(RR_fchmodat, AT_FDCWD, file_path, 0400));
test_assert(0 == syscall(RR_fchmodat2, AT_FDCWD, file_path, 0400, 0 || errno == ENOSYS));
test_assert(0 == access(file_path, R_OK));
test_assert(0 == faccessat(AT_FDCWD, file_path, R_OK, AT_SYMLINK_NOFOLLOW) || errno == ENOSYS);
#ifdef SYS_faccessat2
test_assert(0 == syscall(SYS_faccessat2, AT_FDCWD, file_path, R_OK, AT_SYMLINK_NOFOLLOW) || errno == ENOSYS);
#endif
test_assert(0 == syscall(RR_faccessat2, AT_FDCWD, file_path, R_OK, AT_SYMLINK_NOFOLLOW) || errno == ENOSYS);

atomic_puts("EXIT-SUCCESS");
return 0;
Expand Down

0 comments on commit a2b50f4

Please sign in to comment.