summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-misc.h
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-02-26 14:37:06 +1100
committerDarren Tucker <dtucker@dtucker.net>2018-02-26 14:37:06 +1100
commitcd3ab57f9b388f8b1abf601dc4d78ff82d83b75e (patch)
tree6fd98c6a6639d885271b66a27c43c0420755e756 /openbsd-compat/bsd-misc.h
parentb087998d1ba90dd1ddb6bfdb17873dc3e7392798 (diff)
Hook up flock() compat code.
Also a couple of minor changes: fail if we can't lock instead of silently succeeding, and apply a couple of minor style fixes.
Diffstat (limited to 'openbsd-compat/bsd-misc.h')
-rw-r--r--openbsd-compat/bsd-misc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index af2ccdae..2a73ae45 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -145,4 +145,12 @@ int raise(int);
pid_t getsid(pid_t);
#endif
+#ifndef HAVE_FLOCK
+# define LOCK_SH 0x01
+# define LOCK_EX 0x02
+# define LOCK_NB 0x04
+# define LOCK_UN 0x08
+int flock(int, int);
+#endif
+
#endif /* _BSD_MISC_H */