summaryrefslogtreecommitdiff
path: root/lock_exnb.c
blob: 5d2a14ae7757a6c623e5fe4a9883624b62c79cd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <sys/types.h>
#include <sys/file.h>
#include <fcntl.h>
#include "hasflock.h"
#include "lock.h"

#ifdef HASFLOCK
int lock_exnb(fd) int fd; { return flock(fd,LOCK_EX | LOCK_NB); }
#else
int lock_exnb(fd) int fd; { return lockf(fd,2,0); }
#endif