Skip to content

Commit e497f18

Browse files
committed
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.
2 parents 1c07f7c + 5e5cf2c commit e497f18

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ci/docker/wasm32-wasi/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN apt-get update && \
1616
# those breaking changes on `libc`'s own CI
1717
RUN git clone https://github.com/WebAssembly/wasi-libc && \
1818
cd wasi-libc && \
19-
git reset --hard f2e779e5f1ba4a539937cedeeaa762c1e0c162df
19+
git reset --hard ad5133410f66b93a2381db5b542aad5e0964db96
2020
RUN apt-get install -y --no-install-recommends llvm
2121
RUN make -C wasi-libc install -j $(nproc) INSTALL_DIR=/wasi-libc
2222

src/wasi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ extern "C" {
654654
pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
655655
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
656656
pub fn sched_yield() -> ::c_int;
657+
pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
658+
pub fn chdir(dir: *const c_char) -> ::c_int;
657659

658660
pub fn __wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int;
659661
pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int;

0 commit comments

Comments
 (0)