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">
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" />
15 <div xmlns="" class="navheader">
17 <p>Library Version 11.2.5.3</p>
19 <table width="100%" summary="Navigation header">
21 <th colspan="3" align="center">db_env_set_func_ftruncate</th>
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
28 <td width="20%" align="right"> <a accesskey="n" href="db_env_set_func_ioinfo.html">Next</a></td>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
37 <h2 class="title" style="clear: both"><a id="db_env_set_func_ftruncate"></a>db_env_set_func_ftruncate</h2>
41 <pre class="programlisting">#include <db.h>
44 db_env_set_func_ftruncate(int (*func_ftruncate)(int fd, off_t offset)); </pre>
46 The Berkeley DB library requires the ability to truncate a file.
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.
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.
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.
64 <div class="sect2" lang="en" xml:lang="en">
65 <div class="titlepage">
68 <h3 class="title"><a id="idp63587448"></a>Parameters</h3>
72 <div class="sect3" lang="en" xml:lang="en">
73 <div class="titlepage">
76 <h4 class="title"><a id="idp63587640"></a>func_ftruncate</h4>
81 The <span class="bold"><strong>func_ftruncate</strong></span> parameter is the
82 function which truncates a file.
85 The <span class="bold"><strong>fd</strong></span> parameter is an open file
86 descriptor on the file.
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.
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
99 <div class="sect2" lang="en" xml:lang="en">
100 <div class="titlepage">
103 <h3 class="title"><a id="idp63585200"></a>See Also</h3>
108 <a href="../../programmer_reference/program_runtime.html" class="olink">Run-time configuration</a>
112 <div class="navfooter">
114 <table width="100%" summary="Navigation footer">
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>
120 <td width="40%" align="right"> <a accesskey="n" href="db_env_set_func_ioinfo.html">Next</a></td>
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>
127 <td width="40%" align="right" valign="top"> db_env_set_func_ioinfo</td>