summaryrefslogtreecommitdiff
path: root/src/wasi.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2019-04-05 08:06:18 -0700
committerAlex Crichton <alex@alexcrichton.com>2019-04-08 07:56:47 -0700
commitcc0310146eb87ca1dee1c8d370be745bf5ad29fd (patch)
tree03d670d8077feaaff0d70f1a805544b4c88e19b1 /src/wasi.rs
parent3f1e8b9c457343402fc733eb7649d3e218788151 (diff)
downloadrust-libc-cc0310146eb87ca1dee1c8d370be745bf5ad29fd.tar.gz
Add binding for new `__wasilibc_find_relpath` API
Added recently and will be used in libstd!
Diffstat (limited to 'src/wasi.rs')
-rw-r--r--src/wasi.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/wasi.rs b/src/wasi.rs
index 6fd3736c15..77c48f50a6 100644
--- a/src/wasi.rs
+++ b/src/wasi.rs
@@ -396,7 +396,7 @@ pub const __WASI_WHENCE_SET: u8 = 2;
feature = "rustc-dep-of-std",
link(name = "c", cfg(not(target_feature = "crt-static")))
)]
-extern "C" {
+extern {
pub fn _Exit(code: c_int) -> !;
pub fn _exit(code: c_int) -> !;
pub fn abort() -> !;
@@ -455,8 +455,8 @@ extern "C" {
pub fn puts(a: *const c_char) -> c_int;
pub fn perror(a: *const c_char);
pub fn srand(a: c_uint);
- pub fn atexit(a: extern "C" fn()) -> c_int;
- pub fn at_quick_exit(a: extern "C" fn()) -> c_int;
+ pub fn atexit(a: extern fn()) -> c_int;
+ pub fn at_quick_exit(a: extern fn()) -> c_int;
pub fn quick_exit(a: c_int) -> !;
pub fn posix_memalign(a: *mut *mut c_void, b: size_t, c: size_t) -> c_int;
pub fn rand_r(a: *mut c_uint) -> c_int;
@@ -497,6 +497,12 @@ extern "C" {
pub fn __wasilibc_rmfileat(fd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_init_preopen();
+ pub fn __wasilibc_find_relpath(
+ path: *const c_char,
+ rights_base: __wasi_rights_t,
+ rights_inheriting: __wasi_rights_t,
+ relative_path: *mut *const c_char,
+ ) -> c_int;
pub fn arc4random() -> u32;
pub fn arc4random_buf(a: *mut c_void, b: size_t);
@@ -504,7 +510,7 @@ extern "C" {
}
#[link(wasm_import_module = "wasi_unstable")]
-extern "C" {
+extern {
#[link_name = "clock_res_get"]
pub fn __wasi_clock_res_get(
clock_id: __wasi_clockid_t,