summaryrefslogtreecommitdiffhomepage
path: root/test/util/fs_util.h
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2020-08-26 10:03:46 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-26 10:05:34 -0700
commit83a8b309e949df4b8f82f26085cd62284f9eeb87 (patch)
tree0c4a80d1db58c46d15c8569359356d387e9db67a /test/util/fs_util.h
parentebf5293374bc94e01eb58ebe29a1e53aa404d3a7 (diff)
tmpfs: Allow xattrs in the trusted namespace if creds has CAP_SYS_ADMIN.
This is needed to support the overlay opaque attribute. PiperOrigin-RevId: 328552985
Diffstat (limited to 'test/util/fs_util.h')
-rw-r--r--test/util/fs_util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/util/fs_util.h b/test/util/fs_util.h
index 8cdac23a1..044190657 100644
--- a/test/util/fs_util.h
+++ b/test/util/fs_util.h
@@ -17,6 +17,7 @@
#include <dirent.h>
#include <sys/stat.h>
+#include <sys/statfs.h>
#include <sys/types.h>
#include <unistd.h>
@@ -178,6 +179,11 @@ std::string CleanPath(absl::string_view path);
// Returns the full path to the executable of the given pid or a PosixError.
PosixErrorOr<std::string> ProcessExePath(int pid);
+#ifndef __fuchsia__
+// IsTmpfs returns true if the file at path is backed by tmpfs.
+PosixErrorOr<bool> IsTmpfs(const std::string& path);
+#endif // __fucshia__
+
namespace internal {
// Not part of the public API.
std::string JoinPathImpl(std::initializer_list<absl::string_view> paths);