summaryrefslogtreecommitdiffhomepage
path: root/test/util/mount_util.h
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2021-04-26 16:25:26 -0700
committergVisor bot <gvisor-bot@google.com>2021-04-26 16:27:45 -0700
commit36fdc6c9ef565be34f5ab27affed31eb2430e89a (patch)
treeb7f7abab391f1c9664b5a14ed6f786560d2afc49 /test/util/mount_util.h
parent5b7b7daa425ffc93e98c12cbd37ea7b15a8bcc8d (diff)
Handle tmpfs with 5 fields in /proc/mounts parsing.
PiperOrigin-RevId: 370565903
Diffstat (limited to 'test/util/mount_util.h')
-rw-r--r--test/util/mount_util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/util/mount_util.h b/test/util/mount_util.h
index b75a490fb..3f8a1c0f1 100644
--- a/test/util/mount_util.h
+++ b/test/util/mount_util.h
@@ -58,6 +58,11 @@ struct ProcMountsEntry {
// ProcSelfMountsEntries returns a parsed representation of /proc/self/mounts.
PosixErrorOr<std::vector<ProcMountsEntry>> ProcSelfMountsEntries();
+// ProcSelfMountsEntries returns a parsed representation of mounts from the
+// provided content.
+PosixErrorOr<std::vector<ProcMountsEntry>> ProcSelfMountsEntriesFrom(
+ const std::string& content);
+
struct ProcMountInfoEntry {
uint64_t id;
uint64_t parent_id;
@@ -76,6 +81,11 @@ struct ProcMountInfoEntry {
// /proc/self/mountinfo.
PosixErrorOr<std::vector<ProcMountInfoEntry>> ProcSelfMountInfoEntries();
+// ProcSelfMountInfoEntriesFrom returns a parsed representation of
+// mountinfo from the provided content.
+PosixErrorOr<std::vector<ProcMountInfoEntry>> ProcSelfMountInfoEntriesFrom(
+ const std::string&);
+
// Interprets the input string mopts as a comma separated list of mount
// options. A mount option can either be just a value, or a key=value pair. For
// example, the string "rw,relatime,fd=7" will be parsed into a map like { "rw":