This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
DEFFILEMODE and friends
- From: "Yaakov (Cygwin/X)" <yselkowitz at users dot sourceforge dot net>
- To: newlib at sources dot redhat dot com
- Date: Mon, 28 Jun 2010 17:07:17 -0500
- Subject: DEFFILEMODE and friends
The ACCESSPERMS, ALLPERMS, and DEFFILEMODE macros originate from BSD but
have been provided by glibc for some time. Patch attached.
Yaakov
Cygwin/X
2010-06-28 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* libc/include/sys/stat.h: Add ACCESSPERMS, ALLPERMS, and DEFFILEMODE.
Index: libc/include/sys/stat.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/stat.h,v
retrieving revision 1.21
diff -u -r1.21 stat.h
--- libc/include/sys/stat.h 17 Dec 2009 19:22:23 -0000 1.21
+++ libc/include/sys/stat.h 28 Jun 2010 21:49:38 -0000
@@ -122,6 +122,12 @@
#define S_IWOTH 0000002 /* write permission, other */
#define S_IXOTH 0000001/* execute/search permission, other */
+#ifndef _POSIX_SOURCE
+#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* 0777 */
+#define ALLPERMS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) /* 07777 */
+#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) /* 0666 */
+#endif
+
#define S_ISBLK(m) (((m)&_IFMT) == _IFBLK)
#define S_ISCHR(m) (((m)&_IFMT) == _IFCHR)
#define S_ISDIR(m) (((m)&_IFMT) == _IFDIR)