mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Improve mount waiting + misc doc improvements
Adds user.mergerfs.branch and user.mergerfs.branch_mounts_here Adds .mergerfs.branch and .mergerfs.branch_mounts_here files.
This commit is contained in:
parent
212681ddc5
commit
de2a82800a
26 changed files with 583 additions and 212 deletions
37
src/fs_mounts.cpp
Normal file
37
src/fs_mounts.cpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#include "fs_mounts.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include <mntent.h>
|
||||
|
||||
#ifdef __linux__
|
||||
void
|
||||
fs::mounts(fs::MountVec &mounts_)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
f = setmntent("/proc/mounts","r");
|
||||
if(f == NULL)
|
||||
return;
|
||||
|
||||
struct mntent *entry;
|
||||
while((entry = getmntent(f)) != NULL)
|
||||
{
|
||||
fs::Mount m;
|
||||
|
||||
m.dir = entry->mnt_dir;
|
||||
m.fsname = entry->mnt_fsname;
|
||||
m.type = entry->mnt_type;
|
||||
m.opts = entry->mnt_opts;
|
||||
|
||||
mounts_.emplace_back(std::move(m));
|
||||
}
|
||||
|
||||
endmntent(f);
|
||||
}
|
||||
#else
|
||||
void
|
||||
fs::mounts(fs::MountVec &mounts_)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue