19#if defined(__NetBSD__)
20#include <sys/statvfs.h>
28#include "llvm/Support/Errno.h"
29#include "llvm/Support/FileSystem.h"
46 ssize_t count = ::readlink(src.
GetPath().c_str(), buf,
sizeof(buf) - 1);
51 dst.
SetFile(buf, FileSpec::Style::native);
58 if (!src.
GetPath(resolved_path,
sizeof(resolved_path))) {
60 "Couldn't get the canonical path for %s", src.
GetPath().c_str());
64 if (realpath(resolved_path, real_path) ==
nullptr) {
74 return llvm::sys::RetryAfterSignal(
nullptr, ::fopen, path, mode);
80 auto lambda = [&]() { return ::open(path, flags, mode); };
81 return llvm::sys::RetryAfterSignal(-1, lambda);
static llvm::raw_ostream & error(Stream &strm)
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
static const char * DEV_NULL
Status Symlink(const FileSpec &src, const FileSpec &dst)
Status ResolveSymbolicLink(const FileSpec &src, FileSpec &dst)
int Open(const char *path, int flags, int mode=0600)
Wraps ::open in a platform-independent way.
Status Readlink(const FileSpec &src, FileSpec &dst)
FILE * Fopen(const char *path, const char *mode)
Wraps ::fopen in a platform-independent way.
static Status FromErrno()
Set the current error to errno.
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
A class that represents a running process on the host machine.