summary refs log tree commit diff
path: root/src/lock_ex.c
blob: b75a7644471612cf47be726ec28baf3af75ab2d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Public domain. */

#include <sys/types.h>
#include <sys/file.h>
#include <fcntl.h>
#include "hasflock.h"
#include "lock.h"

#ifdef HASFLOCK
int lock_ex(int fd) { return flock(fd,LOCK_EX); }
#else
int lock_ex(int fd) { return lockf(fd,1,0); }
#endif