# Refactor resolve_preopen into getPreopens function · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/8bce1b6981d5ec71100823dfd135402a32d9609b)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 8bce1b6981d5ec71100823dfd135402a32d9609b

Requested commit: 8bce1b6981d5ec71100823dfd135402a32d9609b

Commit: 8bce1b6981d5ec71100823dfd135402a32d9609b

Tree: b5df521eac089658e0cf50ed99cfa15ad88cdd8d

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
Refactor resolve_preopen into getPreopens function

This commit refactors `std.os.wasi.resolve_preopen` into a (higher-level)
`std.os.wasi.getPreopens` funtion which returns a slice with _all_
preopens at any given time. This fn allows the WASI module to
inquire at any given time for all preopens provided by the runtime.

This commit also makes `cwd()` a compile error on WASI.

```

## Parents

- [05fb3e79fecc689def1a4186da8783546e17f1ae](https://git.cafe/gitcafe/zig/commit/05fb3e79fecc689def1a4186da8783546e17f1ae?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/8bce1b6981d5ec71100823dfd135402a32d9609b?format=markdown)
