/* this function is a POSIX compliant version, which will seek the offset for an open file descriptor. */
off_t lseek(int fd, off_t offset, int whence)
/* this function is a POSIX compliant version, which will seek the offset for an open file descriptor. */
off_t lseek(int fd, off_t offset, int whence)
{
    off_t result;
    struct dfs_file *file;
    file = fd_get(fd);
    if (file == NULL)
    {
        rt_set_errno(-EBADF);
        return -1;
    }
    result = dfs_file_lseek(file, offset, whence);
    if (result < 0)
    {
        rt_set_errno(result);
        return -1;
    }
    return result;
}