diff options
author | leo <leo@yandex-team.ru> | 2022-02-10 16:46:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:40 +0300 |
commit | 980edcd3304699edf9d4e4d6a656e585028e2a72 (patch) | |
tree | 139f47f3911484ae9af0eb347b1a88bd6c4bb35f /util/system/sysstat.h | |
parent | b036a557f285146e5e35d4213e29a094ab907bcf (diff) | |
download | ydb-980edcd3304699edf9d4e4d6a656e585028e2a72.tar.gz |
Restoring authorship annotation for <leo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/sysstat.h')
-rw-r--r-- | util/system/sysstat.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/util/system/sysstat.h b/util/system/sysstat.h index b7c424c11b..1f4ac613be 100644 --- a/util/system/sysstat.h +++ b/util/system/sysstat.h @@ -1,52 +1,52 @@ -#pragma once - -#include "defaults.h" -#include <sys/stat.h> - -#ifdef _win_ +#pragma once + +#include "defaults.h" +#include <sys/stat.h> + +#ifdef _win_ #define S_IRUSR _S_IREAD #define S_IWUSR _S_IWRITE #define S_IXUSR _S_IEXEC #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) - + #define S_IRGRP _S_IREAD #define S_IWGRP _S_IWRITE #define S_IXGRP _S_IEXEC #define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) - + #define S_IROTH _S_IREAD #define S_IWOTH _S_IWRITE #define S_IXOTH _S_IEXEC #define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) -#endif - -int Chmod(const char* fname, int mode); -int Umask(int mode); - +#endif + +int Chmod(const char* fname, int mode); +int Umask(int mode); + static constexpr int MODE0777 = (S_IRWXU | S_IRWXG | S_IRWXO); static constexpr int MODE0775 = (S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); static constexpr int MODE0755 = (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); - -int Mkdir(const char* path, int mode); - -/* uff... mkfifo(...) is not used now */ - -#ifdef _unix_ -inline int Chmod(const char* fname, int mode) { - return ::chmod(fname, mode); -} -inline int Umask(int mode) { - return ::umask(mode); -} -inline int Mkdir(const char* path, int mode) { - return ::mkdir(path, mode); -} -#endif - -#ifdef _win_ -inline int Umask(int /*mode*/) { - /* The only thing this method could make is to set FILE_ATTRIBUTE_READONLY on a handle from 'int open(...)', - but open() is deprecated. */ - return 0; -} -#endif + +int Mkdir(const char* path, int mode); + +/* uff... mkfifo(...) is not used now */ + +#ifdef _unix_ +inline int Chmod(const char* fname, int mode) { + return ::chmod(fname, mode); +} +inline int Umask(int mode) { + return ::umask(mode); +} +inline int Mkdir(const char* path, int mode) { + return ::mkdir(path, mode); +} +#endif + +#ifdef _win_ +inline int Umask(int /*mode*/) { + /* The only thing this method could make is to set FILE_ATTRIBUTE_READONLY on a handle from 'int open(...)', + but open() is deprecated. */ + return 0; +} +#endif |