From 2c525ecd43cfee01cffd4d1d289ebdb5935674a5 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sat, 11 Sep 2021 15:34:59 -0400 Subject: 将dfs_posix.h的函数声明转移到unix标准头文件中 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/include/dfs.h | 8 +------- components/dfs/include/dfs_posix.h | 41 +++----------------------------------- 2 files changed, 4 insertions(+), 45 deletions(-) (limited to 'components/dfs') diff --git a/components/dfs/include/dfs.h b/components/dfs/include/dfs.h index 9f112f9656..38f19aa7e7 100644 --- a/components/dfs/include/dfs.h +++ b/components/dfs/include/dfs.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -68,13 +69,6 @@ extern "C" { #define DFS_F_EOF 0x04000000 #define DFS_F_ERR 0x08000000 -struct statfs -{ - size_t f_bsize; /* block size */ - size_t f_blocks; /* total data blocks in file system */ - size_t f_bfree; /* free blocks in file system */ -}; - struct dfs_fdtable { uint32_t maxfd; diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h index 98da0f854f..ee62cdde82 100644 --- a/components/dfs/include/dfs_posix.h +++ b/components/dfs/include/dfs_posix.h @@ -16,44 +16,9 @@ #define __DFS_POSIX_H__ #include +#include +#include /* rename() */ #include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* file api*/ - -int close(int d); - -#if defined(RT_USING_NEWLIB) && defined(_EXFUN) -_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte)); -_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte)); -#else -int read(int fd, void *buf, size_t len); -int write(int fd, const void *buf, size_t len); -#endif - -off_t lseek(int fd, off_t offset, int whence); -int rename(const char *from, const char *to); -int unlink(const char *pathname); -int fsync(int fildes); -int ftruncate(int fd, off_t length); - -/* directory api*/ -int rmdir(const char *path); -int chdir(const char *path); -char *getcwd(char *buf, size_t size); - -/* file system api */ -int statfs(const char *path, struct statfs *buf); - -int access(const char *path, int amode); -int pipe(int fildes[2]); - -#ifdef __cplusplus -} -#endif +#include /* statfs() */ #endif -- cgit v1.3.1