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_seek</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��3.�� Berkeley DB Application Space Static Functions" /> 11 <link rel="prev" href="db_env_set_func_rename.html" title="db_env_set_func_rename" /> 12 <link rel="next" href="db_env_set_func_unlink.html" title="db_env_set_func_unlink" /> 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_func_seek</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="db_env_set_func_rename.html">Prev</a>��</td> 22 <th width="60%" align="center">Appendix��3.�� 23 Berkeley DB Application Space Static Functions 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="db_env_set_func_unlink.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="db_env_set_func_seek"></a>db_env_set_func_seek</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41db_env_set_func_seek(int (*func_seek)(int fd, off_t offset, int whence)); </pre> 42 <p> 43 The Berkeley DB library requires the ability to specify that a 44 subsequent read from or write to a file will occur at a specific 45 location in that file. 46 </p> 47 <p> 48 The <code class="function">db_env_set_func_seek()</code> function configures all operations performed by 49 a process and all of its threads of control, not operations confined 50 to a single database environment. 51 </p> 52 <p> 53 Although the <code class="function">db_env_set_func_seek()</code> function may be called at any time 54 during the life of the application, it should normally be called 55 before making calls to the <a class="xref" href="envcreate.html" title="db_env_create">db_env_create</a> or 56 <a class="xref" href="dbcreate.html" title="db_create">db_create</a> methods. 57 </p> 58 <p> 59 The <code class="function">db_env_set_func_seek()</code> <span> 60 function returns a non-zero error value on failure and 0 on success. 61 </span> 62 </p> 63 <div class="sect2" lang="en" xml:lang="en"> 64 <div class="titlepage"> 65 <div> 66 <div> 67 <h3 class="title"><a id="id1720766"></a>Parameters</h3> 68 </div> 69 </div> 70 </div> 71 <div class="sect3" lang="en" xml:lang="en"> 72 <div class="titlepage"> 73 <div> 74 <div> 75 <h4 class="title"><a id="id1720936"></a>func_seek</h4> 76 </div> 77 </div> 78 </div> 79 <p> 80 The <span class="bold"><strong>func_seek</strong></span> parameter is the 81 function which seeks to a specific location in a file. 82 </p> 83 <p> 84 The <span class="bold"><strong>fd</strong></span> parameter is an open file 85 descriptor on the file. 86 </p> 87 <p> 88 The <span class="bold"><strong>seek</strong></span> function must cause a 89 subsequent read from or write to the file to occur at the byte offset 90 specified by the <span class="bold"><strong>offset</strong></span> parameter. 91 </p> 92 <p> 93 The <span class="bold"><strong>whence</strong></span> parameter specifies where 94 in the file the byte offset is relative to, as described by the 95 IEEE/ANSI Std 1003.1 (POSIX) <span class="bold"><strong>lseek</strong></span> 96 system call. 97 </p> 98 <p> 99 The <span class="bold"><strong>func_seek</strong></span> function must return 100 the value of <span class="bold"><strong>errno</strong></span> on failure and 0 101 on success. 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="id1721306"></a>See Also</h3> 110 </div> 111 </div> 112 </div> 113 <p> 114 <a href="../../programmer_reference/program_runtime.html" class="olink">Run-time configuration</a> 115 </p> 116 </div> 117 </div> 118 <div class="navfooter"> 119 <hr /> 120 <table width="100%" summary="Navigation footer"> 121 <tr> 122 <td width="40%" align="left"><a accesskey="p" href="db_env_set_func_rename.html">Prev</a>��</td> 123 <td width="20%" align="center"> 124 <a accesskey="u" href="setfunc.html">Up</a> 125 </td> 126 <td width="40%" align="right">��<a accesskey="n" href="db_env_set_func_unlink.html">Next</a></td> 127 </tr> 128 <tr> 129 <td width="40%" align="left" valign="top">db_env_set_func_rename��</td> 130 <td width="20%" align="center"> 131 <a accesskey="h" href="index.html">Home</a> 132 </td> 133 <td width="40%" align="right" valign="top">��db_env_set_func_unlink</td> 134 </tr> 135 </table> 136 </div> 137 </body> 138</html> 139