diff --git a/LibCore/CIODevice.cpp b/LibCore/CIODevice.cpp index 80ac9ef18e..a85efc6b73 100644 --- a/LibCore/CIODevice.cpp +++ b/LibCore/CIODevice.cpp @@ -173,3 +173,14 @@ bool CIODevice::close() set_mode(CIODevice::NotOpen); return true; } + +bool CIODevice::seek(signed_qword offset) +{ + int rc = lseek(m_fd, offset, SEEK_SET); + if (rc < 0) { + perror("CIODevice::seek: lseek"); + return false; + } + m_buffered_data.clear(); + return true; +} diff --git a/LibCore/CIODevice.h b/LibCore/CIODevice.h index 931fcb2ce5..7a8b354b2e 100644 --- a/LibCore/CIODevice.h +++ b/LibCore/CIODevice.h @@ -35,6 +35,8 @@ public: bool can_read() const; + bool seek(signed_qword); + virtual bool open(CIODevice::OpenMode) = 0; virtual bool close();