lockf (SunOS) lockf (SunOS)
NAME
lockf - Controls open file descriptors
SUN OS SYNOPSIS
#include <unistd.h>
int lockf(
int filedes,
int request,
long size );
DIGITAL UNIX SYNOPSIS
#include <unistd.h>
int lockf(
int filedes,
int request,
off_t size );
PARAMETERS
Specifies the file to which the lock is to be applied or removed. The
file descriptor is returned by a successful open() or fcntl() function.
Specifies one of the following constants for the lockf() function:
Unlocks a previously locked region in the file. Locks the region for
exclusive use. This request causes the calling process to sleep if the
region overlaps a locked region, and to resume when it is granted the
lock. Same as F_LOCK, except that the request returns an error if the
region overlaps a locked region. Tests to see if another process has
already locked a region. The lockf() function returns 0 (zero) if the
region is unlocked. If the region is locked, then -1 is returned and
errno is set to [EACCES]. The number of bytes to be locked or unlocked
for the lockf() function. The region starts at the current location in
the open file and extends forward if size is positive and backward if
size is negative. If the size parameter is 0 (zero), the region starts
at the current location and extends forward to the maximum possible
file size, including the unallocated space after the end of the file.
DIFFERENCES
Changes the declaration of size from long to off_t.
RELATED INFORMATION
Digital UNIX Functions:
lockf(3) delim off
lockf (SunOS)