ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/dossfl64.htm

149 lines
5.0 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>DosSetFileLocks64()--Lock and Unlock a Byte Range of an Open File (Large
File Enabled)</title>
<!-- Begin Header Records ========================================== -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Unix2 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!-- This file has undergone html cleanup on 05/14/02 by JET -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>DosSetFileLocks64()--Lock and Unlock a Byte Range of an Open File (Large
File Enabled)</h2>
<div class="box" style="width: 75%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#define INCL_DOSERRORS
#define INCL_DOSFILEMGR
#include &lt;os2.h&gt;
APIRET APIENTRY DosSetFileLocks64(HFILE <em>FileHandle</em>,
PFILELOCK64 <em>ppUnLockRange</em>,
PFILELOCK64 <em>ppLockRange</em>,
ULONG <em>ulTimeOut</em>,
ULONG <em>ulFlags</em>);
</pre>
&nbsp;&nbsp;Service Program Name: QP0LLIB1<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Conditional; see <a href="#USAGE_NOTES">Usage Notes</a>.&nbsp;<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>DosSetFileLocks64()</strong> function locks and unlocks a range
of an open file. A non-zero range indicates that a lock or unlock request is
being made.</p>
<p>The DosSetFileLocks64() treats the values specified in the PFILELOCK64
structure as unsigned.</p>
<p>The maximum offset that can be specified using DosSetFileLocks64() is the
largest value that can be held in an 8-byte, unsigned integer, 2<sup>64</sup> -
1.</p>
<p>The maximum length that can be specified using DosSetFileLocks64() is the
largest value that can be held in an 8-byte, unsigned integer, 2<sup>64</sup> -
1.</p>
<p><strong>DosSetFileLocks64()</strong> is enabled for large files. It is
capable of operating on files larger than 2GB minus 1 byte as long as the file
has been opened by either of the following:</p>
<ul>
<li>Using the <strong>open64()</strong> function (see <a href="open64.htm">
open64()--Open File (Large File Enabled)</a>).</li>
<li>Using the <strong>open()</strong> function (see <a href="open.htm">
open()--Open File</a>) with the O_LARGEFILE flag set in the oflag parameter.
Note that the PFILELOCK64 type will hold offsets greater than 2 GB minus 1
byte.</li>
</ul>
<p>For details about parameters, authorities required, error conditions, and
examples, see <a href="dossfllk.htm">DosSetFileLocks()--Lock and Unlock a Byte
Range of an Open File</a>.</p>
<br>
<h3><a name="USAGE_NOTES">Usage Notes</a></h3>
<ol>
<li>When you develop in C-based languages, the prototypes for the 64-bit APIs
are normally hidden. To use the <strong>DosSetFileLocks64()</strong> API and
the PFILELOCK64 data type, you must compile the source with <samp>
_LARGE_FILE_API</samp> defined.</li>
<li>For additional usage notes about this API, see <a href=
"dossfllk.htm#HDRDSFLUSG">Usage Notes</a> in the <strong>
DosSetFileLocks()</strong> API.</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li>The &lt;<strong>fcntl.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)</li>
<li>The &lt;<strong>os2.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)</li>
<li>The &lt;<strong>os2def.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)</li>
<li>The &lt;<strong>bse.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)</li>
<li>The &lt;<strong>bsedos.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)</li>
<li>The &lt;<strong>bseerr.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)</li>
<li><a href="dossfllk.htm">DosSetFileLocks()</a>--Lock and Unlock a Byte Range
of an Open File</li>
</ul>
<br>
<hr>
API introduced: V4R4
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>