From b5c9c8540a29babf990ff72b1eb5904424f1abb0 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sun, 21 Feb 2016 22:44:47 -0500 Subject: Implement ftruncate --- src/posix_extras.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/posix_extras.cc') diff --git a/src/posix_extras.cc b/src/posix_extras.cc index 11db247..c0a5234 100644 --- a/src/posix_extras.cc +++ b/src/posix_extras.cc @@ -154,6 +154,8 @@ void File::SymLinkAt(const char* const target, const char* const source) const { CheckSyscall(symlinkat(target, fd_, source)); } +void File::Truncate(const off_t size) { CheckSyscall(ftruncate(fd_, size)); } + void File::UnlinkAt(const char* const path) const { ValidatePath(path); CheckSyscall(unlinkat(fd_, path, 0)); -- cgit v1.2.3