diff options
author | Zachary Turner <zturner@google.com> | 2017-03-21 05:47:57 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-03-21 05:47:57 +0000 |
commit | 07db3f7e3f268c01e66e87608968c5cb71e35f82 (patch) | |
tree | 77190cb10ea2358a0c94a8289919bb779d11c6f8 /lldb/source/Host/posix/FileSystem.cpp | |
parent | 9b7bbeca48b10a0eb81708650777703ce41e67d7 (diff) | |
download | bcm5719-llvm-07db3f7e3f268c01e66e87608968c5cb71e35f82.tar.gz bcm5719-llvm-07db3f7e3f268c01e66e87608968c5cb71e35f82.zip |
Resubmit r298334 after fixing OSX build errors.
Hopefully this works, I can't test since I don't have Mac
hardware, however.
llvm-svn: 298340
Diffstat (limited to 'lldb/source/Host/posix/FileSystem.cpp')
-rw-r--r-- | lldb/source/Host/posix/FileSystem.cpp | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/lldb/source/Host/posix/FileSystem.cpp b/lldb/source/Host/posix/FileSystem.cpp index 4c21fcd34a0..22f337fcfec 100644 --- a/lldb/source/Host/posix/FileSystem.cpp +++ b/lldb/source/Host/posix/FileSystem.cpp @@ -36,33 +36,6 @@ using namespace lldb_private; const char *FileSystem::DEV_NULL = "/dev/null"; -FileSpec::PathSyntax FileSystem::GetNativePathSyntax() { - return FileSpec::ePathSyntaxPosix; -} - -lldb::user_id_t FileSystem::GetFileSize(const FileSpec &file_spec) { - return file_spec.GetByteSize(); -} - -bool FileSystem::GetFileExists(const FileSpec &file_spec) { - return file_spec.Exists(); -} - -Error FileSystem::Hardlink(const FileSpec &src, const FileSpec &dst) { - Error error; - if (::link(dst.GetCString(), src.GetCString()) == -1) - error.SetErrorToErrno(); - return error; -} - -int FileSystem::GetHardlinkCount(const FileSpec &file_spec) { - struct stat file_stat; - if (::stat(file_spec.GetCString(), &file_stat) == 0) - return file_stat.st_nlink; - - return -1; -} - Error FileSystem::Symlink(const FileSpec &src, const FileSpec &dst) { Error error; if (::symlink(dst.GetCString(), src.GetCString()) == -1) @@ -70,13 +43,6 @@ Error FileSystem::Symlink(const FileSpec &src, const FileSpec &dst) { return error; } -Error FileSystem::Unlink(const FileSpec &file_spec) { - Error error; - if (::unlink(file_spec.GetCString()) == -1) - error.SetErrorToErrno(); - return error; -} - Error FileSystem::Readlink(const FileSpec &src, FileSpec &dst) { Error error; char buf[PATH_MAX]; @@ -108,50 +74,6 @@ Error FileSystem::ResolveSymbolicLink(const FileSpec &src, FileSpec &dst) { return Error(); } -#if defined(__NetBSD__) -static bool IsLocal(const struct statvfs &info) { - return (info.f_flag & MNT_LOCAL) != 0; -} -#else -static bool IsLocal(const struct statfs &info) { -#ifdef __linux__ -#define CIFS_MAGIC_NUMBER 0xFF534D42 - switch ((uint32_t)info.f_type) { - case NFS_SUPER_MAGIC: - case SMB_SUPER_MAGIC: - case CIFS_MAGIC_NUMBER: - return false; - default: - return true; - } -#else - return (info.f_flags & MNT_LOCAL) != 0; -#endif -} -#endif - -#if defined(__NetBSD__) -bool FileSystem::IsLocal(const FileSpec &spec) { - struct statvfs statfs_info; - std::string path(spec.GetPath()); - if (statvfs(path.c_str(), &statfs_info) == 0) - return ::IsLocal(statfs_info); - return false; -} -#else -bool FileSystem::IsLocal(const FileSpec &spec) { - struct statfs statfs_info; - std::string path(spec.GetPath()); - if (statfs(path.c_str(), &statfs_info) == 0) - return ::IsLocal(statfs_info); - return false; -} -#endif - FILE *FileSystem::Fopen(const char *path, const char *mode) { return ::fopen(path, mode); } - -int FileSystem::Stat(const char *path, struct stat *stats) { - return ::stat(path, stats); -} |