From 077e95da852189601fcc156fda9ec8f4a64887cb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 24 Mar 2015 21:58:36 +0100 Subject: system/FileDescriptor: add method Tell() --- src/system/FileDescriptor.hxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/system') diff --git a/src/system/FileDescriptor.hxx b/src/system/FileDescriptor.hxx index c366f3cc0..75a76844c 100644 --- a/src/system/FileDescriptor.hxx +++ b/src/system/FileDescriptor.hxx @@ -146,6 +146,11 @@ public: return lseek(Get(), offset, SEEK_SET); } + gcc_pure + off_t Tell() const { + return lseek(Get(), 0, SEEK_CUR); + } + /** * Returns the size of the file in bytes, or -1 on error. */ -- cgit v1.2.3