2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1997, 1998
5 * Sleepycat Software. All rights reserved.
11 static const char sccsid
[] = "@(#)os_seek.c 10.9 (Sleepycat) 4/19/98";
14 #ifndef NO_SYSTEM_INCLUDES
15 #include <sys/types.h>
25 * Seek to a page/byte offset in the file.
27 * PUBLIC: int __os_seek __P((int, size_t, db_pgno_t, u_int32_t, int, int));
30 __os_seek(fd
, pgsize
, pageno
, relative
, isrewind
, whence
)
39 offset
= (off_t
)pgsize
* pageno
+ relative
;
43 return (lseek(fd
, offset
, whence
) == -1 ? errno
: 0);