Sfoglia il codice sorgente

sandboxed-system-primitives: Use d_ino=0 for NuttX (#1128)

NuttX doesn't have d_ino.
YAMAMOTO Takashi 3 anni fa
parent
commit
e1934f2478

+ 4 - 0
core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c

@@ -1996,7 +1996,11 @@ wasmtime_ssp_fd_readdir(
         size_t namlen = strlen(de->d_name);
         __wasi_dirent_t cde = {
             .d_next = fo->directory.offset,
+#if CONFIG_HAS_D_INO
             .d_ino = de->d_ino,
+#else
+            .d_ino = 0,
+#endif
             .d_namlen = (uint32)namlen,
         };
         switch (de->d_type) {

+ 6 - 0
core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h

@@ -105,4 +105,10 @@
 #define CONFIG_HAS_STD_ATOMIC 0
 #endif
 
+#if !defined(__NuttX__)
+#define CONFIG_HAS_D_INO 1
+#else
+#define CONFIG_HAS_D_INO 0
+#endif
+
 #endif