mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Add a GetUniqueID that will replace the uniqueID of PathV1.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184217 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -350,6 +350,18 @@ error_code file_size(const Twine &path, uint64_t &result) {
|
||||
return error_code::success();
|
||||
}
|
||||
|
||||
error_code GetUniqueID(const Twine Path, uint64_t &Result) {
|
||||
SmallString<128> Storage;
|
||||
StringRef P = Path.toNullTerminatedStringRef(Storage);
|
||||
|
||||
struct stat Status;
|
||||
if (::stat(P.begin(), &Status) != 0)
|
||||
return error_code(errno, system_category());
|
||||
|
||||
Result = Status.st_ino;
|
||||
return error_code::success();
|
||||
}
|
||||
|
||||
error_code status(const Twine &path, file_status &result) {
|
||||
SmallString<128> path_storage;
|
||||
StringRef p = path.toNullTerminatedStringRef(path_storage);
|
||||
|
Reference in New Issue
Block a user