From d9c16efe8faaff7a179129c2c3143a9def50cf41 Mon Sep 17 00:00:00 2001 From: rcitachi Date: Fri, 1 Nov 2024 19:01:27 +0800 Subject: [PATCH] Modify the position of libc_rent definition --- components/libc/compilers/common/include/dirent.h | 11 +++++++++++ components/lwp/lwp_syscall.c | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/components/libc/compilers/common/include/dirent.h b/components/libc/compilers/common/include/dirent.h index 51451e2d59..b650028e11 100644 --- a/components/libc/compilers/common/include/dirent.h +++ b/components/libc/compilers/common/include/dirent.h @@ -65,6 +65,17 @@ struct dirent }; #endif +#ifdef RT_USING_MUSLLIBC +typedef uint64_t ino_t; +#endif +struct libc_dirent { + ino_t d_ino; + off_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[DIRENT_NAME_MAX]; +}; + int closedir(DIR *); DIR *opendir(const char *); struct dirent *readdir(DIR *); diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index 0bfaff62ad..3239c6cb04 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -4527,18 +4527,6 @@ sysret_t sys_rmdir(const char *path) #endif } -#ifdef RT_USING_MUSLLIBC -typedef uint64_t ino_t; -#endif - -struct libc_dirent { - ino_t d_ino; - off_t d_off; - unsigned short d_reclen; - unsigned char d_type; - char d_name[DIRENT_NAME_MAX]; -}; - sysret_t sys_getdents(int fd, struct libc_dirent *dirp, size_t nbytes) { int ret = -1;