2
* See the file LICENSE for redistribution information.
4
* Copyright (c) 1997-2002
5
* Sleepycat Software. All rights reserved.
11
static const char revid[] = "$Id$";
14
#ifndef NO_SYSTEM_INCLUDES
15
#include <sys/types.h>
26
* Seek to a page/byte offset in the file.
28
* PUBLIC: int __os_seek __P((DB_ENV *,
29
* PUBLIC: DB_FH *, size_t, db_pgno_t, u_int32_t, int, DB_OS_SEEK));
32
__os_seek(dbenv, fhp, pgsize, pageno, relative, isrewind, db_whence)
58
if (DB_GLOBAL(j_seek) != NULL)
59
ret = DB_GLOBAL(j_seek)(fhp->fd,
60
pgsize, pageno, relative, isrewind, whence);
62
offset = (off_t)pgsize * pageno + relative;
66
ret = lseek(fhp->fd, offset, whence) == -1 ?
68
} while (ret == EINTR);
74
fhp->offset = relative;
76
__db_err(dbenv, "seek: %lu %d %d: %s",
77
(u_long)pgsize * pageno + relative,
78
isrewind, db_whence, strerror(ret));