diff options
Diffstat (limited to 'lldb/source/Host/posix/FileSystem.cpp')
-rw-r--r-- | lldb/source/Host/posix/FileSystem.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/source/Host/posix/FileSystem.cpp b/lldb/source/Host/posix/FileSystem.cpp index b55b01b4..b8a4557 100644 --- a/lldb/source/Host/posix/FileSystem.cpp +++ b/lldb/source/Host/posix/FileSystem.cpp @@ -10,6 +10,8 @@ #include "lldb/Host/FileSystem.h" // C includes +#include <sys/mount.h> +#include <sys/param.h> #include <sys/stat.h> #include <sys/types.h> @@ -172,3 +174,13 @@ FileSystem::Readlink(const char *path, char *buf, size_t buf_len) error.SetErrorString("'buf' buffer is too small to contain link contents"); return error; } + +bool +FileSystem::IsLocal(const FileSpec &spec) +{ + struct statfs statfs_info; + std::string path (spec.GetPath()); + if (statfs(path.c_str(), &statfs_info) == 0) + return (statfs_info.f_flags & MNT_LOCAL) != 0; + return false; +} |