[PATCH 084/114] Add <sys/stat.h> header for Phoenix.
Jakub Sejdak
jakub.sejdak@phoesys.com
Mon Apr 11 10:24:00 GMT 2016
From: Kuba Sejdak <jakub.sejdak@phoesys.com>
---
newlib/libc/sys/phoenix/sys/stat.h | 64 ++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
create mode 100644 newlib/libc/sys/phoenix/sys/stat.h
diff --git a/newlib/libc/sys/phoenix/sys/stat.h b/newlib/libc/sys/phoenix/sys/stat.h
new file mode 100644
index 0000000..79e3317
--- /dev/null
+++ b/newlib/libc/sys/phoenix/sys/stat.h
@@ -0,0 +1,64 @@
+/* Copyright (C) 2012-2016 Phoenix Systems (http://www.phoesys.com/).
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STAT_H
+#define _SYS_STAT_H
+
+#include <phoenix/stat.h>
+#include <sys/types.h>
+
+#define _IFMT 0170000
+#define _IFDIR 0040000
+#define _IFCHR 0020000
+#define _IFBLK 0060000
+#define _IFREG 0100000
+#define _IFLNK 0120000
+#define _IFSOCK 0140000
+#define _IFIFO 0010000
+
+#define S_BLKSIZE 1024
+
+#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. */
+
+#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 */
+
+#define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode)
+#define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+int chmod(const char *pathname, mode_t mode);
+int fchmod(int fd, mode_t mode);
+int stat(const char *pathname, struct stat *buf);
+int fstat(int fd, struct stat *buf);
+int lstat(const char *pathname, struct stat *buf);
+int mkdir(const char *pathname, mode_t mode);
+int mkfifo(const char *pathname, mode_t mode);
+int mknod(const char *pathname, mode_t mode, dev_t dev);
+mode_t umask(mode_t mask);
+
+#ifdef __LARGE64_FILES
+struct stat64;
+int fstat64(int fd, struct stat64 *buf);
+#endif
+
+#endif
--
2.5.0
More information about the Newlib
mailing list