1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DB_ENV->set_lg_filemode()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> 10 <link rel="up" href="lsn.html" title="Chapter 7. The DB_LSN Handle" /> 11 <link rel="prev" href="envset_lg_dir.html" title="DB_ENV->set_lg_dir()" /> 12 <link rel="next" href="envset_lg_max.html" title="DB_ENV->set_lg_max()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_ENV->set_lg_filemode()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="envset_lg_dir.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 7. 23 The DB_LSN Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="envset_lg_max.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="envset_lg_filemode"></a>DB_ENV->set_lg_filemode()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_ENV->set_lg_filemode(DB_ENV *dbenv, int lg_filemode); </pre> 42 <p> 43 Set the absolute file mode for created log files. This method is 44 <span class="bold"><strong>only</strong></span> useful for the rare Berkeley DB 45 application that does not control its umask value. 46 </p> 47 <p> 48 Normally, if Berkeley DB applications set their umask appropriately, 49 all processes in the application suite will have read permission on 50 the log files created by any process in the application suite. 51 However, if the Berkeley DB application is a library, a process using 52 the library might set its umask to a value preventing other processes 53 in the application suite from reading the log files it creates. In 54 this rare case, the <code class="methodname">DB_ENV->set_lg_filemode()</code> method can be used to 55 set the mode of created log files to an absolute value. 56 </p> 57 <p> 58 The database environment's log file mode may also be configured using 59 the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The 60 syntax of the entry in that file is a single line with the string 61 "set_lg_filemode", one or more whitespace characters, and the absolute 62 mode of created log files. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is 63 read when the database environment is opened, it will silently 64 overrule configuration done before that time. 65 </p> 66 <p> 67 The <code class="methodname">DB_ENV->set_lg_filemode()</code> method configures a database 68 environment, not only operations performed using the specified 69 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> handle. 70 </p> 71 <p> 72 The <code class="methodname">DB_ENV->set_lg_filemode()</code> method may be called at any time during 73 the life of the application. 74 </p> 75 <p> 76 The <code class="methodname">DB_ENV->set_lg_filemode()</code> <span> 77 <span> 78 method returns a non-zero error value on failure and 0 on success. 79 </span> 80 81 </span> 82 </p> 83 <div class="sect2" lang="en" xml:lang="en"> 84 <div class="titlepage"> 85 <div> 86 <div> 87 <h3 class="title"><a id="id1683961"></a>Parameters</h3> 88 </div> 89 </div> 90 </div> 91 <div class="sect3" lang="en" xml:lang="en"> 92 <div class="titlepage"> 93 <div> 94 <div> 95 <h4 class="title"><a id="id1683768"></a>lg_filemode</h4> 96 </div> 97 </div> 98 </div> 99 <p> 100 The <span class="bold"><strong>lg_filemode</strong></span> parameter is the 101 absolute mode of the created log file. 102 </p> 103 </div> 104 </div> 105 <div class="sect2" lang="en" xml:lang="en"> 106 <div class="titlepage"> 107 <div> 108 <div> 109 <h3 class="title"><a id="id1684120"></a>Class</h3> 110 </div> 111 </div> 112 </div> 113 <p> 114 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, 115 <a class="link" href="logc.html" title="The DB_LOGC Handle">DB_LOGC</a>, 116 <a class="link" href="lsn.html" title="Chapter 7. The DB_LSN Handle">DB_LSN</a> 117 </p> 118 </div> 119 <div class="sect2" lang="en" xml:lang="en"> 120 <div class="titlepage"> 121 <div> 122 <div> 123 <h3 class="title"><a id="id1684029"></a>See Also</h3> 124 </div> 125 </div> 126 </div> 127 <p> 128 <a class="xref" href="lsn.html#loglist" title="Logging Subsystem and Related Methods">Logging Subsystem and Related Methods</a> 129 </p> 130 </div> 131 </div> 132 <div class="navfooter"> 133 <hr /> 134 <table width="100%" summary="Navigation footer"> 135 <tr> 136 <td width="40%" align="left"><a accesskey="p" href="envset_lg_dir.html">Prev</a> </td> 137 <td width="20%" align="center"> 138 <a accesskey="u" href="lsn.html">Up</a> 139 </td> 140 <td width="40%" align="right"> <a accesskey="n" href="envset_lg_max.html">Next</a></td> 141 </tr> 142 <tr> 143 <td width="40%" align="left" valign="top">DB_ENV->set_lg_dir() </td> 144 <td width="20%" align="center"> 145 <a accesskey="h" href="index.html">Home</a> 146 </td> 147 <td width="40%" align="right" valign="top"> DB_ENV->set_lg_max()</td> 148 </tr> 149 </table> 150 </div> 151 </body> 152</html> 153