1N/A * See the file LICENSE for redistribution information. 1N/A * Copyright (c) 1996, 1997, 1998 1N/A * Sleepycat Software. All rights reserved. 1N/A#
endif /* not lint */ 1N/A /* Validate arguments. */ 1N/A * If we get one of the log's header records, repeat the operation. 1N/A * This assumes that applications don't ever request the log header 1N/A * records by LSN, but that seems reasonable to me. 1N/A * Get a log record; internal version. 1N/A * PUBLIC: int __log_get __P((DB_LOG *, DB_LSN *, DBT *, u_int32_t, int)); 1N/A "log_get: unable to find checkpoint record: no checkpoint set.");
1N/A /* Increment the cursor by the cursor record size. */ 1N/A /* Find the first log file. */ 1N/A * We may have only entered records in the buffer, and not 1N/A * yet written a log file. If no log files were found and 1N/A * there's anything in the buffer, it belongs to file 1. 1N/A /* If at start-of-file, move to the previous file. */ 1N/A /* Return 1 if the request is past end-of-file. */ 1N/A /* If we've switched files, discard the current fd. */ 1N/A /* If the entire record is in the in-memory buffer, copy it out. */ 1N/A /* Copy the header. */ 1N/A /* Copy the record. */ 1N/A /* Acquire a file descriptor. */ 1N/A /* Seek to the header offset and read the header. */ 1N/A /* If read returns EOF, try the next file. */ 1N/A /* Move to the next file. */ 1N/A * If read returns a short count the rest of the record has 1N/A * to be in the in-memory buffer. 1N/A /* Get the rest of the header from the in-memory buffer. */ 1N/A * Check for buffers of 0's, that's what we usually see during 1N/A * recovery, although it's certainly not something on which we 1N/A /* If we've already moved to the in-memory buffer, fill from there. */ 1N/A * Allocate temporary memory to hold the record. 1N/A * We're calling malloc(3) with a region locked. This isn't 1N/A * Read the record into the buffer. If read returns a short count, 1N/A * there was an error or the rest of the record is in the in-memory 1N/A * buffer. Note, the information may be garbage if we're in recovery, 1N/A * so don't read past the end of the buffer's memory. 1N/A /* Get the rest of the record from the in-memory buffer. */ 1N/A /* Copy the record into the user's DBT. */ 1N/A /* Update the cursor and the return lsn. */ 1N/A * This is the catchall -- for some reason we didn't find enough 1N/A * information or it wasn't reasonable information, and it wasn't 1N/A * because a system call failed.