posix/fd: add lseek member function
This commit is contained in:
parent
4196702b38
commit
5a810010fe
11
posix/fd.cpp
11
posix/fd.cpp
@ -117,6 +117,17 @@ fd::write (const void *buffer, size_t count)
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
off_t
|
||||
fd::lseek (off_t offset, int whence)
|
||||
{
|
||||
auto res = ::lseek (m_fd, offset, whence);
|
||||
if (res == -1)
|
||||
errno_error::throw_code ();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
fd::operator int (void) const
|
||||
{
|
||||
|
@ -57,6 +57,9 @@ namespace util::posix {
|
||||
ssize_t read ( void *buf, size_t count);
|
||||
ssize_t write (const void *buf, size_t count);
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
off_t lseek (off_t offset, int whence);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
operator int (void) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user