| ... | @@ -939,6 +939,58 @@ uint32_t wasi_snapshot_preview1_path_remove_directory(uint32_t fd, uint32_t path | ... | @@ -939,6 +939,58 @@ uint32_t wasi_snapshot_preview1_path_remove_directory(uint32_t fd, uint32_t path |
| 939 | return wasi_errno_success; | 939 | return wasi_errno_success; |
| 940 | } | 940 | } |
| 941 | | 941 | |
| | 942 | uint32_t wasi_snapshot_preview1_path_symlink(uint32_t old_path, uint32_t old_path_len, uint32_t fd, uint32_t new_path, uint32_t new_path_len) { |
| | 943 | uint8_t *const m = *wasm_memory; |
| | 944 | const char *old_path_ptr = (const char *)&m[old_path]; |
| | 945 | const char *new_path_ptr = (const char *)&m[new_path]; |
| | 946 | #if LOG_TRACE |
| | 947 | fprintf(stderr, "wasi_snapshot_preview1_path_symlink(\"%.*s\", %u, \"%.*s\")\n", (int)old_path_len, old_path_ptr, fd, (int)new_path_len, new_path_ptr); |
| | 948 | #endif |
| | 949 | (void)old_path_ptr; |
| | 950 | (void)old_path_len; |
| | 951 | (void)fd; |
| | 952 | (void)new_path_ptr; |
| | 953 | (void)new_path_len; |
| | 954 | panic("unimplemented: path_symlink"); |
| | 955 | return wasi_errno_success; |
| | 956 | } |
| | 957 | |
| | 958 | uint32_t wasi_snapshot_preview1_path_readlink(uint32_t fd, uint32_t path, uint32_t path_len, uint32_t buf, uint32_t buf_len, uint32_t out_len) { |
| | 959 | uint8_t *const m = *wasm_memory; |
| | 960 | const char *path_ptr = (const char *)&m[path]; |
| | 961 | char *buf_ptr = (char *)&m[buf]; |
| | 962 | uint32_t *out_len_ptr = (uint32_t *)&m[out_len]; |
| | 963 | #if LOG_TRACE |
| | 964 | fprintf(stderr, "wasi_snapshot_preview1_path_readlink(%u, \"%.*s\", 0x%X, %u, 0x%X)\n", fd, (int)path_len, path_ptr, buf, buf_len, out_len); |
| | 965 | #endif |
| | 966 | (void)fd; |
| | 967 | (void)path_ptr; |
| | 968 | (void)path_len; |
| | 969 | (void)buf_ptr; |
| | 970 | (void)buf_len; |
| | 971 | (void)out_len_ptr; |
| | 972 | panic("unimplemented: path_readlink"); |
| | 973 | return wasi_errno_success; |
| | 974 | } |
| | 975 | |
| | 976 | uint32_t wasi_snapshot_preview1_path_link(uint32_t old_fd, uint32_t old_flags, uint32_t old_path, uint32_t old_path_len, uint32_t new_fd, uint32_t new_path, uint32_t new_path_len) { |
| | 977 | uint8_t *const m = *wasm_memory; |
| | 978 | const char *old_path_ptr = (const char *)&m[old_path]; |
| | 979 | const char *new_path_ptr = (const char *)&m[new_path]; |
| | 980 | #if LOG_TRACE |
| | 981 | fprintf(stderr, "wasi_snapshot_preview1_path_link(%u, 0x%X, \"%.*s\", %u, \"%.*s\")\n", old_fd, old_flags, (int)old_path_len, old_path_ptr, new_fd, (int)new_path_len, new_path_ptr); |
| | 982 | #endif |
| | 983 | (void)old_fd; |
| | 984 | (void)old_flags; |
| | 985 | (void)old_path_ptr; |
| | 986 | (void)old_path_len; |
| | 987 | (void)new_fd; |
| | 988 | (void)new_path_ptr; |
| | 989 | (void)new_path_len; |
| | 990 | panic("unimplemented: path_link"); |
| | 991 | return wasi_errno_success; |
| | 992 | } |
| | 993 | |
| 942 | uint32_t wasi_snapshot_preview1_path_unlink_file(uint32_t fd, uint32_t path, uint32_t path_len) { | 994 | uint32_t wasi_snapshot_preview1_path_unlink_file(uint32_t fd, uint32_t path, uint32_t path_len) { |
| 943 | uint8_t *const m = *wasm_memory; | 995 | uint8_t *const m = *wasm_memory; |
| 944 | const char *path_ptr = (const char *)&m[path]; | 996 | const char *path_ptr = (const char *)&m[path]; |
| ... | @@ -1038,6 +1090,15 @@ uint32_t wasi_snapshot_preview1_fd_seek(uint32_t fd, uint64_t in_offset, uint32_ | ... | @@ -1038,6 +1090,15 @@ uint32_t wasi_snapshot_preview1_fd_seek(uint32_t fd, uint64_t in_offset, uint32_ |
| 1038 | return wasi_errno_success; | 1090 | return wasi_errno_success; |
| 1039 | } | 1091 | } |
| 1040 | | 1092 | |
| | 1093 | uint32_t wasi_snapshot_preview1_fd_sync(uint32_t fd) { |
| | 1094 | #if LOG_TRACE |
| | 1095 | fprintf(stderr, "wasi_snapshot_preview1_fd_sync(%u)\n", fd); |
| | 1096 | #endif |
| | 1097 | (void)fd; |
| | 1098 | panic("unimplemented: fd_sync"); |
| | 1099 | return wasi_errno_success; |
| | 1100 | } |
| | 1101 | |
| 1041 | uint32_t wasi_snapshot_preview1_poll_oneoff(uint32_t in, uint32_t out, uint32_t nsubscriptions, uint32_t res_nevents) { | 1102 | uint32_t wasi_snapshot_preview1_poll_oneoff(uint32_t in, uint32_t out, uint32_t nsubscriptions, uint32_t res_nevents) { |
| 1042 | (void)in; | 1103 | (void)in; |
| 1043 | (void)out; | 1104 | (void)out; |