Imported Upstream version 5.3.21
[platform/upstream/libdb.git] / docs / api_reference / C / db_env_set_func_ftruncate.html
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_func_ftruncate</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="setfunc.html" title="Appendix C.  Berkeley DB Application Space Static Functions" />
11     <link rel="prev" href="db_env_set_func_fsync.html" title="db_env_set_func_fsync" />
12     <link rel="next" href="db_env_set_func_ioinfo.html" title="db_env_set_func_ioinfo" />
13   </head>
14   <body>
15     <div xmlns="" class="navheader">
16       <div class="libver">
17         <p>Library Version 11.2.5.3</p>
18       </div>
19       <table width="100%" summary="Navigation header">
20         <tr>
21           <th colspan="3" align="center">db_env_set_func_ftruncate</th>
22         </tr>
23         <tr>
24           <td width="20%" align="left"><a accesskey="p" href="db_env_set_func_fsync.html">Prev</a> </td>
25           <th width="60%" align="center">Appendix C. 
26                 Berkeley DB Application Space Static Functions
27         </th>
28           <td width="20%" align="right"> <a accesskey="n" href="db_env_set_func_ioinfo.html">Next</a></td>
29         </tr>
30       </table>
31       <hr />
32     </div>
33     <div class="sect1" lang="en" xml:lang="en">
34       <div class="titlepage">
35         <div>
36           <div>
37             <h2 class="title" style="clear: both"><a id="db_env_set_func_ftruncate"></a>db_env_set_func_ftruncate</h2>
38           </div>
39         </div>
40       </div>
41       <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 db_env_set_func_ftruncate(int (*func_ftruncate)(int fd, off_t offset)); </pre>
45       <p>
46          The Berkeley DB library requires the ability to truncate a file.
47     </p>
48       <p>
49          The <code class="function">db_env_set_func_ftruncate</code> function configures all operations
50          performed by a process and all of its threads of control, not
51          operations confined to a single database environment.
52     </p>
53       <p>
54          Although the <code class="function">db_env_set_func_ftruncate</code> function may be called at any
55          time during the life of the application, it should normally be called
56          before making calls to the <a class="xref" href="envcreate.html" title="db_env_create">db_env_create</a> or
57          <a class="xref" href="dbcreate.html" title="db_create">db_create</a> methods.
58     </p>
59       <p>
60          The <code class="function">db_env_set_func_ftruncate()</code> <span>
61                   function returns a non-zero error value on failure and 0 on success.
62             </span>
63     </p>
64       <div class="sect2" lang="en" xml:lang="en">
65         <div class="titlepage">
66           <div>
67             <div>
68               <h3 class="title"><a id="idp63587448"></a>Parameters</h3>
69             </div>
70           </div>
71         </div>
72         <div class="sect3" lang="en" xml:lang="en">
73           <div class="titlepage">
74             <div>
75               <div>
76                 <h4 class="title"><a id="idp63587640"></a>func_ftruncate</h4>
77               </div>
78             </div>
79           </div>
80           <p>
81                           The <span class="bold"><strong>func_ftruncate</strong></span> parameter is the
82                           function which truncates a file.
83                       </p>
84           <p>
85                           The <span class="bold"><strong>fd</strong></span> parameter is an open file
86                           descriptor on the file.
87                      </p>
88           <p>
89                           The <span class="bold"><strong>ftruncate</strong></span> function must truncate
90                           the file to the byte length specified by the <span class="bold"><strong>offset</strong></span> parameter.
91                      </p>
92           <p>
93                           The <span class="bold"><strong>func_ftruncate</strong></span> function must
94                           return the value of <span class="bold"><strong>errno</strong></span> on failure
95                           and 0 on success.
96                      </p>
97         </div>
98       </div>
99       <div class="sect2" lang="en" xml:lang="en">
100         <div class="titlepage">
101           <div>
102             <div>
103               <h3 class="title"><a id="idp63585200"></a>See Also</h3>
104             </div>
105           </div>
106         </div>
107         <p>
108           <a href="../../programmer_reference/program_runtime.html" class="olink">Run-time configuration</a>
109      </p>
110       </div>
111     </div>
112     <div class="navfooter">
113       <hr />
114       <table width="100%" summary="Navigation footer">
115         <tr>
116           <td width="40%" align="left"><a accesskey="p" href="db_env_set_func_fsync.html">Prev</a> </td>
117           <td width="20%" align="center">
118             <a accesskey="u" href="setfunc.html">Up</a>
119           </td>
120           <td width="40%" align="right"> <a accesskey="n" href="db_env_set_func_ioinfo.html">Next</a></td>
121         </tr>
122         <tr>
123           <td width="40%" align="left" valign="top">db_env_set_func_fsync </td>
124           <td width="20%" align="center">
125             <a accesskey="h" href="index.html">Home</a>
126           </td>
127           <td width="40%" align="right" valign="top"> db_env_set_func_ioinfo</td>
128         </tr>
129       </table>
130     </div>
131   </body>
132 </html>