aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/flock.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/system/flock.h
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/flock.h')
-rw-r--r--util/system/flock.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/util/system/flock.h b/util/system/flock.h
index 991f892ae5..797b1970a1 100644
--- a/util/system/flock.h
+++ b/util/system/flock.h
@@ -1,35 +1,35 @@
#pragma once
-#include "error.h"
+#include "error.h"
#include "defaults.h"
#include "file.h"
#if defined(_unix_)
- #include <sys/file.h>
- #include <fcntl.h>
+ #include <sys/file.h>
+ #include <fcntl.h>
+
+static inline int Flock(int fd, int op) {
+ return flock(fd, op);
+}
-static inline int Flock(int fd, int op) {
- return flock(fd, op);
-}
-
#else // not _unix_
- #ifdef __cplusplus
+ #ifdef __cplusplus
extern "C" {
- #endif
+ #endif
- #define LOCK_SH 1 /* shared lock */
- #define LOCK_EX 2 /* exclusive lock */
- #define LOCK_NB 4 /* don't block when locking */
- #define LOCK_UN 8 /* unlock */
+ #define LOCK_SH 1 /* shared lock */
+ #define LOCK_EX 2 /* exclusive lock */
+ #define LOCK_NB 4 /* don't block when locking */
+ #define LOCK_UN 8 /* unlock */
- int Flock(void* hndl, int operation);
- int flock(int fd, int operation);
- int fsync(int fd);
+ int Flock(void* hndl, int operation);
+ int flock(int fd, int operation);
+ int fsync(int fd);
- #ifdef __cplusplus
+ #ifdef __cplusplus
}
- #endif
+ #endif
#endif // not _unix_