/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
util/system/flock.h
35 строк
619 B
qkrorlqr
Initial NBS OpenSource export
28 апр 2023, 21:54
28 апр 2023, 21:54
783a858
Код
Авторство
О чём код?
#pragma once #include "error.h" #include "defaults.h" #include "file.h" #if defined(_unix_) #include <sys/file.h> #include <fcntl.h> static inline int Flock(int fd, int op) { return flock(fd, op); } #else // not _unix_ #ifdef __cplusplus extern "C" { #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 */ int Flock(void* hndl, int operation); int flock(int fd, int operation); int fsync(int fd); #ifdef __cplusplus } #endif #endif // not _unix_