From 9c27886dd5d504f2b03c6fcb57aba23e5e44c4fa Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 26 Jan 2009 21:42:04 +0000 Subject: Add method raw_fd_ostream::seek() for random access within a file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63044 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/raw_ostream.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index 96c9a3a..29665dc 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -255,6 +255,12 @@ void raw_fd_ostream::close() { FD = -1; } +uint64_t raw_fd_ostream::seek(uint64_t off) { + flush(); + pos = lseek(FD, off, SEEK_SET); + return pos; +} + //===----------------------------------------------------------------------===// // raw_stdout/err_ostream //===----------------------------------------------------------------------===// -- cgit v1.1