1<!--$Id: env_set_lg_mode.so,v 1.1 2004/12/15 15:46:44 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: DbEnv::set_lg_filemode</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>DbEnv::set_lg_filemode</b> 14</td> 15<td align=right> 16<a href="../api_cxx/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_cxx.h> 23<p> 24int 25DbEnv::set_lg_filemode(int lg_mode); 26<p> 27int 28DbEnv::get_lg_filemode(int *); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbEnv::set_lg_filemode</b> 32<p>Set the absolute file mode for created log files. This method is 33<b>only</b> useful for the rare Berkeley DB application that does not 34control its umask value.</p> 35<p>Normally, if Berkeley DB applications set their umask appropriately, all 36processes in the application suite will have read permission on the log 37files created by any process in the application suite. However, if the 38Berkeley DB application is a library, a process using the library might set 39its umask to a value preventing other processes in the application suite 40from reading the log files it creates. In this rare case, the 41DbEnv::set_lg_filemode method can be used to set the mode of created 42log files to an absolute value.</p> 43<p>The database environment's log file mode may also be configured using the 44environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file. The syntax of the entry in that 45file is a single line with the string "set_lg_filemode", one or more whitespace 46characters, and the absolute mode of created log files. 47Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment 48is opened, it will silently overrule configuration done before that 49time.</p> 50<p>The DbEnv::set_lg_filemode method configures a database environment, not only operations 51performed using the specified <a href="../api_cxx/env_class.html">DbEnv</a> handle.</p> 52<p>The DbEnv::set_lg_filemode method may be called at any time during the life of the 53application.</p> 54<p>The DbEnv::set_lg_filemode method 55either returns a non-zero error value 56or throws an exception that encapsulates a non-zero error value on 57failure, and returns 0 on success. 58</p> 59<b>Parameters</b> <br> 60 <b>lg_filemode</b><ul compact><li>The <b>lg_filemode</b> parameter is the absolute mode of the created 61log file.</ul> 62<br> 63<hr size=1 noshade> 64<b>Description: DbEnv::set_lg_filemode</b> 65<p>The DbEnv::set_lg_filemode method returns the log file mode.</p> 66<p>The DbEnv::set_lg_filemode method may be called at any time during the life of the 67application.</p> 68<p>The DbEnv::set_lg_filemode method 69either returns a non-zero error value 70or throws an exception that encapsulates a non-zero error value on 71failure, and returns 0 on success. 72</p> 73<b>Parameters</b> <br> 74 <b>lg_modep</b><ul compact><li>The DbEnv::set_lg_filemode method returns the 75log file mode in <b>lg_modep</b>.</ul> 76<br> 77<hr size=1 noshade> 78<br><b>Class</b> 79<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/logc_class.html">DbLogc</a>, <a href="../api_cxx/lsn_class.html">DbLsn</a> 80<br><b>See Also</b> 81<a href="../api_cxx/log_list.html">Logging Subsystem and Related Methods</a> 82</tt> 83<table width="100%"><tr><td><br></td><td align=right> 84<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 85</td></tr></table> 86<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 87</body> 88</html> 89