aboutsummaryrefslogtreecommitdiff
path: root/src/systems.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/systems.h')
-rw-r--r--src/systems.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/systems.h b/src/systems.h
index dd8cfa7..6725471 100644
--- a/src/systems.h
+++ b/src/systems.h
@@ -77,6 +77,32 @@
/* Assume it is done like System V. */
+#if defined(F_SETLK64) && (defined(_LARGE_FILES) || _FILE_OFFSET_BITS == 64)
+#define UNLOCK_FILE(dbf) \
+ { \
+ struct flock64 flock; \
+ flock.l_type = F_UNLCK; \
+ flock.l_whence = SEEK_SET; \
+ flock.l_start = flock.l_len = 0L; \
+ fcntl (dbf->desc, F_SETLK64, &flock); \
+ }
+#define READLOCK_FILE(dbf) \
+ { \
+ struct flock64 flock; \
+ flock.l_type = F_RDLCK; \
+ flock.l_whence = SEEK_SET; \
+ flock.l_start = flock.l_len = 0L; \
+ lock_val = fcntl (dbf->desc, F_SETLK64, &flock); \
+ }
+#define WRITELOCK_FILE(dbf) \
+ { \
+ struct flock64 flock; \
+ flock.l_type = F_WRLCK; \
+ flock.l_whence = SEEK_SET; \
+ flock.l_start = flock.l_len = 0L; \
+ lock_val = fcntl (dbf->desc, F_SETLK64, &flock); \
+ }
+#else
#define UNLOCK_FILE(dbf) \
{ \
struct flock flock; \
@@ -103,6 +129,8 @@
}
#endif
+#endif
+
/* Default block size. Some systems do not have blocksize in their
stat record. This code uses the BSD blocksize from stat. */

Return to:

Send suggestions and report system problems to the System administrator.