瀏覽代碼

Modify the position of libc_rent definition

rcitachi 6 月之前
父節點
當前提交
d9c16efe8f
共有 2 個文件被更改,包括 11 次插入12 次删除
  1. 11 0
      components/libc/compilers/common/include/dirent.h
  2. 0 12
      components/lwp/lwp_syscall.c

+ 11 - 0
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 *);

+ 0 - 12
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;