2 * See the file LICENSE for redistribution information.
5 * Sleepycat Software. All rights reserved.
11 static const char sccsid
[] = "@(#)db_os_lseek.c 10.3 (Sleepycat) 6/28/97";
14 #ifndef NO_SYSTEM_INCLUDES
15 #include <sys/types.h>
26 * Seek to a page/byte offset in the file.
28 * PUBLIC: int __db_lseek __P((int, size_t, db_pgno_t, u_long, int));
31 __db_lseek(fd
, pgsize
, pageno
, relative
, whence
)
38 /* 64-bit offsets are done differently by different vendors. */
42 offset_t offset
; /* Solaris. */
44 offset
= pgsize
* pageno
+ relative
;
45 return (llseek(fd
, offset
, whence
) == -1 ? errno
: 0);
49 __int64 offset
; /* WNT */
51 offset
= pgsize
* pageno
+ relative
;
52 return (_lseeki64(fd
, offset
, whence
) == -1 ? errno
: 0);
55 off_t offset
; /* Default. */
57 offset
= pgsize
* pageno
+ relative
;
58 return (lseek(fd
, offset
, whence
) == -1 ? errno
: 0);