1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
9 #include "cm_sys_stat.h"
11 namespace cmFSPermissions {
13 // Table of permissions flags.
14 #if defined(_WIN32) && !defined(__CYGWIN__)
15 static const mode_t mode_owner_read = S_IREAD;
16 static const mode_t mode_owner_write = S_IWRITE;
17 static const mode_t mode_owner_execute = S_IEXEC;
18 static const mode_t mode_group_read = 040;
19 static const mode_t mode_group_write = 020;
20 static const mode_t mode_group_execute = 010;
21 static const mode_t mode_world_read = 04;
22 static const mode_t mode_world_write = 02;
23 static const mode_t mode_world_execute = 01;
24 static const mode_t mode_setuid = 04000;
25 static const mode_t mode_setgid = 02000;
27 static const mode_t mode_owner_read = S_IRUSR;
28 static const mode_t mode_owner_write = S_IWUSR;
29 static const mode_t mode_owner_execute = S_IXUSR;
30 static const mode_t mode_group_read = S_IRGRP;
31 static const mode_t mode_group_write = S_IWGRP;
32 static const mode_t mode_group_execute = S_IXGRP;
33 static const mode_t mode_world_read = S_IROTH;
34 static const mode_t mode_world_write = S_IWOTH;
35 static const mode_t mode_world_execute = S_IXOTH;
36 static const mode_t mode_setuid = S_ISUID;
37 static const mode_t mode_setgid = S_ISGID;
40 bool stringToModeT(std::string const& arg, mode_t& permissions);