summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-09-14 22:32:15 +0800
committerGitHub <[email protected]>2021-09-14 22:32:15 +0800
commit673718c0a08fe09699765feeed4e499d5df22256 (patch)
tree48da46256f9c6093e0a268c037ff019c99716729 /components
parent8e3112003c53b690d9c757727b91f4a4f96a9b7e (diff)
parente91ffdd1a0af24831d0f7d99c88b6332975ed880 (diff)
Merge pull request #5057 from mysterywolf/posix
[libc] fix the conflict warning of read and write functions
Diffstat (limited to 'components')
-rw-r--r--components/dfs/src/dfs_posix.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c
index be3b039818..ed3fdb2eeb 100644
--- a/components/dfs/src/dfs_posix.c
+++ b/components/dfs/src/dfs_posix.c
@@ -110,7 +110,11 @@ 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 _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
ssize_t read(int fd, void *buf, size_t len)
+#endif
{
int result;
struct dfs_fd *d;
@@ -150,7 +154,11 @@ RTM_EXPORT(read);
*
* @return the actual written data buffer length.
*/
+#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
ssize_t write(int fd, const void *buf, size_t len)
+#endif
{
int result;
struct dfs_fd *d;