aboutsummaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorHakan Kvist <hakan.kvist@sonymobile.com>2012-10-10 08:32:52 +0200
committerElliott Hughes <enh@google.com>2012-11-29 11:53:33 -0800
commitf27b7fb0567a9cbb642be9d98298cb6668e7db39 (patch)
tree99a6559087e9fcb01aa78852e57054c4f0316b7a /libc
parentdea13da3407873e4f3fec9ba1a04b4fdacea07f4 (diff)
downloadandroid_bionic-f27b7fb0567a9cbb642be9d98298cb6668e7db39.tar.gz
android_bionic-f27b7fb0567a9cbb642be9d98298cb6668e7db39.tar.bz2
android_bionic-f27b7fb0567a9cbb642be9d98298cb6668e7db39.zip
Define DEFFILEMODE and friends
Define the macros ACCESSPERMS, ALLPERMS and DEFFILEMODE. These macros originates from BSD but has been available in glibc for quite some time. Change-Id: I429cd30aa4e73f53b153ee7740070cebba166c57
Diffstat (limited to 'libc')
-rw-r--r--libc/include/sys/stat.h7
-rw-r--r--libc/stdio/fopen.c2
-rw-r--r--libc/stdio/freopen.c2
-rw-r--r--libc/stdio/local.h4
4 files changed, 11 insertions, 4 deletions
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index 62e0d8ba1..05b221fb7 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -112,6 +112,13 @@ struct stat {
#define st_mtimensec st_mtime_nsec
#define st_ctimensec st_ctime_nsec
+#ifdef __USE_BSD
+/* Permission macros provided by glibc for compatibility with BSDs. */
+#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
+
extern int chmod(const char *, mode_t);
extern int fchmod(int, mode_t);
extern int mkdir(const char *, mode_t);
diff --git a/libc/stdio/fopen.c b/libc/stdio/fopen.c
index a6cddd306..6d2d882c8 100644
--- a/libc/stdio/fopen.c
+++ b/libc/stdio/fopen.c
@@ -31,6 +31,8 @@
* SUCH DAMAGE.
*/
+#define __USE_BSD
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/libc/stdio/freopen.c b/libc/stdio/freopen.c
index da3a674c9..f0386e970 100644
--- a/libc/stdio/freopen.c
+++ b/libc/stdio/freopen.c
@@ -31,6 +31,8 @@
* SUCH DAMAGE.
*/
+#define __USE_BSD
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/libc/stdio/local.h b/libc/stdio/local.h
index 6b2111a2b..664cec1ba 100644
--- a/libc/stdio/local.h
+++ b/libc/stdio/local.h
@@ -35,10 +35,6 @@
#include "wcio.h"
#include "fileext.h"
-#ifndef DEFFILEMODE
-#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
-#endif
-
/*
* Information local to this implementation of stdio,