3 * Porting to Minix 2.0.0
4 * Author: Giovanni Falzoni <gfalzoni@pointest.com>
11 #include <sys/types.h>
18 __weak_alias(flock
, _flock
)
22 * Name: int flock(int fd, int mode);
23 * Function: Implements the flock function in Minix.
25 int flock(int fd
, int mode
)
30 memset((void *) &lck
, 0, sizeof(struct flock
));
31 lck
.l_type
= mode
& ~LOCK_NB
;
33 if ((retcode
= fcntl(fd
, mode
& LOCK_NB
? F_SETLK
: F_SETLKW
, &lck
)) < 0 && errno
== EAGAIN
)