Berkeley DB Reference Version 5.3.33

DB_LOGC->get()

#include <db.h>

int
DB_LOGC->get(DB_LOGC *logc, DB_LSN *lsn, DBT *data, u_int32_t flags);  

The DB_LOGC->get() method returns records from the log.

Unless otherwise specified, the DB_LOGC->get() method returns a non-zero error value on failure and 0 on success.

Parameters

lsn

When the flag parameter is set to DB_CURRENT, DB_FIRST, DB_LAST, DB_NEXT or DB_PREV, the lsn parameter is overwritten with the DB_LSN value of the record retrieved. When flag is set to DB_SET, the lsn parameter is the DB_LSN value of the record to be retrieved.

data

The data field of the data structure is set to the record retrieved, and the size field indicates the number of bytes in the record. See DBT for a description of other fields in the data structure. The DB_DBT_MALLOC, DB_DBT_REALLOC and DB_DBT_USERMEM flags may be specified for any DBT used for data retrieval.

flags

The flags parameter must be set to one of the following values:

Errors

The DB_LOGC->get() method may fail and return one of the following non-zero errors:

EINVAL

If the DB_CURRENT flag was set and the log cursor has not yet been initialized; the DB_CURRENT, DB_NEXT, or DB_PREV flags were set and the log was opened with the DB_THREAD flag set; the DB_SET flag was set and the specified log sequence number does not appear in the log; or if an invalid flag value or parameter was specified.

Class

DB_ENV, DB_LOGC, DB_LSN

See Also

Logging Subsystem and Related Methods