diff options
| author | Bernard Xiong <[email protected]> | 2018-11-10 16:58:07 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-11-10 16:58:07 +0800 |
| commit | e108dfe4a521355c454cf4d61b4297840264080b (patch) | |
| tree | e416b6f1a80ff3245148e3ac27983a888854ec5f /components/dfs | |
| parent | b69baa965809420fc3fcd19dd55fc1126a68c08d (diff) | |
[libc] Fix the _EXFUN issue in newlib
Diffstat (limited to 'components/dfs')
| -rw-r--r-- | components/dfs/include/dfs_posix.h | 4 | ||||
| -rw-r--r-- | components/dfs/src/dfs_posix.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h index 79607fc8b4..bc8ff1c698 100644 --- a/components/dfs/include/dfs_posix.h +++ b/components/dfs/include/dfs_posix.h @@ -41,13 +41,15 @@ int closedir(DIR* d); /* file api*/ int open(const char *file, int flags, ...); int close(int d); -#ifdef RT_USING_NEWLIB + +#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); diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index 59acde1f8c..97531ad59c 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -110,7 +110,7 @@ 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. */ -#ifdef RT_USING_NEWLIB +#if defined(RT_USING_NEWLIB) && defined(_EXFUN) _READ_WRITE_RETURN_TYPE _EXFUN(read, (int fd, void *buf, size_t len)) #else int read(int fd, void *buf, size_t len) @@ -154,7 +154,7 @@ RTM_EXPORT(read); * * @return the actual written data buffer length. */ -#ifdef RT_USING_NEWLIB +#if defined(RT_USING_NEWLIB) && defined(_EXFUN) _READ_WRITE_RETURN_TYPE _EXFUN(write, (int fd, const void *buf, size_t len)) #else int write(int fd, const void *buf, size_t len) |
