summaryrefslogtreecommitdiff
path: root/components/dfs/include
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-09-13 08:11:26 +0800
committerGitHub <[email protected]>2021-09-13 08:11:26 +0800
commit38baf89da4662c673dc81a31238639b52334f5dd (patch)
treeb4e18165cf2de2fa4ea0107ce2e9b0d19394d747 /components/dfs/include
parent00eaeb5f52064c40796648a24a2f6aebe1da0348 (diff)
parentc48445a5f7cdf86d9724b1fa2ca9090b433845e7 (diff)
Merge pull request #5053 from mysterywolf/posix
[libc标准化] 将dfs_posix.h的函数声明转移到unix标准头文件中
Diffstat (limited to 'components/dfs/include')
-rw-r--r--components/dfs/include/dfs.h8
-rw-r--r--components/dfs/include/dfs_posix.h41
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