summaryrefslogtreecommitdiff
path: root/include/libc/libc_stat.h
diff options
context:
space:
mode:
authorbernard <[email protected]>2017-10-31 09:52:49 +0800
committerbernard <[email protected]>2017-10-31 09:52:49 +0800
commit7d673f921c5c3d31b492ed1506a2f60ab2efda40 (patch)
tree8935f51873bd966138be837a3e354b68c76bbb07 /include/libc/libc_stat.h
parent6469a748b3c6b50e55de3875f20bfe1b5ca8a88e (diff)
[libc] Adjust libc.
1. Move struct stat to libc_stat.h; 2. Defined a new FD_SET macros in libc_fdset.h.
Diffstat (limited to 'include/libc/libc_stat.h')
-rw-r--r--include/libc/libc_stat.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/libc/libc_stat.h b/include/libc/libc_stat.h
index 1622bedd84..36ccd322d5 100644
--- a/include/libc/libc_stat.h
+++ b/include/libc/libc_stat.h
@@ -1,6 +1,12 @@
#ifndef LIBC_STAT_H__
#define LIBC_STAT_H__
+#include <rtconfig.h>
+
+#ifdef RT_USING_NEWLIB
+/* use header file of newlib */
+#include <sys/stat.h>
+#else
#define S_IFMT 00170000
#define S_IFSOCK 0140000
#define S_IFLNK 0120000
@@ -36,5 +42,19 @@
#define S_IWOTH 00002
#define S_IXOTH 00001
+/* stat structure */
+#include <stdint.h>
+#include <time.h>
+
+struct stat
+{
+ struct rt_device* st_dev;
+ uint16_t st_mode;
+ uint32_t st_size;
+ time_t st_mtime;
+ uint32_t st_blksize;
+};
+
#endif
+#endif