diff options
| author | Meco Man <[email protected]> | 2021-09-11 15:34:59 -0400 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-09-11 15:42:37 -0400 |
| commit | 2c525ecd43cfee01cffd4d1d289ebdb5935674a5 (patch) | |
| tree | 11d51f72e0f88e8c3870cd4b387371737340e43f /components/dfs/include | |
| parent | ee55c58ce43cf2405481db11df187af3aff74eb4 (diff) | |
将dfs_posix.h的函数声明转移到unix标准头文件中
Diffstat (limited to 'components/dfs/include')
| -rw-r--r-- | components/dfs/include/dfs.h | 8 | ||||
| -rw-r--r-- | components/dfs/include/dfs_posix.h | 41 |
2 files changed, 4 insertions, 45 deletions
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 <dirent.h> #include <fcntl.h> #include <sys/stat.h> +#include <sys/statfs.h> #include <sys/time.h> #include <rtdevice.h> @@ -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 <dfs_file.h> +#include <unistd.h> +#include <stdio.h> /* rename() */ #include <sys/stat.h> - -#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 <sys/statfs.h> /* statfs() */ #endif |
