1<!--$Id: log_file.so,v 10.34 2004/08/13 03:38:57 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DB_ENV->log_file</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DB_ENV->log_file</b> 14</td> 15<td align=right> 16<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a> 17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db.h> 23<p> 24int 25DB_ENV->log_file(DB_ENV *env, 26 const DB_LSN *lsn, char *namep, size_t len); 27</pre></b> 28<hr size=1 noshade> 29<b>Description: DB_ENV->log_file</b> 30<p>The DB_ENV->log_file method maps 31DB_LSN structures 32to filenames, returning the name of the file containing the record named 33by <b>lsn</b>.</p> 34<p>This mapping of 35DB_LSN structures 36to files is needed for database administration. For example, a 37transaction manager typically records the earliest <a href="/api_c/lsn_class.html">DB_LSN</a> needed 38for restart, and the database administrator may want to archive log 39files to tape when they contain only <a href="/api_c/lsn_class.html">DB_LSN</a> entries before the 40earliest one needed for restart.</p> 41<p>The DB_ENV->log_file method 42returns a non-zero error value on failure 43and 0 on success. 44</p> 45<b>Parameters</b> <br> 46 <b>lsn</b><ul compact><li>The <b>lsn</b> parameter is the 47DB_LSN structure 48for which a filename is wanted.</ul> 49 <b>namep</b><ul compact><li>The <b>namep</b> parameter references memory into which 50 the name of the file containing the record named by <b>lsn</b> is copied.</ul> 51 <b>len</b><ul compact><li>The <b>len</b> parameter is the length of the <b>namep</b> buffer in 52bytes. If <b>namep</b> is too short to hold the filename, 53DB_ENV->log_file will fail. (Log filenames are normally quite short, 54on the order of 10 characters.)</ul> 55<br> 56<br><b>Errors</b> 57<p>The DB_ENV->log_file method 58may fail and return one of the following non-zero errors:</p> 59<br> 60<b>EINVAL</b><ul compact><li>If supplied buffer was too small to hold the log filename; or if an 61invalid flag value or parameter was specified.</ul> 62<br> 63<hr size=1 noshade> 64<br><b>Class</b> 65<a href="/api_c/env_class.html">DB_ENV</a>, <a href="/api_c/logc_class.html">DB_LOGC</a>, <a href="/api_c/lsn_class.html">DB_LSN</a> 66<br><b>See Also</b> 67<a href="/api_c/log_list.html">Logging Subsystem and Related Methods</a> 68</tt> 69<table width="100%"><tr><td><br></td><td align=right> 70<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 71</td></tr></table> 72<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 73</body> 74</html> 75