DosSetFileLocks64()--Lock and Unlock a Byte Range of an Open File (Large File Enabled)


  Syntax
 #define INCL_DOSERRORS
 #define INCL_DOSFILEMGR
 #include <os2.h>

 APIRET APIENTRY DosSetFileLocks64(HFILE FileHandle,  
                      PFILELOCK64 ppUnLockRange,
                      PFILELOCK64 ppLockRange,
                      ULONG ulTimeOut,
                      ULONG ulFlags);  
  Service Program Name: QP0LLIB1

  Default Public Authority: *USE

  Threadsafe: Conditional; see Usage Notes

The DosSetFileLocks64() function locks and unlocks a range of an open file. A non-zero range indicates that a lock or unlock request is being made.

The DosSetFileLocks64() treats the values specified in the PFILELOCK64 structure as unsigned.

The maximum offset that can be specified using DosSetFileLocks64() is the largest value that can be held in an 8-byte, unsigned integer, 264 - 1.

The maximum length that can be specified using DosSetFileLocks64() is the largest value that can be held in an 8-byte, unsigned integer, 264 - 1.

DosSetFileLocks64() 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:

For details about parameters, authorities required, error conditions, and examples, see DosSetFileLocks()--Lock and Unlock a Byte Range of an Open File.


Usage Notes

  1. When you develop in C-based languages, the prototypes for the 64-bit APIs are normally hidden. To use the DosSetFileLocks64() API and the PFILELOCK64 data type, you must compile the source with _LARGE_FILE_API defined.
  2. For additional usage notes about this API, see Usage Notes in the DosSetFileLocks() API.

Related Information



API introduced: V4R4

[ Back to top | UNIX-Type APIs | APIs by category ]