| 1 | /** |
| 2 | * THIS FILE IS AUTO-GENERATED from the following files: |
| 3 | * wasi_snapshot_preview1.witx |
| 4 | * |
| 5 | * To regenerate this file execute: |
| 6 | * |
| 7 | * cargo run --manifest-path tools/wasi-headers/Cargo.toml generate-libc |
| 8 | * |
| 9 | * Modifications to this file will cause CI to fail, the code generator tool |
| 10 | * must be modified to change this file. |
| 11 | */ |
| 12 | |
| 13 | #include <wasi/api.h> |
| 14 | #include <string.h> |
| 15 | |
| 16 | int32_t __imported_wasi_snapshot_preview1_args_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 17 | __import_module__("wasi_snapshot_preview1"), |
| 18 | __import_name__("args_get") |
| 19 | )); |
| 20 | |
| 21 | __wasi_errno_t __wasi_args_get( |
| 22 | uint8_t * * argv, |
| 23 | uint8_t * argv_buf |
| 24 | ){ |
| 25 | int32_t ret = __imported_wasi_snapshot_preview1_args_get((int32_t) argv, (int32_t) argv_buf); |
| 26 | return (uint16_t) ret; |
| 27 | } |
| 28 | |
| 29 | int32_t __imported_wasi_snapshot_preview1_args_sizes_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 30 | __import_module__("wasi_snapshot_preview1"), |
| 31 | __import_name__("args_sizes_get") |
| 32 | )); |
| 33 | |
| 34 | __wasi_errno_t __wasi_args_sizes_get( |
| 35 | __wasi_size_t *retptr0, |
| 36 | __wasi_size_t *retptr1 |
| 37 | ){ |
| 38 | int32_t ret = __imported_wasi_snapshot_preview1_args_sizes_get((int32_t) retptr0, (int32_t) retptr1); |
| 39 | return (uint16_t) ret; |
| 40 | } |
| 41 | |
| 42 | int32_t __imported_wasi_snapshot_preview1_environ_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 43 | __import_module__("wasi_snapshot_preview1"), |
| 44 | __import_name__("environ_get") |
| 45 | )); |
| 46 | |
| 47 | __wasi_errno_t __wasi_environ_get( |
| 48 | uint8_t * * environ, |
| 49 | uint8_t * environ_buf |
| 50 | ){ |
| 51 | int32_t ret = __imported_wasi_snapshot_preview1_environ_get((int32_t) environ, (int32_t) environ_buf); |
| 52 | return (uint16_t) ret; |
| 53 | } |
| 54 | |
| 55 | int32_t __imported_wasi_snapshot_preview1_environ_sizes_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 56 | __import_module__("wasi_snapshot_preview1"), |
| 57 | __import_name__("environ_sizes_get") |
| 58 | )); |
| 59 | |
| 60 | __wasi_errno_t __wasi_environ_sizes_get( |
| 61 | __wasi_size_t *retptr0, |
| 62 | __wasi_size_t *retptr1 |
| 63 | ){ |
| 64 | int32_t ret = __imported_wasi_snapshot_preview1_environ_sizes_get((int32_t) retptr0, (int32_t) retptr1); |
| 65 | return (uint16_t) ret; |
| 66 | } |
| 67 | |
| 68 | int32_t __imported_wasi_snapshot_preview1_clock_res_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 69 | __import_module__("wasi_snapshot_preview1"), |
| 70 | __import_name__("clock_res_get") |
| 71 | )); |
| 72 | |
| 73 | __wasi_errno_t __wasi_clock_res_get( |
| 74 | __wasi_clockid_t id, |
| 75 | __wasi_timestamp_t *retptr0 |
| 76 | ){ |
| 77 | int32_t ret = __imported_wasi_snapshot_preview1_clock_res_get((int32_t) id, (int32_t) retptr0); |
| 78 | return (uint16_t) ret; |
| 79 | } |
| 80 | |
| 81 | int32_t __imported_wasi_snapshot_preview1_clock_time_get(int32_t arg0, int64_t arg1, int32_t arg2) __attribute__(( |
| 82 | __import_module__("wasi_snapshot_preview1"), |
| 83 | __import_name__("clock_time_get") |
| 84 | )); |
| 85 | |
| 86 | __wasi_errno_t __wasi_clock_time_get( |
| 87 | __wasi_clockid_t id, |
| 88 | __wasi_timestamp_t precision, |
| 89 | __wasi_timestamp_t *retptr0 |
| 90 | ){ |
| 91 | int32_t ret = __imported_wasi_snapshot_preview1_clock_time_get((int32_t) id, (int64_t) precision, (int32_t) retptr0); |
| 92 | return (uint16_t) ret; |
| 93 | } |
| 94 | |
| 95 | int32_t __imported_wasi_snapshot_preview1_fd_advise(int32_t arg0, int64_t arg1, int64_t arg2, int32_t arg3) __attribute__(( |
| 96 | __import_module__("wasi_snapshot_preview1"), |
| 97 | __import_name__("fd_advise") |
| 98 | )); |
| 99 | |
| 100 | __wasi_errno_t __wasi_fd_advise( |
| 101 | __wasi_fd_t fd, |
| 102 | __wasi_filesize_t offset, |
| 103 | __wasi_filesize_t len, |
| 104 | __wasi_advice_t advice |
| 105 | ){ |
| 106 | int32_t ret = __imported_wasi_snapshot_preview1_fd_advise((int32_t) fd, (int64_t) offset, (int64_t) len, (int32_t) advice); |
| 107 | return (uint16_t) ret; |
| 108 | } |
| 109 | |
| 110 | int32_t __imported_wasi_snapshot_preview1_fd_allocate(int32_t arg0, int64_t arg1, int64_t arg2) __attribute__(( |
| 111 | __import_module__("wasi_snapshot_preview1"), |
| 112 | __import_name__("fd_allocate") |
| 113 | )); |
| 114 | |
| 115 | __wasi_errno_t __wasi_fd_allocate( |
| 116 | __wasi_fd_t fd, |
| 117 | __wasi_filesize_t offset, |
| 118 | __wasi_filesize_t len |
| 119 | ){ |
| 120 | int32_t ret = __imported_wasi_snapshot_preview1_fd_allocate((int32_t) fd, (int64_t) offset, (int64_t) len); |
| 121 | return (uint16_t) ret; |
| 122 | } |
| 123 | |
| 124 | int32_t __imported_wasi_snapshot_preview1_fd_close(int32_t arg0) __attribute__(( |
| 125 | __import_module__("wasi_snapshot_preview1"), |
| 126 | __import_name__("fd_close") |
| 127 | )); |
| 128 | |
| 129 | __wasi_errno_t __wasi_fd_close( |
| 130 | __wasi_fd_t fd |
| 131 | ){ |
| 132 | int32_t ret = __imported_wasi_snapshot_preview1_fd_close((int32_t) fd); |
| 133 | return (uint16_t) ret; |
| 134 | } |
| 135 | |
| 136 | int32_t __imported_wasi_snapshot_preview1_fd_datasync(int32_t arg0) __attribute__(( |
| 137 | __import_module__("wasi_snapshot_preview1"), |
| 138 | __import_name__("fd_datasync") |
| 139 | )); |
| 140 | |
| 141 | __wasi_errno_t __wasi_fd_datasync( |
| 142 | __wasi_fd_t fd |
| 143 | ){ |
| 144 | int32_t ret = __imported_wasi_snapshot_preview1_fd_datasync((int32_t) fd); |
| 145 | return (uint16_t) ret; |
| 146 | } |
| 147 | |
| 148 | int32_t __imported_wasi_snapshot_preview1_fd_fdstat_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 149 | __import_module__("wasi_snapshot_preview1"), |
| 150 | __import_name__("fd_fdstat_get") |
| 151 | )); |
| 152 | |
| 153 | __wasi_errno_t __wasi_fd_fdstat_get( |
| 154 | __wasi_fd_t fd, |
| 155 | __wasi_fdstat_t *retptr0 |
| 156 | ){ |
| 157 | int32_t ret = __imported_wasi_snapshot_preview1_fd_fdstat_get((int32_t) fd, (int32_t) retptr0); |
| 158 | return (uint16_t) ret; |
| 159 | } |
| 160 | |
| 161 | int32_t __imported_wasi_snapshot_preview1_fd_fdstat_set_flags(int32_t arg0, int32_t arg1) __attribute__(( |
| 162 | __import_module__("wasi_snapshot_preview1"), |
| 163 | __import_name__("fd_fdstat_set_flags") |
| 164 | )); |
| 165 | |
| 166 | __wasi_errno_t __wasi_fd_fdstat_set_flags( |
| 167 | __wasi_fd_t fd, |
| 168 | __wasi_fdflags_t flags |
| 169 | ){ |
| 170 | int32_t ret = __imported_wasi_snapshot_preview1_fd_fdstat_set_flags((int32_t) fd, flags); |
| 171 | return (uint16_t) ret; |
| 172 | } |
| 173 | |
| 174 | int32_t __imported_wasi_snapshot_preview1_fd_fdstat_set_rights(int32_t arg0, int64_t arg1, int64_t arg2) __attribute__(( |
| 175 | __import_module__("wasi_snapshot_preview1"), |
| 176 | __import_name__("fd_fdstat_set_rights") |
| 177 | )); |
| 178 | |
| 179 | __wasi_errno_t __wasi_fd_fdstat_set_rights( |
| 180 | __wasi_fd_t fd, |
| 181 | __wasi_rights_t fs_rights_base, |
| 182 | __wasi_rights_t fs_rights_inheriting |
| 183 | ){ |
| 184 | int32_t ret = __imported_wasi_snapshot_preview1_fd_fdstat_set_rights((int32_t) fd, fs_rights_base, fs_rights_inheriting); |
| 185 | return (uint16_t) ret; |
| 186 | } |
| 187 | |
| 188 | int32_t __imported_wasi_snapshot_preview1_fd_filestat_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 189 | __import_module__("wasi_snapshot_preview1"), |
| 190 | __import_name__("fd_filestat_get") |
| 191 | )); |
| 192 | |
| 193 | __wasi_errno_t __wasi_fd_filestat_get( |
| 194 | __wasi_fd_t fd, |
| 195 | __wasi_filestat_t *retptr0 |
| 196 | ){ |
| 197 | int32_t ret = __imported_wasi_snapshot_preview1_fd_filestat_get((int32_t) fd, (int32_t) retptr0); |
| 198 | return (uint16_t) ret; |
| 199 | } |
| 200 | |
| 201 | int32_t __imported_wasi_snapshot_preview1_fd_filestat_set_size(int32_t arg0, int64_t arg1) __attribute__(( |
| 202 | __import_module__("wasi_snapshot_preview1"), |
| 203 | __import_name__("fd_filestat_set_size") |
| 204 | )); |
| 205 | |
| 206 | __wasi_errno_t __wasi_fd_filestat_set_size( |
| 207 | __wasi_fd_t fd, |
| 208 | __wasi_filesize_t size |
| 209 | ){ |
| 210 | int32_t ret = __imported_wasi_snapshot_preview1_fd_filestat_set_size((int32_t) fd, (int64_t) size); |
| 211 | return (uint16_t) ret; |
| 212 | } |
| 213 | |
| 214 | int32_t __imported_wasi_snapshot_preview1_fd_filestat_set_times(int32_t arg0, int64_t arg1, int64_t arg2, int32_t arg3) __attribute__(( |
| 215 | __import_module__("wasi_snapshot_preview1"), |
| 216 | __import_name__("fd_filestat_set_times") |
| 217 | )); |
| 218 | |
| 219 | __wasi_errno_t __wasi_fd_filestat_set_times( |
| 220 | __wasi_fd_t fd, |
| 221 | __wasi_timestamp_t atim, |
| 222 | __wasi_timestamp_t mtim, |
| 223 | __wasi_fstflags_t fst_flags |
| 224 | ){ |
| 225 | int32_t ret = __imported_wasi_snapshot_preview1_fd_filestat_set_times((int32_t) fd, (int64_t) atim, (int64_t) mtim, fst_flags); |
| 226 | return (uint16_t) ret; |
| 227 | } |
| 228 | |
| 229 | int32_t __imported_wasi_snapshot_preview1_fd_pread(int32_t arg0, int32_t arg1, int32_t arg2, int64_t arg3, int32_t arg4) __attribute__(( |
| 230 | __import_module__("wasi_snapshot_preview1"), |
| 231 | __import_name__("fd_pread") |
| 232 | )); |
| 233 | |
| 234 | __wasi_errno_t __wasi_fd_pread( |
| 235 | __wasi_fd_t fd, |
| 236 | const __wasi_iovec_t *iovs, |
| 237 | size_t iovs_len, |
| 238 | __wasi_filesize_t offset, |
| 239 | __wasi_size_t *retptr0 |
| 240 | ){ |
| 241 | int32_t ret = __imported_wasi_snapshot_preview1_fd_pread((int32_t) fd, (int32_t) iovs, (int32_t) iovs_len, (int64_t) offset, (int32_t) retptr0); |
| 242 | return (uint16_t) ret; |
| 243 | } |
| 244 | |
| 245 | int32_t __imported_wasi_snapshot_preview1_fd_prestat_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 246 | __import_module__("wasi_snapshot_preview1"), |
| 247 | __import_name__("fd_prestat_get") |
| 248 | )); |
| 249 | |
| 250 | __wasi_errno_t __wasi_fd_prestat_get( |
| 251 | __wasi_fd_t fd, |
| 252 | __wasi_prestat_t *retptr0 |
| 253 | ){ |
| 254 | int32_t ret = __imported_wasi_snapshot_preview1_fd_prestat_get((int32_t) fd, (int32_t) retptr0); |
| 255 | return (uint16_t) ret; |
| 256 | } |
| 257 | |
| 258 | int32_t __imported_wasi_snapshot_preview1_fd_prestat_dir_name(int32_t arg0, int32_t arg1, int32_t arg2) __attribute__(( |
| 259 | __import_module__("wasi_snapshot_preview1"), |
| 260 | __import_name__("fd_prestat_dir_name") |
| 261 | )); |
| 262 | |
| 263 | __wasi_errno_t __wasi_fd_prestat_dir_name( |
| 264 | __wasi_fd_t fd, |
| 265 | uint8_t * path, |
| 266 | __wasi_size_t path_len |
| 267 | ){ |
| 268 | int32_t ret = __imported_wasi_snapshot_preview1_fd_prestat_dir_name((int32_t) fd, (int32_t) path, (int32_t) path_len); |
| 269 | return (uint16_t) ret; |
| 270 | } |
| 271 | |
| 272 | int32_t __imported_wasi_snapshot_preview1_fd_pwrite(int32_t arg0, int32_t arg1, int32_t arg2, int64_t arg3, int32_t arg4) __attribute__(( |
| 273 | __import_module__("wasi_snapshot_preview1"), |
| 274 | __import_name__("fd_pwrite") |
| 275 | )); |
| 276 | |
| 277 | __wasi_errno_t __wasi_fd_pwrite( |
| 278 | __wasi_fd_t fd, |
| 279 | const __wasi_ciovec_t *iovs, |
| 280 | size_t iovs_len, |
| 281 | __wasi_filesize_t offset, |
| 282 | __wasi_size_t *retptr0 |
| 283 | ){ |
| 284 | int32_t ret = __imported_wasi_snapshot_preview1_fd_pwrite((int32_t) fd, (int32_t) iovs, (int32_t) iovs_len, (int64_t) offset, (int32_t) retptr0); |
| 285 | return (uint16_t) ret; |
| 286 | } |
| 287 | |
| 288 | int32_t __imported_wasi_snapshot_preview1_fd_read(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3) __attribute__(( |
| 289 | __import_module__("wasi_snapshot_preview1"), |
| 290 | __import_name__("fd_read") |
| 291 | )); |
| 292 | |
| 293 | __wasi_errno_t __wasi_fd_read( |
| 294 | __wasi_fd_t fd, |
| 295 | const __wasi_iovec_t *iovs, |
| 296 | size_t iovs_len, |
| 297 | __wasi_size_t *retptr0 |
| 298 | ){ |
| 299 | int32_t ret = __imported_wasi_snapshot_preview1_fd_read((int32_t) fd, (int32_t) iovs, (int32_t) iovs_len, (int32_t) retptr0); |
| 300 | return (uint16_t) ret; |
| 301 | } |
| 302 | |
| 303 | int32_t __imported_wasi_snapshot_preview1_fd_readdir(int32_t arg0, int32_t arg1, int32_t arg2, int64_t arg3, int32_t arg4) __attribute__(( |
| 304 | __import_module__("wasi_snapshot_preview1"), |
| 305 | __import_name__("fd_readdir") |
| 306 | )); |
| 307 | |
| 308 | __wasi_errno_t __wasi_fd_readdir( |
| 309 | __wasi_fd_t fd, |
| 310 | uint8_t * buf, |
| 311 | __wasi_size_t buf_len, |
| 312 | __wasi_dircookie_t cookie, |
| 313 | __wasi_size_t *retptr0 |
| 314 | ){ |
| 315 | int32_t ret = __imported_wasi_snapshot_preview1_fd_readdir((int32_t) fd, (int32_t) buf, (int32_t) buf_len, (int64_t) cookie, (int32_t) retptr0); |
| 316 | return (uint16_t) ret; |
| 317 | } |
| 318 | |
| 319 | int32_t __imported_wasi_snapshot_preview1_fd_renumber(int32_t arg0, int32_t arg1) __attribute__(( |
| 320 | __import_module__("wasi_snapshot_preview1"), |
| 321 | __import_name__("fd_renumber") |
| 322 | )); |
| 323 | |
| 324 | __wasi_errno_t __wasi_fd_renumber( |
| 325 | __wasi_fd_t fd, |
| 326 | __wasi_fd_t to |
| 327 | ){ |
| 328 | int32_t ret = __imported_wasi_snapshot_preview1_fd_renumber((int32_t) fd, (int32_t) to); |
| 329 | return (uint16_t) ret; |
| 330 | } |
| 331 | |
| 332 | int32_t __imported_wasi_snapshot_preview1_fd_seek(int32_t arg0, int64_t arg1, int32_t arg2, int32_t arg3) __attribute__(( |
| 333 | __import_module__("wasi_snapshot_preview1"), |
| 334 | __import_name__("fd_seek") |
| 335 | )); |
| 336 | |
| 337 | __wasi_errno_t __wasi_fd_seek( |
| 338 | __wasi_fd_t fd, |
| 339 | __wasi_filedelta_t offset, |
| 340 | __wasi_whence_t whence, |
| 341 | __wasi_filesize_t *retptr0 |
| 342 | ){ |
| 343 | int32_t ret = __imported_wasi_snapshot_preview1_fd_seek((int32_t) fd, offset, (int32_t) whence, (int32_t) retptr0); |
| 344 | return (uint16_t) ret; |
| 345 | } |
| 346 | |
| 347 | int32_t __imported_wasi_snapshot_preview1_fd_sync(int32_t arg0) __attribute__(( |
| 348 | __import_module__("wasi_snapshot_preview1"), |
| 349 | __import_name__("fd_sync") |
| 350 | )); |
| 351 | |
| 352 | __wasi_errno_t __wasi_fd_sync( |
| 353 | __wasi_fd_t fd |
| 354 | ){ |
| 355 | int32_t ret = __imported_wasi_snapshot_preview1_fd_sync((int32_t) fd); |
| 356 | return (uint16_t) ret; |
| 357 | } |
| 358 | |
| 359 | int32_t __imported_wasi_snapshot_preview1_fd_tell(int32_t arg0, int32_t arg1) __attribute__(( |
| 360 | __import_module__("wasi_snapshot_preview1"), |
| 361 | __import_name__("fd_tell") |
| 362 | )); |
| 363 | |
| 364 | __wasi_errno_t __wasi_fd_tell( |
| 365 | __wasi_fd_t fd, |
| 366 | __wasi_filesize_t *retptr0 |
| 367 | ){ |
| 368 | int32_t ret = __imported_wasi_snapshot_preview1_fd_tell((int32_t) fd, (int32_t) retptr0); |
| 369 | return (uint16_t) ret; |
| 370 | } |
| 371 | |
| 372 | int32_t __imported_wasi_snapshot_preview1_fd_write(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3) __attribute__(( |
| 373 | __import_module__("wasi_snapshot_preview1"), |
| 374 | __import_name__("fd_write") |
| 375 | )); |
| 376 | |
| 377 | __wasi_errno_t __wasi_fd_write( |
| 378 | __wasi_fd_t fd, |
| 379 | const __wasi_ciovec_t *iovs, |
| 380 | size_t iovs_len, |
| 381 | __wasi_size_t *retptr0 |
| 382 | ){ |
| 383 | int32_t ret = __imported_wasi_snapshot_preview1_fd_write((int32_t) fd, (int32_t) iovs, (int32_t) iovs_len, (int32_t) retptr0); |
| 384 | return (uint16_t) ret; |
| 385 | } |
| 386 | |
| 387 | int32_t __imported_wasi_snapshot_preview1_path_create_directory(int32_t arg0, int32_t arg1, int32_t arg2) __attribute__(( |
| 388 | __import_module__("wasi_snapshot_preview1"), |
| 389 | __import_name__("path_create_directory") |
| 390 | )); |
| 391 | |
| 392 | __wasi_errno_t __wasi_path_create_directory( |
| 393 | __wasi_fd_t fd, |
| 394 | const char *path |
| 395 | ){ |
| 396 | size_t path_len = strlen(path); |
| 397 | int32_t ret = __imported_wasi_snapshot_preview1_path_create_directory((int32_t) fd, (int32_t) path, (int32_t) path_len); |
| 398 | return (uint16_t) ret; |
| 399 | } |
| 400 | |
| 401 | int32_t __imported_wasi_snapshot_preview1_path_filestat_get(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4) __attribute__(( |
| 402 | __import_module__("wasi_snapshot_preview1"), |
| 403 | __import_name__("path_filestat_get") |
| 404 | )); |
| 405 | |
| 406 | __wasi_errno_t __wasi_path_filestat_get( |
| 407 | __wasi_fd_t fd, |
| 408 | __wasi_lookupflags_t flags, |
| 409 | const char *path, |
| 410 | __wasi_filestat_t *retptr0 |
| 411 | ){ |
| 412 | size_t path_len = strlen(path); |
| 413 | int32_t ret = __imported_wasi_snapshot_preview1_path_filestat_get((int32_t) fd, flags, (int32_t) path, (int32_t) path_len, (int32_t) retptr0); |
| 414 | return (uint16_t) ret; |
| 415 | } |
| 416 | |
| 417 | int32_t __imported_wasi_snapshot_preview1_path_filestat_set_times(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int64_t arg4, int64_t arg5, int32_t arg6) __attribute__(( |
| 418 | __import_module__("wasi_snapshot_preview1"), |
| 419 | __import_name__("path_filestat_set_times") |
| 420 | )); |
| 421 | |
| 422 | __wasi_errno_t __wasi_path_filestat_set_times( |
| 423 | __wasi_fd_t fd, |
| 424 | __wasi_lookupflags_t flags, |
| 425 | const char *path, |
| 426 | __wasi_timestamp_t atim, |
| 427 | __wasi_timestamp_t mtim, |
| 428 | __wasi_fstflags_t fst_flags |
| 429 | ){ |
| 430 | size_t path_len = strlen(path); |
| 431 | int32_t ret = __imported_wasi_snapshot_preview1_path_filestat_set_times((int32_t) fd, flags, (int32_t) path, (int32_t) path_len, (int64_t) atim, (int64_t) mtim, fst_flags); |
| 432 | return (uint16_t) ret; |
| 433 | } |
| 434 | |
| 435 | int32_t __imported_wasi_snapshot_preview1_path_link(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, int32_t arg6) __attribute__(( |
| 436 | __import_module__("wasi_snapshot_preview1"), |
| 437 | __import_name__("path_link") |
| 438 | )); |
| 439 | |
| 440 | __wasi_errno_t __wasi_path_link( |
| 441 | __wasi_fd_t old_fd, |
| 442 | __wasi_lookupflags_t old_flags, |
| 443 | const char *old_path, |
| 444 | __wasi_fd_t new_fd, |
| 445 | const char *new_path |
| 446 | ){ |
| 447 | size_t old_path_len = strlen(old_path); |
| 448 | size_t new_path_len = strlen(new_path); |
| 449 | int32_t ret = __imported_wasi_snapshot_preview1_path_link((int32_t) old_fd, old_flags, (int32_t) old_path, (int32_t) old_path_len, (int32_t) new_fd, (int32_t) new_path, (int32_t) new_path_len); |
| 450 | return (uint16_t) ret; |
| 451 | } |
| 452 | |
| 453 | int32_t __imported_wasi_snapshot_preview1_path_open(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int64_t arg5, int64_t arg6, int32_t arg7, int32_t arg8) __attribute__(( |
| 454 | __import_module__("wasi_snapshot_preview1"), |
| 455 | __import_name__("path_open") |
| 456 | )); |
| 457 | |
| 458 | __wasi_errno_t __wasi_path_open( |
| 459 | __wasi_fd_t fd, |
| 460 | __wasi_lookupflags_t dirflags, |
| 461 | const char *path, |
| 462 | __wasi_oflags_t oflags, |
| 463 | __wasi_rights_t fs_rights_base, |
| 464 | __wasi_rights_t fs_rights_inheriting, |
| 465 | __wasi_fdflags_t fdflags, |
| 466 | __wasi_fd_t *retptr0 |
| 467 | ){ |
| 468 | size_t path_len = strlen(path); |
| 469 | int32_t ret = __imported_wasi_snapshot_preview1_path_open((int32_t) fd, dirflags, (int32_t) path, (int32_t) path_len, oflags, fs_rights_base, fs_rights_inheriting, fdflags, (int32_t) retptr0); |
| 470 | return (uint16_t) ret; |
| 471 | } |
| 472 | |
| 473 | int32_t __imported_wasi_snapshot_preview1_path_readlink(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5) __attribute__(( |
| 474 | __import_module__("wasi_snapshot_preview1"), |
| 475 | __import_name__("path_readlink") |
| 476 | )); |
| 477 | |
| 478 | __wasi_errno_t __wasi_path_readlink( |
| 479 | __wasi_fd_t fd, |
| 480 | const char *path, |
| 481 | uint8_t * buf, |
| 482 | __wasi_size_t buf_len, |
| 483 | __wasi_size_t *retptr0 |
| 484 | ){ |
| 485 | size_t path_len = strlen(path); |
| 486 | int32_t ret = __imported_wasi_snapshot_preview1_path_readlink((int32_t) fd, (int32_t) path, (int32_t) path_len, (int32_t) buf, (int32_t) buf_len, (int32_t) retptr0); |
| 487 | return (uint16_t) ret; |
| 488 | } |
| 489 | |
| 490 | int32_t __imported_wasi_snapshot_preview1_path_remove_directory(int32_t arg0, int32_t arg1, int32_t arg2) __attribute__(( |
| 491 | __import_module__("wasi_snapshot_preview1"), |
| 492 | __import_name__("path_remove_directory") |
| 493 | )); |
| 494 | |
| 495 | __wasi_errno_t __wasi_path_remove_directory( |
| 496 | __wasi_fd_t fd, |
| 497 | const char *path |
| 498 | ){ |
| 499 | size_t path_len = strlen(path); |
| 500 | int32_t ret = __imported_wasi_snapshot_preview1_path_remove_directory((int32_t) fd, (int32_t) path, (int32_t) path_len); |
| 501 | return (uint16_t) ret; |
| 502 | } |
| 503 | |
| 504 | int32_t __imported_wasi_snapshot_preview1_path_rename(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5) __attribute__(( |
| 505 | __import_module__("wasi_snapshot_preview1"), |
| 506 | __import_name__("path_rename") |
| 507 | )); |
| 508 | |
| 509 | __wasi_errno_t __wasi_path_rename( |
| 510 | __wasi_fd_t fd, |
| 511 | const char *old_path, |
| 512 | __wasi_fd_t new_fd, |
| 513 | const char *new_path |
| 514 | ){ |
| 515 | size_t old_path_len = strlen(old_path); |
| 516 | size_t new_path_len = strlen(new_path); |
| 517 | int32_t ret = __imported_wasi_snapshot_preview1_path_rename((int32_t) fd, (int32_t) old_path, (int32_t) old_path_len, (int32_t) new_fd, (int32_t) new_path, (int32_t) new_path_len); |
| 518 | return (uint16_t) ret; |
| 519 | } |
| 520 | |
| 521 | int32_t __imported_wasi_snapshot_preview1_path_symlink(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4) __attribute__(( |
| 522 | __import_module__("wasi_snapshot_preview1"), |
| 523 | __import_name__("path_symlink") |
| 524 | )); |
| 525 | |
| 526 | __wasi_errno_t __wasi_path_symlink( |
| 527 | const char *old_path, |
| 528 | __wasi_fd_t fd, |
| 529 | const char *new_path |
| 530 | ){ |
| 531 | size_t old_path_len = strlen(old_path); |
| 532 | size_t new_path_len = strlen(new_path); |
| 533 | int32_t ret = __imported_wasi_snapshot_preview1_path_symlink((int32_t) old_path, (int32_t) old_path_len, (int32_t) fd, (int32_t) new_path, (int32_t) new_path_len); |
| 534 | return (uint16_t) ret; |
| 535 | } |
| 536 | |
| 537 | int32_t __imported_wasi_snapshot_preview1_path_unlink_file(int32_t arg0, int32_t arg1, int32_t arg2) __attribute__(( |
| 538 | __import_module__("wasi_snapshot_preview1"), |
| 539 | __import_name__("path_unlink_file") |
| 540 | )); |
| 541 | |
| 542 | __wasi_errno_t __wasi_path_unlink_file( |
| 543 | __wasi_fd_t fd, |
| 544 | const char *path |
| 545 | ){ |
| 546 | size_t path_len = strlen(path); |
| 547 | int32_t ret = __imported_wasi_snapshot_preview1_path_unlink_file((int32_t) fd, (int32_t) path, (int32_t) path_len); |
| 548 | return (uint16_t) ret; |
| 549 | } |
| 550 | |
| 551 | int32_t __imported_wasi_snapshot_preview1_poll_oneoff(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3) __attribute__(( |
| 552 | __import_module__("wasi_snapshot_preview1"), |
| 553 | __import_name__("poll_oneoff") |
| 554 | )); |
| 555 | |
| 556 | __wasi_errno_t __wasi_poll_oneoff( |
| 557 | const __wasi_subscription_t * in, |
| 558 | __wasi_event_t * out, |
| 559 | __wasi_size_t nsubscriptions, |
| 560 | __wasi_size_t *retptr0 |
| 561 | ){ |
| 562 | int32_t ret = __imported_wasi_snapshot_preview1_poll_oneoff((int32_t) in, (int32_t) out, (int32_t) nsubscriptions, (int32_t) retptr0); |
| 563 | return (uint16_t) ret; |
| 564 | } |
| 565 | |
| 566 | _Noreturn void __imported_wasi_snapshot_preview1_proc_exit(int32_t arg0) __attribute__(( |
| 567 | __import_module__("wasi_snapshot_preview1"), |
| 568 | __import_name__("proc_exit") |
| 569 | )); |
| 570 | |
| 571 | _Noreturn void __wasi_proc_exit( |
| 572 | __wasi_exitcode_t rval |
| 573 | ){ |
| 574 | __imported_wasi_snapshot_preview1_proc_exit((int32_t) rval); |
| 575 | } |
| 576 | |
| 577 | int32_t __imported_wasi_snapshot_preview1_sched_yield() __attribute__(( |
| 578 | __import_module__("wasi_snapshot_preview1"), |
| 579 | __import_name__("sched_yield") |
| 580 | )); |
| 581 | |
| 582 | __wasi_errno_t __wasi_sched_yield( |
| 583 | void |
| 584 | ){ |
| 585 | int32_t ret = __imported_wasi_snapshot_preview1_sched_yield(); |
| 586 | return (uint16_t) ret; |
| 587 | } |
| 588 | |
| 589 | int32_t __imported_wasi_snapshot_preview1_random_get(int32_t arg0, int32_t arg1) __attribute__(( |
| 590 | __import_module__("wasi_snapshot_preview1"), |
| 591 | __import_name__("random_get") |
| 592 | )); |
| 593 | |
| 594 | __wasi_errno_t __wasi_random_get( |
| 595 | uint8_t * buf, |
| 596 | __wasi_size_t buf_len |
| 597 | ){ |
| 598 | int32_t ret = __imported_wasi_snapshot_preview1_random_get((int32_t) buf, (int32_t) buf_len); |
| 599 | return (uint16_t) ret; |
| 600 | } |
| 601 | |
| 602 | int32_t __imported_wasi_snapshot_preview1_sock_accept(int32_t arg0, int32_t arg1, int32_t arg2) __attribute__(( |
| 603 | __import_module__("wasi_snapshot_preview1"), |
| 604 | __import_name__("sock_accept") |
| 605 | )); |
| 606 | |
| 607 | __wasi_errno_t __wasi_sock_accept( |
| 608 | __wasi_fd_t fd, |
| 609 | __wasi_fdflags_t flags, |
| 610 | __wasi_fd_t *retptr0 |
| 611 | ){ |
| 612 | int32_t ret = __imported_wasi_snapshot_preview1_sock_accept((int32_t) fd, flags, (int32_t) retptr0); |
| 613 | return (uint16_t) ret; |
| 614 | } |
| 615 | |
| 616 | int32_t __imported_wasi_snapshot_preview1_sock_recv(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5) __attribute__(( |
| 617 | __import_module__("wasi_snapshot_preview1"), |
| 618 | __import_name__("sock_recv") |
| 619 | )); |
| 620 | |
| 621 | __wasi_errno_t __wasi_sock_recv( |
| 622 | __wasi_fd_t fd, |
| 623 | const __wasi_iovec_t *ri_data, |
| 624 | size_t ri_data_len, |
| 625 | __wasi_riflags_t ri_flags, |
| 626 | __wasi_size_t *retptr0, |
| 627 | __wasi_roflags_t *retptr1 |
| 628 | ){ |
| 629 | int32_t ret = __imported_wasi_snapshot_preview1_sock_recv((int32_t) fd, (int32_t) ri_data, (int32_t) ri_data_len, ri_flags, (int32_t) retptr0, (int32_t) retptr1); |
| 630 | return (uint16_t) ret; |
| 631 | } |
| 632 | |
| 633 | int32_t __imported_wasi_snapshot_preview1_sock_send(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4) __attribute__(( |
| 634 | __import_module__("wasi_snapshot_preview1"), |
| 635 | __import_name__("sock_send") |
| 636 | )); |
| 637 | |
| 638 | __wasi_errno_t __wasi_sock_send( |
| 639 | __wasi_fd_t fd, |
| 640 | const __wasi_ciovec_t *si_data, |
| 641 | size_t si_data_len, |
| 642 | __wasi_siflags_t si_flags, |
| 643 | __wasi_size_t *retptr0 |
| 644 | ){ |
| 645 | int32_t ret = __imported_wasi_snapshot_preview1_sock_send((int32_t) fd, (int32_t) si_data, (int32_t) si_data_len, (int32_t) si_flags, (int32_t) retptr0); |
| 646 | return (uint16_t) ret; |
| 647 | } |
| 648 | |
| 649 | int32_t __imported_wasi_snapshot_preview1_sock_shutdown(int32_t arg0, int32_t arg1) __attribute__(( |
| 650 | __import_module__("wasi_snapshot_preview1"), |
| 651 | __import_name__("sock_shutdown") |
| 652 | )); |
| 653 | |
| 654 | __wasi_errno_t __wasi_sock_shutdown( |
| 655 | __wasi_fd_t fd, |
| 656 | __wasi_sdflags_t how |
| 657 | ){ |
| 658 | int32_t ret = __imported_wasi_snapshot_preview1_sock_shutdown((int32_t) fd, how); |
| 659 | return (uint16_t) ret; |
| 660 | } |
| 661 | |
| 662 | #ifdef _REENTRANT |
| 663 | int32_t __imported_wasi_thread_spawn(int32_t arg0) __attribute__(( |
| 664 | __import_module__("wasi"), |
| 665 | __import_name__("thread-spawn") |
| 666 | )); |
| 667 | |
| 668 | int32_t __wasi_thread_spawn(void* start_arg) { |
| 669 | return __imported_wasi_thread_spawn((int32_t) start_arg); |
| 670 | } |
| 671 | #endif |