aboutsummaryrefslogtreecommitdiff
path: root/src/posix_extras.cc
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2016-02-21 22:44:47 -0500
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2016-02-21 22:48:53 -0500
commitb5c9c8540a29babf990ff72b1eb5904424f1abb0 (patch)
tree423e7f183a75a453134d302f9a7f0ff1121f5cbb /src/posix_extras.cc
parent604841c6c81608a7dfcfe05ab75fa0c7ede2a890 (diff)
Implement ftruncate
Diffstat (limited to 'src/posix_extras.cc')
-rw-r--r--src/posix_extras.cc2
1 files changed, 2 insertions, 0 deletions
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));