summaryrefslogtreecommitdiffhomepage
path: root/test/util/fs_util.h
diff options
context:
space:
mode:
authorHaibo Xu <haibo.xu@arm.com>2020-01-22 06:22:18 +0000
committerHaibo Xu <haibo.xu@arm.com>2020-01-23 01:04:02 +0000
commit49e84b10e5ed7f94e6cbe003b9f7268e8235bb08 (patch)
tree29c5d6c8ad9c413a7d24c97ad0ff12bd2e7ce696 /test/util/fs_util.h
parentb3405a719cbb33dac2deced192209a5584e5e3d6 (diff)
Unify the kOLargeFile definition in syscall tests.
Signed-off-by: Haibo Xu <haibo.xu@arm.com> Change-Id: Id9d6ae98305a4057d55d622ea4c3ac2228fea212
Diffstat (limited to 'test/util/fs_util.h')
-rw-r--r--test/util/fs_util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/util/fs_util.h b/test/util/fs_util.h
index ee1b341d7..caf19b24d 100644
--- a/test/util/fs_util.h
+++ b/test/util/fs_util.h
@@ -26,6 +26,17 @@
namespace gvisor {
namespace testing {
+
+// O_LARGEFILE as defined by Linux. glibc tries to be clever by setting it to 0
+// because "it isn't needed", even though Linux can return it via F_GETFL.
+#if defined(__x86_64__)
+constexpr int kOLargeFile = 00100000;
+#elif defined(__aarch64__)
+constexpr int kOLargeFile = 00400000;
+#else
+#error "Unknown architecture"
+#endif
+
// Returns a status or the current working directory.
PosixErrorOr<std::string> GetCWD();