Use mountinfo for revert unmount

This commit is contained in:
LoveSy
2022-12-27 02:01:45 +08:00
committed by John Wu
parent b249832571
commit 79a85f5937
3 changed files with 109 additions and 20 deletions

View File

@@ -39,6 +39,23 @@ protected:
void swap(byte_data &o);
};
struct mount_info {
unsigned int id;
unsigned int parent;
dev_t device;
std::string root;
std::string target;
std::string vfs_option;
struct {
unsigned int shared;
unsigned int master;
unsigned int propagate_from;
} optional;
std::string type;
std::string source;
std::string fs_option;
};
struct mmap_data : public byte_data {
mmap_data() = default;
mmap_data(const mmap_data&) = delete;
@@ -88,6 +105,7 @@ void parse_prop_file(const char *file,
const std::function<bool(std::string_view, std::string_view)> &fn);
void frm_rf(int dirfd);
void clone_dir(int src, int dest);
std::vector<mount_info> parse_mount_info(const char *pid);
void parse_mnt(const char *file, const std::function<bool(mntent*)> &fn);
std::string find_apk_path(const char *pkg);