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

NuttX doesn't have d_ino.
This commit is contained in:
YAMAMOTO Takashi 2022-04-27 18:49:06 +09:00 committed by GitHub
parent 5343411623
commit e1934f2478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -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) {

View File

@ -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