From fed25c720e2779818d6d1b0e76a170b400725326 Mon Sep 17 00:00:00 2001 From: armink Date: Tue, 20 Mar 2018 17:36:08 +0800 Subject: [PATCH 1/3] [Libc][dlib] Add fcntl.h and sys/stat.h to dlib. --- components/libc/compilers/dlib/fcntl.h | 0 components/libc/compilers/dlib/sys/stat.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 components/libc/compilers/dlib/fcntl.h create mode 100644 components/libc/compilers/dlib/sys/stat.h diff --git a/components/libc/compilers/dlib/fcntl.h b/components/libc/compilers/dlib/fcntl.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/libc/compilers/dlib/sys/stat.h b/components/libc/compilers/dlib/sys/stat.h new file mode 100644 index 0000000000..e69de29bb2 From 991baa7a04644c355a7ccaf2d08b837a7657396c Mon Sep 17 00:00:00 2001 From: armink Date: Tue, 20 Mar 2018 17:50:12 +0800 Subject: [PATCH 2/3] [Libc][dlib] Add STDIN_FILENO, STDOUT_FILENO and STDERR_FILENO to dlib sys/unistd.h . --- components/libc/compilers/dlib/sys/unistd.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/libc/compilers/dlib/sys/unistd.h b/components/libc/compilers/dlib/sys/unistd.h index 06a46746c0..dbe4f3010d 100644 --- a/components/libc/compilers/dlib/sys/unistd.h +++ b/components/libc/compilers/dlib/sys/unistd.h @@ -2,6 +2,11 @@ #define _SYS_UNISTD_H #ifdef RT_USING_DFS + +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ + #include #else #define _FREAD 0x0001 /* read enabled */ From c6e928a780cf28a03e963d62a1a731d7675cf134 Mon Sep 17 00:00:00 2001 From: armink Date: Tue, 20 Mar 2018 17:51:12 +0800 Subject: [PATCH 3/3] [Libc] Update struct stat on libc_stat.h . --- include/libc/libc_stat.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/include/libc/libc_stat.h b/include/libc/libc_stat.h index 69871dd101..26752393db 100644 --- a/include/libc/libc_stat.h +++ b/include/libc/libc_stat.h @@ -77,11 +77,23 @@ struct stat { - struct rt_device* st_dev; - uint16_t st_mode; - uint32_t st_size; - time_t st_mtime; - uint32_t st_blksize; + struct rt_device *st_dev; + uint16_t st_ino; + uint16_t st_mode; + uint16_t st_nlink; + uint16_t st_uid; + uint16_t st_gid; + struct rt_device *st_rdev; + uint32_t st_size; + time_t st_atime; + long st_spare1; + time_t st_mtime; + long st_spare2; + time_t st_ctime; + long st_spare3; + uint32_t st_blksize; + uint32_t st_blocks; + long st_spare4[2]; }; #endif