bytecodealliance / bytecodealliance/wasmtime

wasip3: unexpected error for mkdirat("")

Open
#11,607 6 comments 0 reactions 0 assignees View on GitHub
bug wasi wasi:impl
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 19h
Merged PRs (30d)
121

Description

Consider this test for an open `Descriptor` on a directory, `dirfd`:
```rust
assert_eq!(dirfd.create_directory_at("".to_string()).await,
Err(ErrorCode::Invalid));
```

I think `Invalid` is the right error. However instead the error is `NoEntry`, which corresponds to [this `statx` documentation](https://man7.org/linux/man-pages/man2/statx.2.html#ERRORS):

```
ENOENT A component of pathname does not exist, or pathname is an empty string and AT_EMPTY_PATH was not specified in flags.
```

I think that these "at" WASI interfaces should instead avoid syscalling for `""`, and instead return `Invalid`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.