mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
LibCore: Add CIODevice::seek().
This commit is contained in:
parent
1debc0a78c
commit
b5759089d8
2 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue