diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Support/raw_ostream.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index a8e6c782bc..b10677e3f2 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -253,6 +253,14 @@ void raw_fd_ostream::close() { FD = -1; } +uint64_t raw_fd_ostream::tell() { + // We have to take into account the bytes waiting in the buffer. For now + // we do the easy thing and just flush the buffer before getting the + // current file offset. + flush(); + return (uint64_t) lseek(FD, 0, SEEK_CUR); +} + //===----------------------------------------------------------------------===// // raw_stdout/err_ostream //===----------------------------------------------------------------------===// |