xref: /illumos-gate/usr/src/cmd/sendmail/db/include/os.h (revision 2a8bcb4e)
1*7c478bd9Sstevel@tonic-gate /*-
2*7c478bd9Sstevel@tonic-gate  * See the file LICENSE for redistribution information.
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1997, 1998
5*7c478bd9Sstevel@tonic-gate  *	Sleepycat Software.  All rights reserved.
6*7c478bd9Sstevel@tonic-gate  *
7*7c478bd9Sstevel@tonic-gate  *	@(#)os.h	10.11 (Sleepycat) 10/12/98
8*7c478bd9Sstevel@tonic-gate  */
9*7c478bd9Sstevel@tonic-gate 
10*7c478bd9Sstevel@tonic-gate /*
11*7c478bd9Sstevel@tonic-gate  * We group seek/write calls into a single function so that we can use
12*7c478bd9Sstevel@tonic-gate  * pread(2)/pwrite(2) where they're available.
13*7c478bd9Sstevel@tonic-gate  */
14*7c478bd9Sstevel@tonic-gate #define	DB_IO_READ	1
15*7c478bd9Sstevel@tonic-gate #define	DB_IO_WRITE	2
16*7c478bd9Sstevel@tonic-gate typedef struct __io {
17*7c478bd9Sstevel@tonic-gate 	int	    fd_io;		/* I/O file descriptor. */
18*7c478bd9Sstevel@tonic-gate 	int	    fd_lock;		/* Locking file descriptor. */
19*7c478bd9Sstevel@tonic-gate 	db_mutex_t *mutexp;		/* Mutex to lock. */
20*7c478bd9Sstevel@tonic-gate 	size_t	    pagesize;		/* Page size. */
21*7c478bd9Sstevel@tonic-gate 	db_pgno_t   pgno;		/* Page number. */
22*7c478bd9Sstevel@tonic-gate 	u_int8_t   *buf;		/* Buffer. */
23*7c478bd9Sstevel@tonic-gate 	size_t	    bytes;		/* Bytes read/written. */
24*7c478bd9Sstevel@tonic-gate } DB_IO;
25