1I(Berkeley DB: log_register[P

log_register





#include <db.h>

int)log_register(DB_LOG *logp, const DB *dbp,4 const char *name, DBTYPE type, u_int32_t *fidp);





Description



HThe log_register function registers a file name with the log manager and

DThis file identification number should be used in all subsequent logGmessages that refer to operations on the file. The log manager recordsGall file name to file identification number mappings at each checkpointIso that a recovery process can identify the file to which a record in the log refers.

GThe log_register function is called when an access method registers the5open of a file. The dbp parameter should be apointer to the DB structurepointer to the DBobject DB object-which is being returned by the access method.

AThe type parameter should be one of the types of databasesKspecified in db_open, e.g., DB_HASH.

The log_registerHfunction returns the value of errno on failure, and 0 on success.



Errors

UIf a fatal error occurs in Berkeley DB, the log_register function may fail and returnFDB_RUNRECOVERY, at which point all subsequent database calls will alsoreturn DB_RUNRECOVERY.

The log_register)function may fail and return errnoKfor any of the errors specified for the following Berkeley DB and C library functions: abort(3), close(3),dbenv->db_paniccall(3), fcntl(3), fflush(3), fprintf(3),free(3), fsync(3), getenv(3), getpid(3), getuid(3), isdigit(3), lseek(3), malloc(3), memcmp(3), memcpy(3), memset(3),open(3), realloc(3),sigfillset(3),sigprocmask(3), snprintf(3),stat(3), strerror(3), strlen(3),time(3), unlink(3), vfprintf(3), vsnprintf(3),and write(3).

In addition, the log_register)function may fail and return errnofor the following conditions:

B

EINVAL
An invalid flag value or parameter was specified.







See Also

9log_archive,5log_close,9log_compare,3log_file,5log_flush,1log_get,3log_open,1log_put, log_register,3log_stat,6log_unlinkandBlog_unregister.
ÿÿ