diff options
Diffstat (limited to 'lock_ex.c')
| -rw-r--r-- | lock_ex.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lock_ex.c b/lock_ex.c new file mode 100644 index 0000000..a3351c9 --- /dev/null +++ b/lock_ex.c | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #include <sys/types.h> | ||
| 2 | #include <sys/file.h> | ||
| 3 | #include <fcntl.h> | ||
| 4 | #include "hasflock.h" | ||
| 5 | #include "lock.h" | ||
| 6 | |||
| 7 | #ifdef HASFLOCK | ||
| 8 | int lock_ex(fd) int fd; { return flock(fd,LOCK_EX); } | ||
| 9 | #else | ||
| 10 | int lock_ex(fd) int fd; { return lockf(fd,1,0); } | ||
| 11 | #endif | ||
