Skip to content

Commit f0680dc

Browse files
committed
Update to the next version of the witx crate
* Generate adapter functions instead of simply a header file to have a place where adapter code can go. * Implement adapters in terms of the instructions that the `witx` crate tells us about. * Update the interface of functions to what `witx` expects, notably string arguments are now only taken as `char*` and `strlen` happens in the adapter function. * Update defined/predefined/undefined symbol lists for types that have been updated. Some precise generated code has changed but the actual APIs should all be the same except for the change to not take the length of the string in the raw WASI call, since idiomatically C doesn't pass the length of strings around. Eventually it's expected that the shim functions, while sometimes not necessary today, will implement more checks and more conversions as necessary for new APIs.
1 parent f2e779e commit f0680dc

File tree

22 files changed

+1501
-984
lines changed

22 files changed

+1501
-984
lines changed

.gitmodules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "tools/wasi-headers/WASI"]
22
path = tools/wasi-headers/WASI
3-
url = https://github.com/WebAssembly/WASI
3+
url = https://github.com/alexcrichton/WASI
4+
branch = abis

expected/wasm32-wasi/defined-symbols.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,51 @@ __uflow
249249
__unlist_locked_file
250250
__uselocale
251251
__utc
252+
__wasi_args_get
253+
__wasi_args_sizes_get
254+
__wasi_clock_res_get
255+
__wasi_clock_time_get
256+
__wasi_environ_get
257+
__wasi_environ_sizes_get
258+
__wasi_fd_advise
259+
__wasi_fd_allocate
260+
__wasi_fd_close
261+
__wasi_fd_datasync
262+
__wasi_fd_fdstat_get
263+
__wasi_fd_fdstat_set_flags
264+
__wasi_fd_fdstat_set_rights
265+
__wasi_fd_filestat_get
266+
__wasi_fd_filestat_set_size
267+
__wasi_fd_filestat_set_times
268+
__wasi_fd_pread
269+
__wasi_fd_prestat_dir_name
270+
__wasi_fd_prestat_get
271+
__wasi_fd_pwrite
272+
__wasi_fd_read
273+
__wasi_fd_readdir
274+
__wasi_fd_renumber
275+
__wasi_fd_seek
276+
__wasi_fd_sync
277+
__wasi_fd_tell
278+
__wasi_fd_write
279+
__wasi_path_create_directory
280+
__wasi_path_filestat_get
281+
__wasi_path_filestat_set_times
282+
__wasi_path_link
283+
__wasi_path_open
284+
__wasi_path_readlink
285+
__wasi_path_remove_directory
286+
__wasi_path_rename
287+
__wasi_path_symlink
288+
__wasi_path_unlink_file
289+
__wasi_poll_oneoff
290+
__wasi_proc_exit
291+
__wasi_proc_raise
292+
__wasi_random_get
293+
__wasi_sched_yield
294+
__wasi_sock_recv
295+
__wasi_sock_send
296+
__wasi_sock_shutdown
252297
__wasilibc_access
253298
__wasilibc_cwd
254299
__wasilibc_ensure_environ

expected/wasm32-wasi/predefined-macros.txt

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2894,15 +2894,15 @@
28942894
#define __WASI_ERRNO_TIMEDOUT (UINT16_C(73))
28952895
#define __WASI_ERRNO_TXTBSY (UINT16_C(74))
28962896
#define __WASI_ERRNO_XDEV (UINT16_C(75))
2897-
#define __WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP (UINT16_C(1))
2897+
#define __WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP ((__wasi_eventrwflags_t)(1 << 0))
28982898
#define __WASI_EVENTTYPE_CLOCK (UINT8_C(0))
28992899
#define __WASI_EVENTTYPE_FD_READ (UINT8_C(1))
29002900
#define __WASI_EVENTTYPE_FD_WRITE (UINT8_C(2))
2901-
#define __WASI_FDFLAGS_APPEND (UINT16_C(1))
2902-
#define __WASI_FDFLAGS_DSYNC (UINT16_C(2))
2903-
#define __WASI_FDFLAGS_NONBLOCK (UINT16_C(4))
2904-
#define __WASI_FDFLAGS_RSYNC (UINT16_C(8))
2905-
#define __WASI_FDFLAGS_SYNC (UINT16_C(16))
2901+
#define __WASI_FDFLAGS_APPEND ((__wasi_fdflags_t)(1 << 0))
2902+
#define __WASI_FDFLAGS_DSYNC ((__wasi_fdflags_t)(1 << 1))
2903+
#define __WASI_FDFLAGS_NONBLOCK ((__wasi_fdflags_t)(1 << 2))
2904+
#define __WASI_FDFLAGS_RSYNC ((__wasi_fdflags_t)(1 << 3))
2905+
#define __WASI_FDFLAGS_SYNC ((__wasi_fdflags_t)(1 << 4))
29062906
#define __WASI_FILETYPE_BLOCK_DEVICE (UINT8_C(1))
29072907
#define __WASI_FILETYPE_CHARACTER_DEVICE (UINT8_C(2))
29082908
#define __WASI_FILETYPE_DIRECTORY (UINT8_C(3))
@@ -2911,50 +2911,50 @@
29112911
#define __WASI_FILETYPE_SOCKET_STREAM (UINT8_C(6))
29122912
#define __WASI_FILETYPE_SYMBOLIC_LINK (UINT8_C(7))
29132913
#define __WASI_FILETYPE_UNKNOWN (UINT8_C(0))
2914-
#define __WASI_FSTFLAGS_ATIM (UINT16_C(1))
2915-
#define __WASI_FSTFLAGS_ATIM_NOW (UINT16_C(2))
2916-
#define __WASI_FSTFLAGS_MTIM (UINT16_C(4))
2917-
#define __WASI_FSTFLAGS_MTIM_NOW (UINT16_C(8))
2918-
#define __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW (UINT32_C(1))
2919-
#define __WASI_OFLAGS_CREAT (UINT16_C(1))
2920-
#define __WASI_OFLAGS_DIRECTORY (UINT16_C(2))
2921-
#define __WASI_OFLAGS_EXCL (UINT16_C(4))
2922-
#define __WASI_OFLAGS_TRUNC (UINT16_C(8))
2914+
#define __WASI_FSTFLAGS_ATIM ((__wasi_fstflags_t)(1 << 0))
2915+
#define __WASI_FSTFLAGS_ATIM_NOW ((__wasi_fstflags_t)(1 << 1))
2916+
#define __WASI_FSTFLAGS_MTIM ((__wasi_fstflags_t)(1 << 2))
2917+
#define __WASI_FSTFLAGS_MTIM_NOW ((__wasi_fstflags_t)(1 << 3))
2918+
#define __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW ((__wasi_lookupflags_t)(1 << 0))
2919+
#define __WASI_OFLAGS_CREAT ((__wasi_oflags_t)(1 << 0))
2920+
#define __WASI_OFLAGS_DIRECTORY ((__wasi_oflags_t)(1 << 1))
2921+
#define __WASI_OFLAGS_EXCL ((__wasi_oflags_t)(1 << 2))
2922+
#define __WASI_OFLAGS_TRUNC ((__wasi_oflags_t)(1 << 3))
29232923
#define __WASI_PREOPENTYPE_DIR (UINT8_C(0))
2924-
#define __WASI_RIFLAGS_RECV_PEEK (UINT16_C(1))
2925-
#define __WASI_RIFLAGS_RECV_WAITALL (UINT16_C(2))
2926-
#define __WASI_RIGHTS_FD_ADVISE (UINT64_C(128))
2927-
#define __WASI_RIGHTS_FD_ALLOCATE (UINT64_C(256))
2928-
#define __WASI_RIGHTS_FD_DATASYNC (UINT64_C(1))
2929-
#define __WASI_RIGHTS_FD_FDSTAT_SET_FLAGS (UINT64_C(8))
2930-
#define __WASI_RIGHTS_FD_FILESTAT_GET (UINT64_C(2097152))
2931-
#define __WASI_RIGHTS_FD_FILESTAT_SET_SIZE (UINT64_C(4194304))
2932-
#define __WASI_RIGHTS_FD_FILESTAT_SET_TIMES (UINT64_C(8388608))
2933-
#define __WASI_RIGHTS_FD_READ (UINT64_C(2))
2934-
#define __WASI_RIGHTS_FD_READDIR (UINT64_C(16384))
2935-
#define __WASI_RIGHTS_FD_SEEK (UINT64_C(4))
2936-
#define __WASI_RIGHTS_FD_SYNC (UINT64_C(16))
2937-
#define __WASI_RIGHTS_FD_TELL (UINT64_C(32))
2938-
#define __WASI_RIGHTS_FD_WRITE (UINT64_C(64))
2939-
#define __WASI_RIGHTS_PATH_CREATE_DIRECTORY (UINT64_C(512))
2940-
#define __WASI_RIGHTS_PATH_CREATE_FILE (UINT64_C(1024))
2941-
#define __WASI_RIGHTS_PATH_FILESTAT_GET (UINT64_C(262144))
2942-
#define __WASI_RIGHTS_PATH_FILESTAT_SET_SIZE (UINT64_C(524288))
2943-
#define __WASI_RIGHTS_PATH_FILESTAT_SET_TIMES (UINT64_C(1048576))
2944-
#define __WASI_RIGHTS_PATH_LINK_SOURCE (UINT64_C(2048))
2945-
#define __WASI_RIGHTS_PATH_LINK_TARGET (UINT64_C(4096))
2946-
#define __WASI_RIGHTS_PATH_OPEN (UINT64_C(8192))
2947-
#define __WASI_RIGHTS_PATH_READLINK (UINT64_C(32768))
2948-
#define __WASI_RIGHTS_PATH_REMOVE_DIRECTORY (UINT64_C(33554432))
2949-
#define __WASI_RIGHTS_PATH_RENAME_SOURCE (UINT64_C(65536))
2950-
#define __WASI_RIGHTS_PATH_RENAME_TARGET (UINT64_C(131072))
2951-
#define __WASI_RIGHTS_PATH_SYMLINK (UINT64_C(16777216))
2952-
#define __WASI_RIGHTS_PATH_UNLINK_FILE (UINT64_C(67108864))
2953-
#define __WASI_RIGHTS_POLL_FD_READWRITE (UINT64_C(134217728))
2954-
#define __WASI_RIGHTS_SOCK_SHUTDOWN (UINT64_C(268435456))
2955-
#define __WASI_ROFLAGS_RECV_DATA_TRUNCATED (UINT16_C(1))
2956-
#define __WASI_SDFLAGS_RD (UINT8_C(1))
2957-
#define __WASI_SDFLAGS_WR (UINT8_C(2))
2924+
#define __WASI_RIFLAGS_RECV_PEEK ((__wasi_riflags_t)(1 << 0))
2925+
#define __WASI_RIFLAGS_RECV_WAITALL ((__wasi_riflags_t)(1 << 1))
2926+
#define __WASI_RIGHTS_FD_ADVISE ((__wasi_rights_t)(1 << 7))
2927+
#define __WASI_RIGHTS_FD_ALLOCATE ((__wasi_rights_t)(1 << 8))
2928+
#define __WASI_RIGHTS_FD_DATASYNC ((__wasi_rights_t)(1 << 0))
2929+
#define __WASI_RIGHTS_FD_FDSTAT_SET_FLAGS ((__wasi_rights_t)(1 << 3))
2930+
#define __WASI_RIGHTS_FD_FILESTAT_GET ((__wasi_rights_t)(1 << 21))
2931+
#define __WASI_RIGHTS_FD_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 22))
2932+
#define __WASI_RIGHTS_FD_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 23))
2933+
#define __WASI_RIGHTS_FD_READ ((__wasi_rights_t)(1 << 1))
2934+
#define __WASI_RIGHTS_FD_READDIR ((__wasi_rights_t)(1 << 14))
2935+
#define __WASI_RIGHTS_FD_SEEK ((__wasi_rights_t)(1 << 2))
2936+
#define __WASI_RIGHTS_FD_SYNC ((__wasi_rights_t)(1 << 4))
2937+
#define __WASI_RIGHTS_FD_TELL ((__wasi_rights_t)(1 << 5))
2938+
#define __WASI_RIGHTS_FD_WRITE ((__wasi_rights_t)(1 << 6))
2939+
#define __WASI_RIGHTS_PATH_CREATE_DIRECTORY ((__wasi_rights_t)(1 << 9))
2940+
#define __WASI_RIGHTS_PATH_CREATE_FILE ((__wasi_rights_t)(1 << 10))
2941+
#define __WASI_RIGHTS_PATH_FILESTAT_GET ((__wasi_rights_t)(1 << 18))
2942+
#define __WASI_RIGHTS_PATH_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 19))
2943+
#define __WASI_RIGHTS_PATH_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 20))
2944+
#define __WASI_RIGHTS_PATH_LINK_SOURCE ((__wasi_rights_t)(1 << 11))
2945+
#define __WASI_RIGHTS_PATH_LINK_TARGET ((__wasi_rights_t)(1 << 12))
2946+
#define __WASI_RIGHTS_PATH_OPEN ((__wasi_rights_t)(1 << 13))
2947+
#define __WASI_RIGHTS_PATH_READLINK ((__wasi_rights_t)(1 << 15))
2948+
#define __WASI_RIGHTS_PATH_REMOVE_DIRECTORY ((__wasi_rights_t)(1 << 25))
2949+
#define __WASI_RIGHTS_PATH_RENAME_SOURCE ((__wasi_rights_t)(1 << 16))
2950+
#define __WASI_RIGHTS_PATH_RENAME_TARGET ((__wasi_rights_t)(1 << 17))
2951+
#define __WASI_RIGHTS_PATH_SYMLINK ((__wasi_rights_t)(1 << 24))
2952+
#define __WASI_RIGHTS_PATH_UNLINK_FILE ((__wasi_rights_t)(1 << 26))
2953+
#define __WASI_RIGHTS_POLL_FD_READWRITE ((__wasi_rights_t)(1 << 27))
2954+
#define __WASI_RIGHTS_SOCK_SHUTDOWN ((__wasi_rights_t)(1 << 28))
2955+
#define __WASI_ROFLAGS_RECV_DATA_TRUNCATED ((__wasi_roflags_t)(1 << 0))
2956+
#define __WASI_SDFLAGS_RD ((__wasi_sdflags_t)(1 << 0))
2957+
#define __WASI_SDFLAGS_WR ((__wasi_sdflags_t)(1 << 1))
29582958
#define __WASI_SIGNAL_ABRT (UINT8_C(6))
29592959
#define __WASI_SIGNAL_ALRM (UINT8_C(14))
29602960
#define __WASI_SIGNAL_BUS (UINT8_C(7))
@@ -2986,7 +2986,7 @@
29862986
#define __WASI_SIGNAL_WINCH (UINT8_C(27))
29872987
#define __WASI_SIGNAL_XCPU (UINT8_C(23))
29882988
#define __WASI_SIGNAL_XFSZ (UINT8_C(24))
2989-
#define __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME (UINT16_C(1))
2989+
#define __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME ((__wasi_subclockflags_t)(1 << 0))
29902990
#define __WASI_WHENCE_CUR (UINT8_C(1))
29912991
#define __WASI_WHENCE_END (UINT8_C(2))
29922992
#define __WASI_WHENCE_SET (UINT8_C(0))

expected/wasm32-wasi/undefined-symbols.txt

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -19,48 +19,50 @@ __subtf3
1919
__trunctfdf2
2020
__trunctfsf2
2121
__unordtf2
22-
__wasi_args_get
23-
__wasi_args_sizes_get
24-
__wasi_clock_res_get
25-
__wasi_clock_time_get
26-
__wasi_environ_get
27-
__wasi_environ_sizes_get
28-
__wasi_fd_advise
29-
__wasi_fd_allocate
30-
__wasi_fd_close
31-
__wasi_fd_datasync
32-
__wasi_fd_fdstat_get
33-
__wasi_fd_fdstat_set_flags
34-
__wasi_fd_filestat_get
35-
__wasi_fd_filestat_set_size
36-
__wasi_fd_filestat_set_times
37-
__wasi_fd_pread
38-
__wasi_fd_prestat_dir_name
39-
__wasi_fd_prestat_get
40-
__wasi_fd_pwrite
41-
__wasi_fd_read
42-
__wasi_fd_readdir
43-
__wasi_fd_renumber
44-
__wasi_fd_seek
45-
__wasi_fd_sync
46-
__wasi_fd_tell
47-
__wasi_fd_write
48-
__wasi_path_create_directory
49-
__wasi_path_filestat_get
50-
__wasi_path_filestat_set_times
51-
__wasi_path_link
52-
__wasi_path_open
53-
__wasi_path_readlink
54-
__wasi_path_remove_directory
55-
__wasi_path_rename
56-
__wasi_path_symlink
57-
__wasi_path_unlink_file
58-
__wasi_poll_oneoff
59-
__wasi_proc_exit
60-
__wasi_random_get
61-
__wasi_sched_yield
62-
__wasi_sock_recv
63-
__wasi_sock_send
64-
__wasi_sock_shutdown
22+
__wasi_real_args_get
23+
__wasi_real_args_sizes_get
24+
__wasi_real_clock_res_get
25+
__wasi_real_clock_time_get
26+
__wasi_real_environ_get
27+
__wasi_real_environ_sizes_get
28+
__wasi_real_fd_advise
29+
__wasi_real_fd_allocate
30+
__wasi_real_fd_close
31+
__wasi_real_fd_datasync
32+
__wasi_real_fd_fdstat_get
33+
__wasi_real_fd_fdstat_set_flags
34+
__wasi_real_fd_fdstat_set_rights
35+
__wasi_real_fd_filestat_get
36+
__wasi_real_fd_filestat_set_size
37+
__wasi_real_fd_filestat_set_times
38+
__wasi_real_fd_pread
39+
__wasi_real_fd_prestat_dir_name
40+
__wasi_real_fd_prestat_get
41+
__wasi_real_fd_pwrite
42+
__wasi_real_fd_read
43+
__wasi_real_fd_readdir
44+
__wasi_real_fd_renumber
45+
__wasi_real_fd_seek
46+
__wasi_real_fd_sync
47+
__wasi_real_fd_tell
48+
__wasi_real_fd_write
49+
__wasi_real_path_create_directory
50+
__wasi_real_path_filestat_get
51+
__wasi_real_path_filestat_set_times
52+
__wasi_real_path_link
53+
__wasi_real_path_open
54+
__wasi_real_path_readlink
55+
__wasi_real_path_remove_directory
56+
__wasi_real_path_rename
57+
__wasi_real_path_symlink
58+
__wasi_real_path_unlink_file
59+
__wasi_real_poll_oneoff
60+
__wasi_real_proc_exit
61+
__wasi_real_proc_raise
62+
__wasi_real_random_get
63+
__wasi_real_sched_yield
64+
__wasi_real_sock_recv
65+
__wasi_real_sock_send
66+
__wasi_real_sock_shutdown
6567
__wasm_call_ctors
6668
main

libc-bottom-half/cloudlibc/src/libc/fcntl/openat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int __wasilibc_nocwd_openat_nomode(int fd, const char *path, int oflag) {
7070
__wasi_rights_t fs_rights_base = max & fsb_cur.fs_rights_inheriting;
7171
__wasi_rights_t fs_rights_inheriting = fsb_cur.fs_rights_inheriting;
7272
__wasi_fd_t newfd;
73-
error = __wasi_path_open(fd, lookup_flags, path, strlen(path),
73+
error = __wasi_path_open(fd, lookup_flags, path,
7474
(oflag >> 12) & 0xfff,
7575
fs_rights_base, fs_rights_inheriting, fs_flags,
7676
&newfd);

libc-bottom-half/cloudlibc/src/libc/stdio/renameat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include <string.h>
1111

1212
int __wasilibc_nocwd_renameat(int oldfd, const char *old, int newfd, const char *new) {
13-
__wasi_errno_t error = __wasi_path_rename(oldfd, old, strlen(old),
14-
newfd, new, strlen(new));
13+
__wasi_errno_t error = __wasi_path_rename(oldfd, old, newfd, new);
1514
if (error != 0) {
1615
errno = errno_fixup_directory(oldfd, errno_fixup_directory(newfd, error));
1716
return -1;

libc-bottom-half/cloudlibc/src/libc/sys/stat/fstatat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int __wasilibc_nocwd_fstatat(int fd, const char *restrict path, struct stat *res
2323
// Perform system call.
2424
__wasi_filestat_t internal_stat;
2525
__wasi_errno_t error =
26-
__wasi_path_filestat_get(fd, lookup_flags, path, strlen(path), &internal_stat);
26+
__wasi_path_filestat_get(fd, lookup_flags, path, &internal_stat);
2727
if (error != 0) {
2828
errno = errno_fixup_directory(fd, error);
2929
return -1;

libc-bottom-half/cloudlibc/src/libc/sys/stat/mkdirat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
#include <string.h>
1212

1313
int __wasilibc_nocwd_mkdirat_nomode(int fd, const char *path) {
14-
__wasi_errno_t error = __wasi_path_create_directory(
15-
fd, path, strlen(path));
14+
__wasi_errno_t error = __wasi_path_create_directory(fd, path);
1615
if (error != 0) {
1716
errno = errno_fixup_directory(fd, error);
1817
return -1;

libc-bottom-half/cloudlibc/src/libc/sys/stat/utimensat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int __wasilibc_nocwd_utimensat(int fd, const char *path, const struct timespec t
3131

3232
// Perform system call.
3333
__wasi_errno_t error =
34-
__wasi_path_filestat_set_times(fd, lookup_flags, path, strlen(path), st_atim, st_mtim, flags);
34+
__wasi_path_filestat_set_times(fd, lookup_flags, path, st_atim, st_mtim, flags);
3535
if (error != 0) {
3636
errno = errno_fixup_directory(fd, error);
3737
return -1;

libc-bottom-half/cloudlibc/src/libc/unistd/faccessat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int __wasilibc_nocwd_faccessat(int fd, const char *path, int amode, int flag) {
2222
__wasi_lookupflags_t lookup_flags = __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW;
2323
__wasi_filestat_t file;
2424
__wasi_errno_t error =
25-
__wasi_path_filestat_get(fd, lookup_flags, path, strlen(path), &file);
25+
__wasi_path_filestat_get(fd, lookup_flags, path, &file);
2626
if (error != 0) {
2727
errno = errno_fixup_directory(fd, error);
2828
return -1;

libc-bottom-half/cloudlibc/src/libc/unistd/linkat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ int __wasilibc_nocwd_linkat(int fd1, const char *path1, int fd2, const char *pat
1717
lookup1_flags |= __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW;
1818

1919
// Perform system call.
20-
__wasi_errno_t error = __wasi_path_link(fd1, lookup1_flags, path1, strlen(path1),
21-
fd2, path2, strlen(path2));
20+
__wasi_errno_t error = __wasi_path_link(fd1, lookup1_flags, path1, fd2, path2);
2221
if (error != 0) {
2322
errno = errno_fixup_directory(fd1, errno_fixup_directory(fd2, error));
2423
return -1;

libc-bottom-half/cloudlibc/src/libc/unistd/readlinkat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ssize_t __wasilibc_nocwd_readlinkat(int fd, const char *restrict path, char *res
1313
size_t bufsize) {
1414
size_t bufused;
1515
// TODO: Remove the cast on `buf` once the witx is updated with char8 support.
16-
__wasi_errno_t error = __wasi_path_readlink(fd, path, strlen(path),
16+
__wasi_errno_t error = __wasi_path_readlink(fd, path,
1717
(uint8_t*)buf, bufsize, &bufused);
1818
if (error != 0) {
1919
errno = errno_fixup_directory(fd, error);

libc-bottom-half/cloudlibc/src/libc/unistd/symlinkat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include <unistd.h>
1111

1212
int __wasilibc_nocwd_symlinkat(const char *path1, int fd, const char *path2) {
13-
__wasi_errno_t error =
14-
__wasi_path_symlink(path1, strlen(path1), fd, path2, strlen(path2));
13+
__wasi_errno_t error = __wasi_path_symlink(path1, fd, path2);
1514
if (error != 0) {
1615
errno = errno_fixup_directory(fd, error);
1716
return -1;

0 commit comments

Comments
 (0)