将dfs_posix.h的函数声明转移到unix标准头文件中

This commit is contained in:
Meco Man
2021-09-11 15:34:59 -04:00
parent ee55c58ce4
commit 2c525ecd43
6 changed files with 46 additions and 104 deletions

View File

@@ -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;

View File

@@ -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