HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
l
lockf(2) lockf(2)
Application Usage
Because in the future the variable errno will be set to EAGAIN rather than EACCES when a section of a
file is already locked by another process, portable application programs should expect and test for either
value. For example:
if (lockf(fd, F_TLOCK, siz) == -1)
if ((errno == EAGAIN) || (errno == EACCES))
/*
* section locked by another process
* check for either EAGAIN or EACCES
* due to different implementations
*/
else if ...
/*
* check for other errors
*/
SEE ALSO
lockd(1M), statd(1M), chmod(2), close(2), creat(2), fcntl(2), creat64(2), open(2), pause(2), read(2), stat(2),
wait(2), write(2), unistd(5).
STANDARDS CONFORMANCE
lockf(): SVID2, SVID3, XPG2
HP-UX Release 11i: December 2000 3 Section 2135
___
___