149 lines
5.0 KiB
HTML
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>
|
|
Syntax<br>
|
|
|
|
|
|
<pre>
|
|
#define INCL_DOSERRORS
|
|
#define INCL_DOSFILEMGR
|
|
#include <os2.h>
|
|
|
|
APIRET APIENTRY DosSetFileLocks64(HFILE <em>FileHandle</em>,
|
|
PFILELOCK64 <em>ppUnLockRange</em>,
|
|
PFILELOCK64 <em>ppLockRange</em>,
|
|
ULONG <em>ulTimeOut</em>,
|
|
ULONG <em>ulFlags</em>);
|
|
</pre>
|
|
|
|
Service Program Name: QP0LLIB1<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Default Public Authority: *USE<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Threadsafe: Conditional; see <a href="#USAGE_NOTES">Usage Notes</a>. <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 <<strong>fcntl.h</strong>> file (see <a href="unix13.htm">Header
|
|
Files for UNIX-Type Functions</a>)</li>
|
|
|
|
<li>The <<strong>os2.h</strong>> file (see <a href="unix13.htm">Header
|
|
Files for UNIX-Type Functions</a>)</li>
|
|
|
|
<li>The <<strong>os2def.h</strong>> file (see <a href="unix13.htm">Header
|
|
Files for UNIX-Type Functions</a>)</li>
|
|
|
|
<li>The <<strong>bse.h</strong>> file (see <a href="unix13.htm">Header
|
|
Files for UNIX-Type Functions</a>)</li>
|
|
|
|
<li>The <<strong>bsedos.h</strong>> file (see <a href="unix13.htm">Header
|
|
Files for UNIX-Type Functions</a>)</li>
|
|
|
|
<li>The <<strong>bseerr.h</strong>> 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>
|
|
|