diff options
| author | liukangcc <[email protected]> | 2021-10-14 10:31:44 +0800 |
|---|---|---|
| committer | liukangcc <[email protected]> | 2021-10-14 10:32:22 +0800 |
| commit | 3ac36a31071f66a06217b4676fc7266ba66c906a (patch) | |
| tree | be32fc9b7abb102aa905fdba0165bf6adf4c065d /components/dfs/src | |
| parent | 0369db718cd3b1ff58ceb2fc44a48641a0fecc66 (diff) | |
| parent | 33263d7e4ec22b118d0407ec7488ccfa60a8a0a1 (diff) | |
[update] Fix compiler flags issue
Diffstat (limited to 'components/dfs/src')
| -rw-r--r-- | components/dfs/src/dfs_poll.c (renamed from components/dfs/src/poll.c) | 2 | ||||
| -rw-r--r-- | components/dfs/src/dfs_posix.c | 16 | ||||
| -rw-r--r-- | components/dfs/src/dfs_select.c (renamed from components/dfs/src/select.c) | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/components/dfs/src/poll.c b/components/dfs/src/dfs_poll.c index d1e0372494..607b3487be 100644 --- a/components/dfs/src/poll.c +++ b/components/dfs/src/dfs_poll.c @@ -17,7 +17,7 @@ #include <dfs.h> #include <dfs_file.h> #include <dfs_posix.h> -#include <dfs_poll.h> +#include <poll.h> #ifdef RT_USING_POSIX diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index a7c306366f..acc05fcd53 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -110,10 +110,10 @@ RTM_EXPORT(close); * @return the actual read data buffer length. If the returned value is 0, it * may be reach the end of file, please check errno. */ -#if defined(RT_USING_NEWLIB) && defined(_EXFUN) -_READ_WRITE_RETURN_TYPE _EXFUN(read, (int fd, void *buf, size_t len)) +#ifdef _READ_WRITE_RETURN_TYPE +_READ_WRITE_RETURN_TYPE read(int fd, void *buf, size_t len) /* some gcc tool chains will use different data structure */ #else -int read(int fd, void *buf, size_t len) +ssize_t read(int fd, void *buf, size_t len) #endif { int result; @@ -154,10 +154,10 @@ RTM_EXPORT(read); * * @return the actual written data buffer length. */ -#if defined(RT_USING_NEWLIB) && defined(_EXFUN) -_READ_WRITE_RETURN_TYPE _EXFUN(write, (int fd, const void *buf, size_t len)) +#ifdef _READ_WRITE_RETURN_TYPE +_READ_WRITE_RETURN_TYPE write(int fd, const void *buf, size_t len) /* some gcc tool chains will use different data structure */ #else -int write(int fd, const void *buf, size_t len) +ssize_t write(int fd, const void *buf, size_t len) #endif { int result; @@ -254,6 +254,7 @@ off_t lseek(int fd, off_t offset, int whence) } RTM_EXPORT(lseek); +#ifndef _WIN32 /* we can not implement these functions */ /** * this function is a POSIX compliant version, which will rename old file name * to new file name. @@ -280,6 +281,7 @@ int rename(const char *old_file, const char *new_file) return 0; } RTM_EXPORT(rename); +#endif /** * this function is a POSIX compliant version, which will unlink (remove) a @@ -305,7 +307,6 @@ int unlink(const char *pathname) } RTM_EXPORT(unlink); -#ifndef _WIN32 /* we can not implement these functions */ /** * this function is a POSIX compliant version, which will get file information. * @@ -370,7 +371,6 @@ int fstat(int fildes, struct stat *buf) return RT_EOK; } RTM_EXPORT(fstat); -#endif /** * this function is a POSIX compliant version, which shall request that all data diff --git a/components/dfs/src/select.c b/components/dfs/src/dfs_select.c index c9286ca97f..795b816354 100644 --- a/components/dfs/src/select.c +++ b/components/dfs/src/dfs_select.c @@ -11,8 +11,8 @@ #include <dfs_fs.h> #include <dfs_posix.h> -#include <dfs_poll.h> -#include <dfs_select.h> +#include <poll.h> +#include <sys/select.h> #ifdef RT_USING_POSIX |
