1<!--$Id: set_func_ftruncate.so,v 1.3 2004/09/20 14:29:50 mjc 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_set_func_ftruncate</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_set_func_ftruncate</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_set_func_ftruncate(int (*func_ftruncate)(int fd, off_t offset)); 26</pre></b> 27<hr size=1 noshade> 28<b>Description: db_env_set_func_ftruncate</b> 29<p>The Berkeley DB library requires the ability to truncate a file.</p> 30<p>The db_env_set_func_ftruncate method configures all operations performed by a process and 31all of its threads of control, not operations confined to a single 32database environment.</p> 33<p>Although the db_env_set_func_ftruncate method may be called at any time during the life of 34the application, it should normally be called before making calls to the 35<a href="../api_c/env_class.html">db_env_create</a> or <a href="../api_c/db_class.html">db_create</a> methods.</p> 36<p>The db_env_set_func_ftruncate method 37returns a non-zero error value on failure 38and 0 on success. 39</p> 40<b>Parameters</b> <br> 41 <b>func_ftruncate</b><ul compact><li>The <b>func_ftruncate</b> parameter is the function which truncates a file. 42<p>The <b>fd</b> parameter is an open file descriptor on the file.</p> 43<p>The <b>ftruncate</b> function must truncate the file to the byte 44length specified by the <b>offset</b> parameter.</p> 45<p>The <b>func_ftruncate</b> function must return the value of <b>errno</b> on 46failure and 0 on success.</p></ul> 47<br> 48<br><b>See Also</b> 49<a href="../ref/program/runtime.html">Run-time configuration</a> 50</tt> 51<table width="100%"><tr><td><br></td><td align=right> 52<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> 53</td></tr></table> 54<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 55</body> 56</html> 57