Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions capio/posix/handlers/stat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ int fstat_handler(long arg0, long arg1, long arg2, long arg3, long arg4, long ar

int fstatat_handler(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5,
long *result) {
if (arg1 == NULL || arg2 == NULL) {
return CAPIO_POSIX_SYSCALL_SKIP;
}
auto dirfd = static_cast<int>(arg0);
const std::string_view pathname(reinterpret_cast<const char *>(arg1));
auto *statbuf = reinterpret_cast<struct stat *>(arg2);
Expand All @@ -160,6 +163,9 @@ int fstatat_handler(long arg0, long arg1, long arg2, long arg3, long arg4, long
}

int lstat_handler(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long *result) {
if (arg0 == NULL) {
return CAPIO_POSIX_SYSCALL_SKIP;
}
const std::string_view pathname(reinterpret_cast<const char *>(arg0));
auto *buf = reinterpret_cast<struct stat *>(arg1);
long tid = syscall_no_intercept(SYS_gettid);
Expand All @@ -168,6 +174,9 @@ int lstat_handler(long arg0, long arg1, long arg2, long arg3, long arg4, long ar
}

int stat_handler(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long *result) {
if (arg0 == NULL) {
return CAPIO_POSIX_SYSCALL_SKIP;
}
const std::string_view pathname(reinterpret_cast<const char *>(arg0));
auto *buf = reinterpret_cast<struct stat *>(arg1);
long tid = syscall_no_intercept(SYS_gettid);
Expand Down
4 changes: 4 additions & 0 deletions capio/posix/handlers/statx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ inline int capio_statx(int dirfd, const std::string_view &pathname, int flags, i
}

int statx_handler(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long *result) {
if (arg1 == NULL) {
return CAPIO_POSIX_SYSCALL_SKIP;
}

auto dirfd = static_cast<int>(arg0);
const std::string_view pathname(reinterpret_cast<const char *>(arg1));
auto flags = static_cast<int>(arg2);
Expand Down