Commit Graph

34 Commits

Author SHA1 Message Date
Yuki Okushi 3fae7e9ce7 Fix style 2021-04-06 10:10:29 +09:00
Dan Gohman 197d9227cb WASI: define `AT_FDCWD` and update to latest WASI libc
Update to the latest WASI libc, define `AT_FDCWD`, update the signature
for __wasilibc_find_relpath, and add declarations for various
`__wasilibc_` utility functions.
2021-02-18 14:07:17 -08:00
Yuki Okushi f0009bcc19 Declare `wchar_t` for WASI 2021-02-10 13:02:42 +09:00
Dan Gohman 51af18df79 Define some `sysconf` constants for WASI. 2020-09-13 11:59:19 -07:00
Dan Gohman a02da55c4b Define several more constants for WASI.
Define `O_NOCTTY`, `R_OK`, `POLLIN`, and related constants using the
current values from WASI libc.
2020-09-03 23:05:34 -07:00
Dan Gohman 753ad8205f Add more WASI libc definitions.
This adds various WASI libc definitions to the Rust libc bindings that I
needed while porting some applications to WASI.

It also removes the `pause` binding since newer versions of WASI libc
have removed this function as well. (WASI currently has no syscall with
this functionality.)
2020-07-06 05:50:17 -07:00
Dan Gohman c7011f43a6 Declare `seekdir` and `telldir` for WASI.
These declarations are the same as those for other platforms.
2020-07-01 23:44:33 -07:00
Alex Crichton 93743ca839 Update bindings for the wasm32-wasi target
This commit performs a number of updates for libc with the `wasm32-wasi`
target:

* Updates the `wasi-libc` repository commit used (previously known as
  `wasi-sysroot`)
* Updates the container to Ubuntu 19.10 which has Clang 9 packaged which
  is all we need.
* Avoids building `wasmtime` and instead downloads a precompiled binary.
* Updates bindings in `src/wasi.rs` to match the current upstream state.
2019-12-16 07:57:52 -08:00
gnzlbg 939a2e5a3a Formatting 2019-09-12 15:12:33 +02:00
bors fdbcc119c8 Auto merge of #1461 - newpavlov:patch-4, r=gnzlbg
Remove WASI Core API

Closes #1434

This change does not break the backwards compatibility promise since WASI Core API is unstable right now. If applications or libraries want to use Core API directly they should use [`wasi`](https://crates.io/crates/wasi) instead of `libc`.

Blocked by: rust-lang/rust#63676

cc @sunfishcode
2019-09-07 20:29:09 +00:00
newpavlov 078a7486da add __wasi_rights_t 2019-08-21 18:16:56 +03:00
Luke Petre 6c995607ce Fix style error in wasi.rs 2019-08-18 14:35:33 +01:00
Luke Petre 2b158cefc2 Adding UTIME_NOW and UTIME_OMIT to OSes which support utimensat 2019-08-17 06:37:25 +01:00
Artyom Pavlov e0752783bd
remove types and constants 2019-08-13 20:48:31 +00:00
Artyom Pavlov 8bc9bd338e
remove WASI Core API 2019-08-09 19:21:27 +00:00
Travis Finkenauer cd5235f6e2 wasi: add c_schar definition 2019-06-25 21:55:42 -04:00
gnzlbg 08a4519714 Refactor fixed-width integer types into its own module 2019-05-29 13:05:49 +02:00
Dan Gohman 215cd1549e Update to the latest wasi-sysroot.
- Rename `wasm32-unknown-wasi` to `wasm32-wasi`.
 - `__wasilibc_rmfileat` was renamed to `__wasilibc_unlinkat`
 - Add bindings for a few more functions and typedefs.
2019-05-16 06:40:50 -07:00
gnzlbg 8eceb62a3e Rename _wasi_rmfileat to _wasi_unlinkat 2019-05-16 11:03:45 +02:00
Dan Gohman 13ddc16e06 Remove utsname and uname for now too. 2019-04-24 11:28:45 -07:00
Dan Gohman 599c0f76dd Remove fd_set, select, and pselect entirely for now.
fd_set isn't automatically copyable. While it will be possible to fix
that, for now just remove these so that they don't block other changes.
2019-04-24 08:09:15 -07:00
Dan Gohman 7ba5e34754 Remove the definition of ULONG_SIZE which is no longer needed. 2019-04-24 06:16:28 -07:00
Dan Gohman 4d0e84b8be Use the WASI layout for fd_set. 2019-04-24 05:40:34 -07:00
Dan Gohman edd541e67f Remove FD_SET and related functions for now. 2019-04-23 23:10:38 -07:00
Dan Gohman ef7ae73239 Fix dirent to match WASI libc's definition.
dirent contains a flexible array member, so don't test its sizeof, don't
allow it to be copied, and don't represent it with an artificial size.
2019-04-23 15:03:23 -07:00
Dan Gohman a625c69544 Make FD_ISSET's argument a pointer to const, to match the libc declaration. 2019-04-23 15:03:23 -07:00
Dan Gohman 6b524b36c8 Don't make opaque types like FILE and DIR copyable.
Also, locale_t is a typedef for a pointer to an opaque struct, so
represent it that way explicitly.
2019-04-23 15:03:23 -07:00
Dan Gohman 1168782b3f Define WASI libc errno constants. 2019-04-23 13:26:30 -07:00
Dan Gohman 58ba8129c4 Add more WASI libc bindings. 2019-04-23 13:26:30 -07:00
Alex Crichton cc0310146e Add binding for new `__wasilibc_find_relpath` API
Added recently and will be used in libstd!
2019-04-08 07:56:47 -07:00
Alex Crichton 3f1e8b9c45 Enable the wasi target on CI
Now that wasi is in nightlies, we can run it on PRs!
2019-04-05 08:03:03 -07:00
Alex Crichton bce4454566 Touch up style of wasi.rs 2019-03-27 13:29:18 -07:00
Alex Crichton 8662b47b27 Address some PR feedback 2019-03-27 11:21:44 -07:00
Alex Crichton 87def1fb80 Add intiial support for wasm32-unknown-wasi
This target is [being proposed][LINK] int he rust-lang/rust repository
and this is intended to get coupled with that proposal. The definitions
here all match the upstream reference-sysroot definitions and the
functions all match the reference sysroot as well. The linkage here is
described more in detail on the Rust PR itself, but in general it's
similar to musl.

Automatic verification has been implemented in the same manner as other
targets, and it's been used locally to develop this PR and catch errors
in the bindings already written (also to help match the evolving sysroot
of wasi). The verification isn't hooked up to CI yet though because
there is no wasi target distributed via rustup just yet, but once that's
done I'll file a follow-up PR to execute verification on CI.

[LINK]:
2019-03-27 09:24:48 -07:00