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 #pragma ident "%Z%%M% %I% %E% SMI" 11*7c478bd9Sstevel@tonic-gate 12*7c478bd9Sstevel@tonic-gate /* 13*7c478bd9Sstevel@tonic-gate * We group seek/write calls into a single function so that we can use 14*7c478bd9Sstevel@tonic-gate * pread(2)/pwrite(2) where they're available. 15*7c478bd9Sstevel@tonic-gate */ 16*7c478bd9Sstevel@tonic-gate #define DB_IO_READ 1 17*7c478bd9Sstevel@tonic-gate #define DB_IO_WRITE 2 18*7c478bd9Sstevel@tonic-gate typedef struct __io { 19*7c478bd9Sstevel@tonic-gate int fd_io; /* I/O file descriptor. */ 20*7c478bd9Sstevel@tonic-gate int fd_lock; /* Locking file descriptor. */ 21*7c478bd9Sstevel@tonic-gate db_mutex_t *mutexp; /* Mutex to lock. */ 22*7c478bd9Sstevel@tonic-gate size_t pagesize; /* Page size. */ 23*7c478bd9Sstevel@tonic-gate db_pgno_t pgno; /* Page number. */ 24*7c478bd9Sstevel@tonic-gate u_int8_t *buf; /* Buffer. */ 25*7c478bd9Sstevel@tonic-gate size_t bytes; /* Bytes read/written. */ 26*7c478bd9Sstevel@tonic-gate } DB_IO; 27