9#ifndef LLVM_LIB_CAS_ONDISKCOMMON_H
10#define LLVM_LIB_CAS_ONDISKCOMMON_H
32 int FD, std::chrono::milliseconds
Timeout = std::chrono::milliseconds(0),
Tagged union holding either a T or a Error.
std::error_code lockFileThreadSafe(int FD, llvm::sys::fs::LockKind Kind)
Thread-safe alternative to sys::fs::lockFile.
std::error_code unlockFileThreadSafe(int FD)
Thread-safe alternative to sys::fs::unlockFile.
std::error_code tryLockFileThreadSafe(int FD, std::chrono::milliseconds Timeout=std::chrono::milliseconds(0), llvm::sys::fs::LockKind Kind=llvm::sys::fs::LockKind::Exclusive)
Thread-safe alternative to sys::fs::tryLockFile.
Expected< size_t > preallocateFileTail(int FD, size_t CurrentSize, size_t NewSize)
Allocate space for the file FD on disk, if the filesystem supports it.
LockKind
An enumeration for the lock kind.
@ Timeout
Reached timeout while waiting for the owner to release the lock.