aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-11-05 23:14:42 -0400
committerMike Frysinger <vapier@gentoo.org>2021-11-05 23:14:42 -0400
commit632cc66ba52eb6aa7fd3e457c64d9186389a20b4 (patch)
treef8ce207063dd445841183f1d0d832c92f41b3c6d /tests
parentbuild: require at least a C99 compiler (diff)
downloadsandbox-632cc66ba52eb6aa7fd3e457c64d9186389a20b4.tar.gz
sandbox-632cc66ba52eb6aa7fd3e457c64d9186389a20b4.tar.bz2
sandbox-632cc66ba52eb6aa7fd3e457c64d9186389a20b4.zip
change FS calls to use 64-bit interfaces explicitly
Make sure we use 64-bit FS interfaces when accessing the FS. This is needed not only to stat or open large files, but even files with 64-bit inodes. Bug: https://bugs.gentoo.org/583282 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/get-group.c4
-rw-r--r--tests/get-user.c4
-rw-r--r--tests/test-skel-0.c2
-rw-r--r--tests/trace-memory_static_tst.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/tests/get-group.c b/tests/get-group.c
index 8138967..30cdfc9 100644
--- a/tests/get-group.c
+++ b/tests/get-group.c
@@ -31,8 +31,8 @@ int main(int argc, char *argv[])
printf("%i\n", grp->gr_gid);
} else {
const char *file = argv[1];
- struct stat st;
- if (lstat(file, &st))
+ struct stat64 st;
+ if (lstat64(file, &st))
errp("lstat(%s) failed", file);
printf("%i\n", st.st_gid);
}
diff --git a/tests/get-user.c b/tests/get-user.c
index f85e299..be448d7 100644
--- a/tests/get-user.c
+++ b/tests/get-user.c
@@ -31,8 +31,8 @@ int main(int argc, char *argv[])
printf("%i\n", pwd->pw_uid);
} else {
const char *file = argv[1];
- struct stat st;
- if (lstat(file, &st))
+ struct stat64 st;
+ if (lstat64(file, &st))
errp("lstat(%s) failed", file);
printf("%i\n", st.st_uid);
}
diff --git a/tests/test-skel-0.c b/tests/test-skel-0.c
index de88cf4..91128d3 100644
--- a/tests/test-skel-0.c
+++ b/tests/test-skel-0.c
@@ -128,7 +128,7 @@ int at_get_fd(const char *str_dirfd)
}
str_mode = strtok(NULL, ":");
- return open(str_path, f_get_flags(str_flags), sscanf_mode_t(str_mode));
+ return open64(str_path, f_get_flags(str_flags), sscanf_mode_t(str_mode));
}
#define V_TIMESPEC "NULL | NOW | #[,#]"
diff --git a/tests/trace-memory_static_tst.c b/tests/trace-memory_static_tst.c
index 14c6477..86a47fe 100644
--- a/tests/trace-memory_static_tst.c
+++ b/tests/trace-memory_static_tst.c
@@ -26,7 +26,7 @@ volatile uintptr_t offset = 0;
#define check_ptr(addr) \
({ \
printf(" open(%p)\n", addr); \
- ret = open(non_const_ptr(addr), O_RDONLY); \
+ ret = open64(non_const_ptr(addr), O_RDONLY); \
assert(ret == -1 && errno == EFAULT); \
})
@@ -53,7 +53,7 @@ int main(int argc, char *argv[])
printf(" open(%p -> %p [+%#zx])\n", p, p + len, len);
memset(p, 'a', len);
path[end] = '\0';
- ret = open(p, O_RDONLY);
+ ret = open64(p, O_RDONLY);
assert(ret == -1 && (errno == ENOENT || errno == ENAMETOOLONG));
}
}