wasm-micro-runtime/core/shared/platform/common
komasayuki 67dc2ae0b2
Fix readdir for posix (#3339)
This PR fixes a readir for posix. readdir is not working correctly in rust.

The current WAMR's readdir implementation for posix is, if readdir returns 0,
it will exit with an error. But posix readdir returns 0 at the end of the directory.
To handle this correctly, if readdir returns 0, it should only raise an error if
errno has changed. We can reproduce it with the following rust code:

```rust
use std::fs;

fn main() {
    let entries  = fs::read_dir(".").unwrap();
    for entry in entries {
        println!("read_dir:{:?}", entry);
    }
}
```
2024-04-22 13:54:19 +08:00
..
freertos freertos: Thread exit more common (#3094) 2024-01-26 18:38:55 +08:00
libc-util Move WASI types into separate header (#2724) 2023-11-07 09:39:15 +08:00
math Fix zephyr sample build errors (#1757) 2022-11-28 11:23:51 +08:00
memory shared-platform: Remove dependency on shared-utils' bh_memory_remap_slow (#3153) 2024-02-17 13:44:33 +08:00
posix Fix readdir for posix (#3339) 2024-04-22 13:54:19 +08:00