NNAAMMEE DbLog - log management class SSYYNNOOPPSSIISS ##iinncclluuddee <> ssttaattiicc iinntt DDbbLLoogg::::ooppeenn((ccoonnsstt cchhaarr **ddiirr,, uu__iinntt3322__tt ffllaaggss,, iinntt mmooddee,, DDbbEEnnvv **ddbbeennvv,, DDbbLLoogg ****rreeggiioonnpp));; iinntt DDbbLLoogg::::cclloossee(());; iinntt DDbbLLoogg::::fflluusshh((ccoonnsstt DDbbLLssnn **llssnn));; iinntt DDbbLLoogg::::ggeett((DDbbLLssnn **llssnn,, DDbbtt **ddaattaa,, uu__iinntt3322__tt ffllaaggss));; ssttaattiicc iinntt DDbbLLoogg::::ccoommppaarree((ccoonnsstt DDbbLLssnn **llssnn00,, ccoonnsstt DDbbLLssnn **llssnn11));; iinntt DDbbLLoogg::::ffiillee((ccoonnsstt DDbbLLssnn **llssnn,, cchhaarr **nnaammeepp,, ssiizzee__tt lleenn));; iinntt DDbbLLoogg::::ppuutt((DDbbLLssnn **llssnn,, ccoonnsstt DDbbtt **ddaattaa,, uu__iinntt3322__tt ffllaaggss));; ssttaattiicc iinntt DDbbLLoogg::::uunnlliinnkk((ccoonnsstt cchhaarr **ddiirr,, iinntt ffoorrccee,, DDbbEEnnvv **));; iinntt DDbbLLoogg::::aarrcchhiivvee((cchhaarr ****lliisstt[[]],, uu__iinntt3322__tt ffllaaggss,, vvooiidd **((**ddbb__mmaalllloocc))((ssiizzee__tt))));; iinntt DDbbLLoogg::::ddbb__rreeggiisstteerr((ccoonnsstt DDbb **ddbbpp,, ccoonnsstt cchhaarr **nnaammee,, DDBBTTYYPPEE ttyyppee,, uu__iinntt3322__tt **ffiiddpp));; iinntt DDbbLLoogg::::ddbb__uunnrreeggiisstteerr((uu__iinntt3322__tt ffiidd));; iinntt DDbbLLoogg::::ssttaatt((DDBB__LLOOGG__SSTTAATT ****sspppp,, vvooiidd **((**ddbb__mmaalllloocc))((ssiizzee__tt))));; DDEESSCCRRIIPPTTIIOONN The DB library is a family of classes that provides a mod- ular programming interface to transactions and record-ori- ented file access. The library includes support for transactions, locking, logging and file page caching, as well as various indexed access methods. Many of the classes (e.g., the file page caching class) are useful independent of the other DB classes, although some classes are explicitly based on other classes (e.g., transactions and logging). For a general description of the DB pack- age, see _d_b___i_n_t_r_o(3). This manual page describes the specific details of the log class. This class provide a general-purpose logging facility suf- ficient for transaction management. Logs can be shared by multiple processes. The DB transaction log is represented by a directory con- taining a set of files. The log is a record-oriented, append-only file, with records identified and accessed via _D_b_L_s_n's (database log sequence numbers). DbLsn's are returned on each _D_b_L_o_g_:_:_p_u_t operation, and only those DbLsn's returned by _D_b_L_o_g_:_:_p_u_t can later be used to retrieve records from the log. _D_b_L_o_g_:_:_o_p_e_n The _D_b_L_o_g_:_:_o_p_e_n method copies a pointer, to the log iden- tified by the ddiirreeccttoorryy _d_i_r, into the memory location ref- erenced by _r_e_g_i_o_n_p. If the _d_b_e_n_v argument to _D_b_L_o_g_:_:_o_p_e_n was initialized using _D_b_E_n_v_:_:_a_p_p_i_n_i_t, _d_i_r is interpreted as described by _D_b_E_n_v(3). Otherwise, if _d_i_r is not NULL, it is interpreted relative to the current working directory of the process. If _d_i_r is NULL, the following environment variables are checked in order: ``TMPDIR'', ``TEMP'', and ``TMP''. If one of them is set, log files are created relative to the direc- tory it specifies. If none of them are set, the first possible one of the following directories is used: _/_v_a_r_/_t_m_p, _/_u_s_r_/_t_m_p, _/_t_e_m_p, _/_t_m_p, _C_:_/_t_e_m_p and _C_:_/_t_m_p. All files associated with the log are created in this directory. This directory must already exist when DbLog::open is called. If the log already exists, the process must have permission to read and write the exist- ing files. If the log does not already exist, it is optionally created and initialized. If the log region is being created and log files are already present, the log files are ``recovered'' and sub- sequent log writes are appended to the end of the log. The log is stored in one or more files in the specified directory. Each file is named using the format log.NNNNN where ``NNNNN'' is the sequence number of the file within the log. The _f_l_a_g_s and _m_o_d_e arguments specify how files will be opened and/or created when they don't already exist. The flags value is specified by oorr'ing together one or more of the following values: DB_CREATE Create any underlying files, as necessary. If the files do not already exist and the DB_CREATE flag is not specified, the call will fail. DB_THREAD Cause the DbLog handle returned by the _D_b_L_o_g_:_:_o_p_e_n method to be useable by multiple threads within a single address space, i.e., to be ``free-threaded''. All files created by the log subsystem are created with mode _m_o_d_e (as described in _c_h_m_o_d(2)) and modified by the process' umask value at the time of creation (see _u_m_a_s_k(2)). The group ownership of created files is based on the system and directory defaults, and is not further specified by DB. The logging subsystem is configured based on which set methods have been used. It is expected that applications will use a single DbEnv object as the argument to all of the subsystems in the DB package. The fields of the DbEnv object used by _D_b_L_o_g_:_:_o_p_e_n are described below. As refer- ences to the DbEnv object may be maintained by _D_b_L_o_g_:_:_o_p_e_n, it is necessary that the DbEnv object and memory it references be valid until the object is destroyed. Any of the DbEnv fields that are not explic- itly set will default to appropriate values. The following fields in the DbEnv object may be initial- ized, using the appropriate set method, before calling _D_b_L_o_g_:_:_o_p_e_n: void *(*db_errcall)(char *db_errpfx, char *buffer); FILE *db_errfile; const char *db_errpfx; class ostream *db_error_stream; int db_verbose; The error fields of the DbEnv behave as described for _D_b_E_n_v(3). u_int32_t lg_max; The maximum size of a single file in the log. Because DbLsn file offsets are unsigned 4-byte val- ues, _l_g___m_a_x may not be larger than the maximum unsigned 4-byte value. If _l_g___m_a_x is 0, a default value is used. See the section "LOG FILE LIMITS" below, for further information. The _D_b_L_o_g_:_:_o_p_e_n method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_c_l_o_s_e The _D_b_L_o_g_:_:_c_l_o_s_e method closes the log associated with the DbLog object. In addition, if the _d_i_r argument to _D_b_L_o_g_:_:_o_p_e_n was NULL and _d_b_e_n_v was not initialized using _D_b_E_n_v_:_:_a_p_p_i_n_i_t, all files created for this shared region will be removed, as if _D_b_L_o_g_:_:_u_n_l_i_n_k were called. When multiple threads are using the DbLog handle concur- rently, only a single thread may call the _D_b_L_o_g_:_:_c_l_o_s_e method. The _D_b_L_o_g_:_:_c_l_o_s_e method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_f_l_u_s_h The _D_b_L_o_g_:_:_f_l_u_s_h method guarantees that all log records whose DbLsns are less than or equal to the _l_s_n parameter have been written to disk. If _l_s_n is NULL, all records in the log are flushed. The _D_b_L_o_g_:_:_f_l_u_s_h method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_g_e_t The _D_b_L_o_g_:_:_g_e_t method implements a cursor inside of the log, retrieving records from the log according to the _l_s_n and _f_l_a_g_s parameters. The data field of the _d_a_t_a object is set to the record retrieved and the size field indicates the number of bytes in the record. See _D_b_t(3) for a description of other fields in the _d_a_t_a object. WWhheenn mmuullttiippllee tthhrreeaaddss aarree uussiinngg tthhee rreettuurrnneedd DDbbLLoogg hhaannddllee ccoonnccuurrrreennttllyy,, eeiitthheerr tthhee DDBB__DDBBTT__MMAALLLLOOCC oorr DDBB__DDBBTT__UUSSEERRMMEEMM ffllaaggss mmuusstt bbee ssppeecciiffiieedd ffoorr aannyy DDbbtt uusseedd ffoorr ddaattaa rreettrriieevvaall.. The _f_l_a_g_s parameter must be set to exactly one of the fol- lowing values: DB_CHECKPOINT The last record written with the DB_CHECKPOINT flag specified to the _D_b_L_o_g_:_:_p_u_t method is returned in the _d_a_t_a argument. The _l_s_n argument is overwritten with the DbLsn of the record returned. If no record has been previously written with the DB_CHECKPOINT flag specified, the first record in the log is returned. If the log is empty the _D_b_L_o_g_:_:_g_e_t method will return DB_NOTFOUND. DB_FIRST The first record from any of the log files found in the log directory is returned in the _d_a_t_a argument. The _l_s_n argument is overwritten with the DbLsn of the record returned. If the log is empty the _D_b_L_o_g_:_:_g_e_t method will return DB_NOTFOUND. DB_LAST The last record in the log is returned in the _d_a_t_a argument. The _l_s_n argument is overwritten with the DbLsn of the record returned. If the log is empty, the _D_b_L_o_g_:_:_g_e_t method will return DB_NOTFOUND. DB_NEXT The current log position is advanced to the next record in the log and that record is returned in the _d_a_t_a argument. The _l_s_n argument is overwritten with the DbLsn of the record returned. If the pointer has not been initialized via DB_FIRST, DB_LAST, DB_SET, DB_NEXT, or DB_PREV, _D_b_L_o_g_:_:_g_e_t will return the first record in the log. If the last log record has already been returned or the log is empty, the _D_b_L_o_g_:_:_g_e_t method will return DB_NOTFOUND. If the log was opened with the DB_THREAD flag set, calls to _D_b_L_o_g_:_:_g_e_t with the DB_NEXT flag set will return EINVAL. DB_PREV The current log position is moved to the previous record in the log and that record is returned in the _d_a_t_a argument. The _l_s_n argument is overwritten with the DbLsn of the record returned. If the pointer has not been initialized via DB_FIRST, DB_LAST, DB_SET, DB_NEXT, or DB_PREV, _D_b_L_o_g_:_:_g_e_t will return the last record in the log. If the first log record has already been returned or the log is empty, the _D_b_L_o_g_:_:_g_e_t method will return DB_NOTFOUND. If the log was opened with the DB_THREAD flag set, calls to _D_b_L_o_g_:_:_g_e_t with the DB_PREV flag set will return EINVAL. DB_CURRENT Return the log record currently referenced by the log. If the log pointer has not been initialized via DB_FIRST, DB_LAST, DB_SET, DB_NEXT, or DB_PREV, or if the log was opened with the DB_THREAD flag set, _D_b_L_o_g_:_:_g_e_t will return EINVAL. DB_SET Retrieve the record specified by the _l_s_n argument. If the specified DbLsn is invalid (e.g., does not appear in the log) _D_b_L_o_g_:_:_g_e_t will return EINVAL. Otherwise, the _D_b_L_o_g_:_:_g_e_t method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_c_o_m_p_a_r_e The _D_b_L_o_g_:_:_c_o_m_p_a_r_e method allows the caller to compare two DbLsn's. _D_b_L_o_g_:_:_c_o_m_p_a_r_e returns 0 if the two DbLsn's are equal, 1 if _l_s_n_0 is greater than _l_s_n_1, and -1 if _l_s_n_0 is less than _l_s_n_1. _D_b_L_o_g_:_:_f_i_l_e The _D_b_L_o_g_:_:_f_i_l_e method maps DbLsn's to file names. The _D_b_L_o_g_:_:_f_i_l_e method copies the name of the file containing the record named by _l_s_n into the memory location refer- enced by _n_a_m_e_p. (This mapping of DbLsn to file is needed for database administration. For example, a transaction manager typically records the earliest DbLsn needed for restart, and the database administrator may want to archive log files to tape when they contain only DbLsn's before the earliest one needed for restart.) The _l_e_n argument is the length of the _n_a_m_e_p buffer in bytes. If _n_a_m_e_p is too short to hold the file name, _D_b_L_o_g_:_:_f_i_l_e will return ENOMEM. Note, as described above, log file names are quite short, on the order of 10 charac- ters. The _D_b_L_o_g_:_:_f_i_l_e method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_p_u_t The _D_b_L_o_g_:_:_p_u_t method appends records to the log. The DbLsn of the put record is returned in the _l_s_n parameter. The _f_l_a_g_s parameter may be set to one of the following values: DB_CHECKPOINT The log should write a checkpoint record, recording any information necessary to make the log structures recoverable after a crash. DB_CURLSN The DB_LSN of the next record to be put is returned in the _l_s_n parameter. DB_FLUSH The log is forced to disk after this record is writ- ten, guaranteeing that all records with DbLsns less than or equal to the one being put are on disk before this method returns (this function is most often used for a transaction commit, see _D_b_:_:_T_x_n in Db (3)). The caller is responsible for providing any necessary structure to _d_a_t_a. (For example, in a write-ahead logging protocol, the application must understand what part of _d_a_t_a is an operation code, what part is redo information, and what part is undo information. In addition, most transaction managers will store in _d_a_t_a the DbLsn of the previous log record for the same transaction, to support chaining back through the transaction's log records during undo.) The _D_b_L_o_g_:_:_p_u_t method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_u_n_l_i_n_k The _D_b_L_o_g_:_:_u_n_l_i_n_k method destroys the log region identi- fied by the directory _d_i_r, removing all files used to implement the log region. (The directory _d_i_r is not removed.) If there are processes that have called _D_b_L_o_g_:_:_o_p_e_n without calling _D_b_L_o_g_:_:_c_l_o_s_e (i.e., there are processes currently using the log region), _D_b_L_o_g_:_:_u_n_l_i_n_k will fail without further action, unless the force flag is set, in which case _D_b_L_o_g_:_:_u_n_l_i_n_k will attempt to remove the log region files regardless of any processes still using the log region. The result of attempting to forcibly destroy the region when a process has the region open is unspecified. Pro- cesses using a shared memory region maintain an open file descriptor for it. On UNIX systems, the region removal should succeed and processes that have already joined the region should continue to run in the region without change, however processes attempting to join the log region will either fail or attempt to create a new region. On other systems, e.g., WNT, where the _u_n_l_i_n_k(2) system call will fail if any process has an open file descriptor for the file, the region removal will fail. In the case of catastrophic or system failure, database recovery must be performed (see _d_b___r_e_c_o_v_e_r(1) or the DB_RECOVER and DB_RECOVER_FATAL flags to _D_b_E_n_v_:_:_a_p_p_i_n_i_t(3)). Alternatively, if recovery is not required because no database state is maintained across failures, it is possible to clean up a log region by removing all of the files in the directory specified to the _D_b_L_o_g_:_:_o_p_e_n method, as log region files are never cre- ated in any directory other than the one specified to _D_b_L_o_g_:_:_o_p_e_n. Note, however, that this has the potential to remove files created by the other DB subsystems in this database environment. The _D_b_L_o_g_:_:_u_n_l_i_n_k method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_a_r_c_h_i_v_e The _D_b_L_o_g_:_:_a_r_c_h_i_v_e method creates a NULL-terminated array of log or database file names and copies a pointer to them into the user-specified memory location _l_i_s_t. By default, _D_b_L_o_g_:_:_a_r_c_h_i_v_e returns the names of all of the log files that are no longer in use (e.g., no longer involved in active transactions), and that may be archived for catastrophic recovery and then removed from the sys- tem. If there were no file names to return, _l_i_s_t will be set to NULL. Arrays of log file names are created in allocated memory. If _d_b___m_a_l_l_o_c is non-NULL, it is called to allocate the memory, otherwise, the library function _m_a_l_l_o_c(3) is used. The function _d_b___m_a_l_l_o_c must match the calling conventions of the _m_a_l_l_o_c(3) library routine. Regardless, the caller is responsible for deallocating the returned memory. To deallocate the returned memory, free each returned memory pointer; pointers inside the memory do not need to be individually freed. The _f_l_a_g_s argument is specified by oorr'ing together one or more of the following values: DB_ARCH_ABS All pathnames are returned as absolute pathnames, instead of relative to the database home directory. DB_ARCH_DATA Return the database files that need to be archived in order to recover the database from catastrophic fail- ure. If any of the database files have not been accessed during the lifetime of the current log files, _D_b_L_o_g_:_:_a_r_c_h_i_v_e will not include them in this list. It is also possible that some of the files referenced in the log have since been deleted from the system. DB_ARCH_LOG Return all the log file names regardless of whether or not they are in use. The DB_ARCH_DATA and DB_ARCH_LOG flags are mutually exclu- sive. The _D_b_L_o_g_:_:_a_r_c_h_i_v_e method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. The _D_b_L_o_g_:_:_a_r_c_h_i_v_e method is based on the C _l_o_g___a_r_c_h_i_v_e function, which is the underlying function used by the _d_b___a_r_c_h_i_v_e(1) utility. See the source code for the _d_b___a_r_c_h_i_v_e utility for an example of using _l_o_g___a_r_c_h_i_v_e in a UNIX environment. See the _d_b___a_r_c_h_i_v_e(1) manual page for more information on database archival procedures. _D_b_L_o_g_:_:_d_b___r_e_g_i_s_t_e_r The _D_b_L_o_g_:_:_d_b___r_e_g_i_s_t_e_r method registers a file name with the log manager and copies a file identification number into the memory location referenced by _f_i_d_p. This file identification number should be used in all subsequent log messages that refer to operations on this file. The log manager records all file name to file identification num- ber mappings at each checkpoint so that a recovery process can identify the file to which a record in the log refers. The _D_b_L_o_g_:_:_d_b___r_e_g_i_s_t_e_r method is called when an access method registers the open of a file. The _d_b_p parameter should be a pointer to the Db object which is being returned by the access method. The _t_y_p_e parameter should be one of the Db types specified in _D_b_:_:_o_p_e_n _(_s_e_eDb_(_3_)_)_, e.g., DB_HASH. The _D_b_L_o_g_:_:_d_b___r_e_g_i_s_t_e_r method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_d_b___u_n_r_e_g_i_s_t_e_r The _D_b_L_o_g_:_:_d_b___u_n_r_e_g_i_s_t_e_r method disassociates the file name to file identification number mapping for the file identification number specified by the _f_i_d parameter. The file identification number may then be reused. The _D_b_L_o_g_:_:_d_b___u_n_r_e_g_i_s_t_e_r method throws a _D_b_E_x_c_e_p_t_i_o_n(3) or returns the value of _e_r_r_n_o on failure and 0 on success. _D_b_L_o_g_:_:_s_t_a_t The _D_b_L_o_g_:_:_s_t_a_t function creates a statistical structure and copies a pointer to it into the user-specified memory location. Statistical structures are created in allocated memory. If _d_b___m_a_l_l_o_c is non-NULL, it is called to allocate the memory, otherwise, the library function _m_a_l_l_o_c(3) is used. The function _d_b___m_a_l_l_o_c must match the calling conventions of the _m_a_l_l_o_c(3) library routine. Regardless, the caller is responsible for deallocating the returned memory. To deallocate the returned memory, free each returned memory pointer; pointers inside the memory do not need to be individually freed. The log statistics are stored in a structure of type DB_LOG_STAT (typedef'd in ). The following DB_LOG_STAT fields will be filled in: u_int32_t st_magic; The magic number that identifies a file as a log file. u_int32_t st_version; The version of the log file type. u_int32_t st_refcnt; The number of references to the region. u_int32_t st_regsize; The size of the region. u_int32_t st_mode; The mode of any created log files. u_int32_t st_lg_max; The maximum size of any individual file comprising the log. u_int32_t st_written; The total number of bytes written to this log. u_int32_t st_written_chkpt; The number of bytes written since the last check- point. u_int32_t st_region_wait; The number of times that a process was able to obtain the region lock without waiting. u_int32_t st_region_nowait; The number of times that a process was forced to wait before obtaining the region lock. LLOOGG FFIILLEE LLIIMMIITTSS Log file sizes impose a time limit on the length of time a database may be accessed under transaction protection, before it needs to be dumped and reloaded (see _d_b___d_u_m_p_(_3_) and _d_b___l_o_a_d_(_3_)_)_. Unfortunately, the limits are poten- tially difficult to calculate. The log file name consists of "log." followed by 5 digits, resulting in a maximum of 99,999 log files. Consider an application performing 600 transactions per second, for 15 hours a day, logged into 10Mb log files, where each trans- action is logging approximately 100 bytes of data. The calculation: (10 * 2^20 * 99999) / (600 * 60 * 60 * 15 * 100) = 323.63 indicates that the system will run out of log file space in roughly 324 days. If we increase the maximum size of the files from 10Mb to 100Mb, the same calculation indi- cates that the application will run out of log file space in roughly 9 years. There is no way to reset the log file name space in Berke- ley DB. If your application is reaching the end of its log file name space, you should: 1. Archive your databases as if to prepare for catas- trophic failure (see _d_b___a_r_c_h_i_v_e(1) for more informa- tion). 2. Dump and re-load aallll your databases (see _d_b___d_u_m_p(1) and _d_b___l_o_a_d(1) for more information). 3. Remove all of the log files from the database envi- ronment (see _d_b___a_r_c_h_i_v_e(1) for more information). 4. Restart your applications. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS The following environment variables affect the execution of _d_b___l_o_g: DB_HOME If the _d_b_e_n_v argument to _D_b_L_o_g_:_:_o_p_e_n was initialized using _d_b___a_p_p_i_n_i_t, the environment variable DB_HOME may be used as the path of the database home for the interpretation of the _d_i_r argument to _D_b_L_o_g_:_:_o_p_e_n, as described in _d_b___a_p_p_i_n_i_t(3). Specifically, _D_b_L_o_g_:_:_o_p_e_n is affected by the configuration string value of DB_LOG_DIR. TMPDIR If the _d_b_e_n_v argument to _D_b_L_o_g_:_:_o_p_e_n was NULL or not initialized using _d_b___a_p_p_i_n_i_t, the environment vari- able TMPDIR may be used as the directory in which to create the log, as described in the _D_b_L_o_g_:_:_o_p_e_n sec- tion above. EERRRROORRSS Methods marked as returning _e_r_r_n_o will, by default, throw an exception that encapsulates the error information. The default error behavior can be changed, see _D_b_E_x_c_e_p_t_i_o_n(3). The _D_b_L_o_g_:_:_o_p_e_n method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: DbLog::close(3), DbLog::unlink(3), atoi(3), close(2), db_version(3), fcntl(2), fflush(3), lseek(2), malloc(3), memcpy(3), mem- set(3), mmap(2), munmap(2), open(2), opendir(3), read(2), readdir(3), realloc(3), sigfillset(3), sigprocmask(2), stat(2), strchr(3), strcpy(3), strdup(3), strerror(3), strlen(3), strncmp(3), unlink(2), and write(2). In addition, the _D_b_L_o_g_:_:_o_p_e_n method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following condi- tions: [EAGAIN] The shared memory region was locked and (repeatedly) unavailable. [EINVAL] An invalid flag value or parameter was specified. The DB_THREAD flag was specified and spinlocks are not implemented for this architecture. The specified file size was too large. The _D_b_L_o_g_:_:_c_l_o_s_e method may fail and throw a _D_b_E_x_c_e_p_- _t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: close(2), fcntl(2), fflush(3), munmap(2), and strerror(3). The _D_b_L_o_g_:_:_f_l_u_s_h method may fail and throw a _D_b_E_x_c_e_p_- _t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: close(2), fcntl(2), fflush(3), fsync(2), lseek(2), malloc(3), memcpy(3), mem- set(3), open(2), sigfillset(3), sigprocmask(2), stat(2), strcpy(3), strdup(3), strerror(3), strlen(3), unlink(2), and write(2). In addition, the _D_b_L_o_g_:_:_f_l_u_s_h method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following condi- tions: [EINVAL] An invalid flag value or parameter was specified. The _D_b_L_o_g_:_:_g_e_t method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: atoi(3), close(2), fcntl(2), fflush(3), lseek(2), malloc(3), memcpy(3), mem- set(3), open(2), opendir(3), read(2), readdir(3), real- loc(3), sigfillset(3), sigprocmask(2), stat(2), strchr(3), strcpy(3), strdup(3), strerror(3), strlen(3), strncmp(3), and unlink(2). In addition, the _D_b_L_o_g_:_:_g_e_t method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following condi- tions: [EINVAL] An invalid flag value or parameter was specified. The DB_FIRST flag was specified and no log files were found. The _D_b_L_o_g_:_:_f_i_l_e method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: close(2), fcntl(2), fflush(3), malloc(3), memcpy(3), memset(3), open(2), sig- fillset(3), sigprocmask(2), stat(2), strcpy(3), strdup(3), strerror(3), strlen(3), and unlink(2). In addition, the _D_b_L_o_g_:_:_f_i_l_e method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following condi- tions: [ENOMEM] The supplied buffer was too small to hold the log file name. The _D_b_L_o_g_:_:_p_u_t method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: close(2), fcntl(2), fflush(3), fsync(2), lseek(2), malloc(3), memcpy(3), mem- set(3), open(2), sigfillset(3), sigprocmask(2), stat(2), strcpy(3), strdup(3), strerror(3), strlen(3), time(3), unlink(2), and write(2). In addition, the _D_b_L_o_g_:_:_p_u_t method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following condi- tions: [EINVAL] An invalid flag value or parameter was specified. The record to be logged is larger than the maximum log record. The _D_b_L_o_g_:_:_u_n_l_i_n_k method may fail and throw a _D_b_E_x_c_e_p_- _t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: close(2), fcntl(2), fflush(3), malloc(3), memcpy(3), memset(3), mmap(2), munmap(2), open(2), sigfillset(3), sigprocmask(2), stat(2), strcpy(3), strdup(3), strerror(3), strlen(3), and unlink(2). In addition, the _D_b_L_o_g_:_:_u_n_l_i_n_k method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following condi- tions: [EBUSY] The shared memory region was in use and the force flag was not set. The _D_b_L_o_g_:_:_a_r_c_h_i_v_e method may fail and throw a _D_b_E_x_c_e_p_- _t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: DbLog::compare(3), DbLog::get(3), close(2), fcntl(2), fflush(3), getcwd(3), malloc(3), memcpy(3), memset(3), open(2), qsort(3), real- loc(3), sigfillset(3), sigprocmask(2), stat(2), strchr(3), strcmp(3), strcpy(3), strdup(3), strerror(3), strlen(3), and unlink(2). In addition, the _D_b_L_o_g_:_:_a_r_c_h_i_v_e method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following condi- tions: [EINVAL] An invalid flag value or parameter was specified. The log was corrupted. The _D_b_L_o_g_:_:_d_b___r_e_g_i_s_t_e_r method may fail and throw a _D_b_E_x_- _c_e_p_t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: close(2), fcntl(2), fflush(3), fsync(2), lseek(2), malloc(3), memcmp(3), mem- cpy(3), memset(3), open(2), realloc(3), sigfillset(3), sigprocmask(2), stat(2), strcpy(3), strdup(3), str- error(3), strlen(3), time(3), unlink(2), and write(2). In addition, the _D_b_L_o_g_:_:_d_b___r_e_g_i_s_t_e_r method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following conditions: [EINVAL] An invalid flag value or parameter was specified. The _D_b_L_o_g_:_:_d_b___u_n_r_e_g_i_s_t_e_r method may fail and throw a _D_b_E_x_- _c_e_p_t_i_o_n(3) or return _e_r_r_n_o for any of the errors specified for the following DB and library functions: close(2), fcntl(2), fflush(3), fsync(2), lseek(2), malloc(3), memcpy(3), mem- set(3), open(2), sigfillset(3), sigprocmask(2), stat(2), strcpy(3), strdup(3), strerror(3), strlen(3), time(3), unlink(2), and write(2). In addition, the _D_b_L_o_g_:_:_d_b___u_n_r_e_g_i_s_t_e_r method may fail and throw a _D_b_E_x_c_e_p_t_i_o_n(3) or return _e_r_r_n_o for the following conditions: [EINVAL] An invalid flag value or parameter was specified. BBUUGGSS The log files are not machine architecture independent. Specifically, their metadata are not stored in a fixed byte order. SSEEEE AALLSSOO _d_b___a_r_c_h_i_v_e(1), _d_b___c_h_e_c_k_p_o_i_n_t(1), _d_b___d_e_a_d_l_o_c_k(1), _d_b___d_u_m_p(1), _d_b___l_o_a_d(1), _d_b___r_e_c_o_v_e_r(1), _d_b___s_t_a_t(1), _d_b___i_n_t_r_o(3), _d_b___i_n_t_e_r_n_a_l(3), _d_b___t_h_r_e_a_d(3), _D_b(3), _D_b_c(3), _D_b_E_n_v(3), _D_b_E_x_c_e_p_t_i_o_n(3), _D_b_I_n_f_o(3), _D_b_L_o_c_k(3), _D_b_L_o_c_k_T_a_b(3), _D_b_L_o_g(3), _D_b_L_s_n(3), _D_b_M_p_o_o_l(3), _D_b_M_p_o_o_l_F_i_l_e(3), _D_b_t(3), _D_b_T_x_n(3), _D_b_T_x_n_M_g_r(3)