rust/src/libstd/sys/redox
Alex Crichton 61b487ca8b wasi: Fill out std::fs module for WASI
This commit fills out the `std::fs` module and implementation for WASI.
Not all APIs are implemented, such as permissions-related ones and
`canonicalize`, but all others APIs have been implemented and very
lightly tested so far. We'll eventually want to run a more exhaustive
test suite!

For now the highlights of this commit are:

* The `std::fs::File` type is now backed by `WasiFd`, a raw WASI file
  descriptor.
* All APIs in `std::fs` (except permissions/canonicalize) have
  implementations for the WASI target.
* A suite of unstable extension traits were added to
  `std::os::wasi::fs`. These traits expose the raw filesystem
  functionality of WASI, namely `*at` syscalls (opening a file relative
  to an already opened one, for example). Additionally metadata only
  available on wasi is exposed through these traits.

Perhaps one of the most notable parts is the implementation of
path-taking APIs. WASI actually has no fundamental API that just takes a
path, but rather everything is relative to a previously opened file
descriptor. To allow existing APIs to work (that only take a path) WASI
has a few syscalls to learn about "pre opened" file descriptors by the
runtime. We use these to build a map of existing directory names to file
descriptors, and then when using a path we try to anchor it at an
already-opened file.

This support is very rudimentary though and is intended to be shared
with C since it's likely to be so tricky. For now though the C library
doesn't expose quite an API for us to use, so we implement it for now
and will swap it out as soon as one is available.
2019-04-03 08:05:46 -07:00
..
backtrace libstd: deny(elided_lifetimes_in_paths), fixes in redox 2019-03-31 14:33:50 +02:00
ext libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
net Rollup merge of #59106 - LinusU:udp-peer-addr, r=kennytm 2019-03-22 19:31:16 +01:00
syscall libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
args.rs libstd => 2018 2019-02-28 04:06:15 +09:00
cmath.rs Remove licenses 2018-12-25 21:08:33 -07:00
condvar.rs libstd => 2018 2019-02-28 04:06:15 +09:00
env.rs Remove licenses 2018-12-25 21:08:33 -07:00
fast_thread_local.rs libstd => 2018 2019-02-28 04:06:15 +09:00
fd.rs libstd => 2018 2019-02-28 04:06:15 +09:00
fs.rs wasi: Fill out std::fs module for WASI 2019-04-03 08:05:46 -07:00
io.rs impl Deref/DerefMut for IoVec types 2019-02-13 19:40:17 -08:00
memchr.rs Cosmetic improvements 2019-01-13 19:47:02 +00:00
mod.rs Unify OsString/OsStr for byte-based implementations 2019-03-21 13:45:35 -07:00
mutex.rs libstd => 2018 2019-02-28 04:06:15 +09:00
os.rs libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
path.rs libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
pipe.rs libstd => 2018 2019-02-28 04:06:15 +09:00
process.rs libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
rand.rs Remove licenses 2018-12-25 21:08:33 -07:00
rwlock.rs Remove licenses 2018-12-25 21:08:33 -07:00
stack_overflow.rs Remove licenses 2018-12-25 21:08:33 -07:00
stdio.rs libstd => 2018 2019-02-28 04:06:15 +09:00
thread.rs libstd => 2018 2019-02-28 04:06:15 +09:00
thread_local.rs libstd => 2018 2019-02-28 04:06:15 +09:00
time.rs libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00