This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[patch/ob] sys/stat.h: Move POSIX constants out of !_POSIX_SOURCE
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sourceware dot org
- Date: Fri, 6 Aug 2010 20:26:24 +0200
- Subject: [patch/ob] sys/stat.h: Move POSIX constants out of !_POSIX_SOURCE
- Reply-to: newlib at sourceware dot org
Hi,
I just applied the below patch. For some reason a couple of constants
which are defined by POSIX (S_ISVTX, S_IFMT, etc) were guarded with a
`#ifndef _POSIX_SOURCE'.
Corinna
* libc/include/sys/stat.h: Move all POSIX-defined symbolic constants
out of `#ifndef _POSIX_SOURCE' guard.
Index: libc/include/sys/stat.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/stat.h,v
retrieving revision 1.22
diff -u -p -r1.22 stat.h
--- libc/include/sys/stat.h 1 Jul 2010 08:45:52 -0000 1.22
+++ libc/include/sys/stat.h 6 Aug 2010 18:23:13 -0000
@@ -79,12 +79,13 @@ struct stat
#define S_ISUID 0004000 /* set user id on execution */
#define S_ISGID 0002000 /* set group id on execution */
-#ifndef _POSIX_SOURCE
#define S_ISVTX 0001000 /* save swapped text even after use */
+#ifndef _POSIX_SOURCE
#define S_IREAD 0000400 /* read permission, owner */
#define S_IWRITE 0000200 /* write permission, owner */
#define S_IEXEC 0000100 /* execute/search permission, owner */
#define S_ENFMT 0002000 /* enforcement-mode locking */
+#endif /* !_POSIX_SOURCE */
#define S_IFMT _IFMT
#define S_IFDIR _IFDIR
@@ -94,7 +95,6 @@ struct stat
#define S_IFLNK _IFLNK
#define S_IFSOCK _IFSOCK
#define S_IFIFO _IFIFO
-#endif /* !_POSIX_SOURCE */
#ifdef _WIN32
/* The Windows header files define _S_ forms of these, so we do too
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat