Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
lockf(3)
Edit
PageHistory
Diff
Info
LikePages
LOCKF !!!LOCKF NAME SYNOPSIS DESCRIPTION RETURN VALUE ERRORS CONFORMING TO SEE ALSO ---- !!NAME lockf - apply, test or remove a POSIX lock on an open file !!SYNOPSIS __#include __ __int lockf(int__ fd__, int__ cmd__, off_t__ len__);__ !!DESCRIPTION Apply, test or remove a POSIX lock on an open file. The file is specified by ''fd''. This call is just an interface for fcntl(2). Valid operations are given below: __F_LOCK__ Set an exclusive lock to the file. Only one process may hold an exclusive lock for a given file at a given time. If the file is already locked it blocks until the previous lock is released. __F_TLOCK__ Same as __F_LOCK__ but never blocks and return error instead if the file is already locked. __F_ULOCK__ Unlock the file. __F_TEST__ Test the lock: return 0 if ''fd'' is unlocked or locked by this process; return -1, set ''errno'' to __EACCES__, if another process holds the lock. !!RETURN VALUE On success, zero is returned. On error, -1 is returned, and ''errno'' is set appropriately. !!ERRORS __EAGAIN__ The file is locked and the __LOCK_NB__ flag was selected, or operation is prohibited because the file has been memory-mapped by another process. __EBADF__ ''fd'' is not an open file descriptor. __EDEADLK__ Specified lock operation would cause a deadlock. __EINVAL__ An invalid operation was specified in ''fd''. __ENOLCK__ Too many segment locks open, lock table is full. !!CONFORMING TO SYSV !!SEE ALSO fcntl(2), flock(2) There are also ''locks.txt'' and ''mandatory.txt'' in ''/usr/src/linux/Documentation''. ----
4 pages link to
lockf(3)
:
perlfaq5(1)
perlfunc(1)
Man3l
flock(2)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.