/// tell - Return the current offset with the file.
uint64_t tell() {
return pos + (OutBufCur - OutBufStart);
- }
+ }
+
+ /// seek - Flushes the stream and repositions the underlying file descriptor
+ /// positition to the offset specified from the beginning of the file.
+ uint64_t seek(uint64_t off);
};
/// raw_stdout_ostream - This is a stream that always prints to stdout.
FD = -1;
}
+uint64_t raw_fd_ostream::seek(uint64_t off) {
+ flush();
+ pos = lseek(FD, off, SEEK_SET);
+ return pos;
+}
+
//===----------------------------------------------------------------------===//
// raw_stdout/err_ostream
//===----------------------------------------------------------------------===//