Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to the latest wasi-sysroot. #1342

Merged
merged 1 commit into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ fn test_wasi(target: &str) {
"locale.h",
"malloc.h",
"poll.h",
"sched.h",
"stdbool.h",
"stddef.h",
"stdint.h",
Expand Down
18 changes: 18 additions & 0 deletions src/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ pub type c_long = i32;
pub type c_ulong = u32;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type size_t = usize;
pub type ssize_t = isize;
pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type off_t = i64;
pub type pid_t = i32;
pub type int8_t = i8;
Expand Down Expand Up @@ -619,11 +624,13 @@ extern {
pub fn getenv(s: *const c_char) -> *mut c_char;
pub fn malloc(amt: size_t) -> *mut c_void;
pub fn malloc_usable_size(ptr: *mut c_void) -> size_t;
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
pub fn rand() -> c_int;
pub fn read(fd: c_int, ptr: *mut c_void, size: size_t) -> ssize_t;
pub fn realloc(ptr: *mut c_void, amt: size_t) -> *mut c_void;
pub fn setenv(k: *const c_char, v: *const c_char, a: c_int) -> c_int;
pub fn unsetenv(k: *const c_char) -> c_int;
pub fn clearenv() -> ::c_int;
pub fn write(fd: c_int, ptr: *const c_void, size: size_t) -> ssize_t;
pub static mut environ: *mut *mut c_char;
pub fn fopen(a: *const c_char, b: *const c_char) -> *mut FILE;
Expand Down Expand Up @@ -724,6 +731,7 @@ extern {
pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE)
-> *mut c_char;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtol(
s: *const c_char,
Expand Down Expand Up @@ -822,6 +830,7 @@ extern {
pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
pub fn rewinddir(dirp: *mut ::DIR);
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;

pub fn openat(
dirfd: ::c_int,
Expand Down Expand Up @@ -902,9 +911,11 @@ extern {
pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;

pub fn fsync(fd: ::c_int) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;

pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;

pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;

pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
Expand Down Expand Up @@ -954,6 +965,11 @@ extern {
whence: ::c_int,
) -> ::c_int;
pub fn ftello(stream: *mut ::FILE) -> ::off_t;
pub fn posix_fallocate(
fd: ::c_int,
offset: ::off_t,
len: ::off_t,
) -> ::c_int;

pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
pub fn getline(
Expand Down Expand Up @@ -1019,6 +1035,7 @@ extern {
base: ::locale_t,
) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn sched_yield() -> ::c_int;

pub fn __wasilibc_register_preopened_fd(
fd: c_int,
Expand All @@ -1034,6 +1051,7 @@ extern {
rights_inheriting: __wasi_rights_t,
relative_path: *mut *const c_char,
) -> c_int;
pub fn __wasilibc_tell(fd: c_int) -> ::off_t;

pub fn arc4random() -> u32;
pub fn arc4random_buf(a: *mut c_void, b: size_t);
Expand Down