diff options
Diffstat (limited to 'lock_exnb.c')
| -rw-r--r-- | lock_exnb.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lock_exnb.c b/lock_exnb.c new file mode 100644 index 0000000..5d2a14a --- /dev/null +++ b/lock_exnb.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_exnb(fd) int fd; { return flock(fd,LOCK_EX | LOCK_NB); } | ||
| 9 | #else | ||
| 10 | int lock_exnb(fd) int fd; { return lockf(fd,2,0); } | ||
| 11 | #endif | ||
