summaryrefslogtreecommitdiff
path: root/src/system.h
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-04-26 12:48:12 +0000
committerJim Meyering <jim@meyering.net>1999-04-26 12:48:12 +0000
commit9e37b40aa12d1d0c44e0d1071884931190f23436 (patch)
tree36c5e15f1f1242babe00b2a5e6e79f77bc90cc25 /src/system.h
parentebb207dc5a922631bd9d9177f19538129d7fcefa (diff)
downloadcoreutils-9e37b40aa12d1d0c44e0d1071884931190f23436.tar.xz
(S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO):
Define if not defined. (CHMOD_MODE_BITS): New macro.
Diffstat (limited to 'src/system.h')
-rw-r--r--src/system.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/system.h b/src/system.h
index f49f4b046..201f989a0 100644
--- a/src/system.h
+++ b/src/system.h
@@ -68,6 +68,18 @@
# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR)
#endif
+#if !S_ISUID
+# define S_ISUID 04000
+#endif
+#if !S_ISGID
+# define S_ISGID 02000
+#endif
+
+/* S_ISVTX is a common extension to POSIX.1. */
+#ifndef S_ISVTX
+# define S_ISVTX 01000
+#endif
+
#if !S_IWUSR
# if S_IWRITE
# define S_IWUSR S_IWRITE
@@ -97,10 +109,26 @@
#ifndef S_IXOTH
# define S_IXOTH (S_IEXEC >> 6)
#endif
+
+#ifndef S_IRWXU
+# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
+#endif
+#ifndef S_IRWXG
+# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
+#endif
+#ifndef S_IRWXO
+# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
+#endif
+
+/* S_IXUGO is a common extension to POSIX.1. */
#ifndef S_IXUGO
# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
#endif
+/* All the mode bits that can be affected by chmod. */
+#define CHMOD_MODE_BITS \
+ (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
+
#ifdef ST_MTIM_NSEC
# define ST_TIME_CMP_NS(a, b, ns) ((a).ns < (b).ns ? -1 : (a).ns > (b).ns)
#else