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

allow compile without FS_IOC_FSGETXATTR #3602

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions src/record_syscall.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2018,7 +2018,9 @@ static Switchable prepare_ioctl(RecordTask* t,
case IOCTL_MASK_SIZE(TIOCGPTLCK):
case IOCTL_MASK_SIZE(TIOCGEXCL):
case IOCTL_MASK_SIZE(USBDEVFS_GET_CAPABILITIES):
#ifdef FS_IOC_FSGETXATTR
case IOCTL_MASK_SIZE(FS_IOC_FSGETXATTR):
#endif
// FS_IOC_GETVERSION has the same number as VIDIOCGCAP (but different size)
// but the same treatment works for both.
case IOCTL_MASK_SIZE(FS_IOC_GETVERSION):
Expand Down
4 changes: 3 additions & 1 deletion src/test/ioctl_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ int main(void) {
int fd = open("dummy.txt", O_RDWR | O_CREAT, 0600);
long* version;
long* flags;
struct fsxattr* xattr;
char filebuf[4096] = {};
char fmbuf[4096] = {};
struct fiemap *fm;
Expand All @@ -34,6 +33,8 @@ int main(void) {
atomic_printf("flags=%lx\n", *flags);
}

#ifdef FS_IOC_FSGETXATTR
struct fsxattr* xattr;
ALLOCATE_GUARD(xattr, 'c');
ret = ioctl(fd, FS_IOC_FSGETXATTR, xattr);
VERIFY_GUARD(xattr);
Expand All @@ -42,6 +43,7 @@ int main(void) {
} else {
atomic_printf("xflags=%d\n", xattr->fsx_xflags);
}
#endif

test_assert(sizeof(filebuf) == write(fd, &filebuf, sizeof(filebuf)));
fm = (struct fiemap*)fmbuf;
Expand Down