2 ** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
3 ** distribution information.
6 /* $Id: lockflock.c,v 1.3 1999/12/06 13:18:55 mrsam Exp $ */
10 #include <sys/types.h>
15 #include <sys/fcntl.h>
23 int ll_lockfd(int fd
, int ltype
, LL_OFFSET_TYPE start
, LL_OFFSET_TYPE len
)
26 || (ltype
& ll_whence_curpos
)
27 || (ltype
& ll_whence_end
))
33 return (flock(fd
, ltype
& ll_unlock
? LOCK_UN
:
34 (ltype
& ll_writelock
? LOCK_EX
:LOCK_SH
) |
35 (ltype
& ll_wait
? 0:LOCK_NB
)));