2 ** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
3 ** distribution information.
14 #include <sys/fcntl.h>
18 int ll_lockfd(int fd
, int ltype
, LL_OFFSET_TYPE start
, LL_OFFSET_TYPE len
)
26 ft
.l_type
=ltype
& ll_unlock
? F_UNLCK
:
27 ltype
& ll_writelock
? F_WRLCK
:F_RDLCK
;
28 ft
.l_whence
=ltype
& ll_whence_curpos
? 1:
29 ltype
& ll_whence_end
? 2:0;
33 return (fcntl(fd
, (ltype
& ll_unlock
) == 0 && (ltype
& ll_wait
)
34 ? F_SETLKW
:F_SETLK
, &ft
));