예제 #1
0
파일: File.cpp 프로젝트: ccoffing/OcherBook
uint64_t File::seek(int64_t offset, int whence)
{
    if (!m_fd) {
        throw IOException("seek", EINVAL);
    }
    int r = clc_seek(m_fd, offset, whence);
    if (r == -1)
        throw IOException("seek", errno);
    return clc_tell(m_fd);
}
예제 #2
0
uint64_t File::seek(int64_t offset, SeekMethod how)
{
    if (!m_fd) {
        throw IOException("seek", EINVAL);
    }
    int r = clc_seek(m_fd, offset, (int)how);
    if (r == -1)
        throw IOException("seek", errno);
    return clc_tell(m_fd);
}