summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-04 02:36:48 +0000
committerbors <bors@rust-lang.org>2021-12-04 02:36:48 +0000
commite497f18d6329f3ad34eebb2b8bc3493d1f269143 (patch)
treeaa6fe188fbeabd2a2d7e6bce12b3b78c52282639
parent1c07f7c321cf3cb61b2135bf7d68d6401c6b4dbd (diff)
parent5e5cf2c18170e5a3e61e51537bb638f062f92c3f (diff)
downloadrust-libc-e497f18d6329f3ad34eebb2b8bc3493d1f269143.tar.gz
Auto merge of #2575 - sunfishcode:sunfishcode/wasi-getcwd, r=Amanieu
Update to the latest released wasi-libc and declare `getcwd`/`chdir` Update to the latest version of wasi-libc which corresponds to the version in the wasi-sdk 14.0 release. And, add declarations for `getcwd` and `chdir`, which are now provided by wasi-libc.
-rw-r--r--ci/docker/wasm32-wasi/Dockerfile2
-rw-r--r--src/wasi.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/ci/docker/wasm32-wasi/Dockerfile b/ci/docker/wasm32-wasi/Dockerfile
index ab057ffb36..874bdc3be4 100644
--- a/ci/docker/wasm32-wasi/Dockerfile
+++ b/ci/docker/wasm32-wasi/Dockerfile
@@ -16,7 +16,7 @@ RUN apt-get update && \
# those breaking changes on `libc`'s own CI
RUN git clone https://github.com/WebAssembly/wasi-libc && \
cd wasi-libc && \
- git reset --hard f2e779e5f1ba4a539937cedeeaa762c1e0c162df
+ git reset --hard ad5133410f66b93a2381db5b542aad5e0964db96
RUN apt-get install -y --no-install-recommends llvm
RUN make -C wasi-libc install -j $(nproc) INSTALL_DIR=/wasi-libc
diff --git a/src/wasi.rs b/src/wasi.rs
index 13a564fc31..b2ca78a9f5 100644
--- a/src/wasi.rs
+++ b/src/wasi.rs
@@ -654,6 +654,8 @@ extern "C" {
pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn sched_yield() -> ::c_int;
+ pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
+ pub fn chdir(dir: *const c_char) -> ::c_int;
pub fn __wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int;