• Home
  • Raw
  • Download

Lines Matching refs:wasi

14 namespace wasi {  namespace
17 inline void Debug(WASI* wasi, Args&&... args) { in Debug() argument
18 Debug(wasi->env(), DebugCategory::WASI, std::forward<Args>(args)...); in Debug()
58 #define GET_BACKING_STORE_OR_RETURN(wasi, args, mem_ptr, mem_size) \ argument
60 uvwasi_errno_t err = (wasi)->backingStore((mem_ptr), (mem_size)); \
252 WASI* wasi; in ArgsGet() local
260 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in ArgsGet()
261 Debug(wasi, "args_get(%d, %d)\n", argv_offset, argv_buf_offset); in ArgsGet()
262 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in ArgsGet()
266 wasi->uvw_.argv_buf_size); in ArgsGet()
270 wasi->uvw_.argc * UVWASI_SERDES_SIZE_uint32_t); in ArgsGet()
271 std::vector<char*> argv(wasi->uvw_.argc); in ArgsGet()
273 uvwasi_errno_t err = uvwasi_args_get(&wasi->uvw_, argv.data(), argv_buf); in ArgsGet()
276 for (size_t i = 0; i < wasi->uvw_.argc; i++) { in ArgsGet()
291 WASI* wasi; in ArgsSizesGet() local
299 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in ArgsSizesGet()
300 Debug(wasi, "args_sizes_get(%d, %d)\n", argc_offset, argv_buf_offset); in ArgsSizesGet()
301 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in ArgsSizesGet()
312 uvwasi_errno_t err = uvwasi_args_sizes_get(&wasi->uvw_, in ArgsSizesGet()
325 WASI* wasi; in ClockResGet() local
333 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in ClockResGet()
334 Debug(wasi, "clock_res_get(%d, %d)\n", clock_id, resolution_ptr); in ClockResGet()
335 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in ClockResGet()
341 uvwasi_errno_t err = uvwasi_clock_res_get(&wasi->uvw_, in ClockResGet()
352 WASI* wasi; in ClockTimeGet() local
362 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in ClockTimeGet()
363 Debug(wasi, "clock_time_get(%d, %d, %d)\n", clock_id, precision, time_ptr); in ClockTimeGet()
364 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in ClockTimeGet()
370 uvwasi_errno_t err = uvwasi_clock_time_get(&wasi->uvw_, in ClockTimeGet()
382 WASI* wasi; in EnvironGet() local
390 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in EnvironGet()
391 Debug(wasi, "environ_get(%d, %d)\n", environ_offset, environ_buf_offset); in EnvironGet()
392 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in EnvironGet()
396 wasi->uvw_.env_buf_size); in EnvironGet()
400 wasi->uvw_.envc * UVWASI_SERDES_SIZE_uint32_t); in EnvironGet()
401 std::vector<char*> environment(wasi->uvw_.envc); in EnvironGet()
403 uvwasi_errno_t err = uvwasi_environ_get(&wasi->uvw_, in EnvironGet()
408 for (size_t i = 0; i < wasi->uvw_.envc; i++) { in EnvironGet()
424 WASI* wasi; in EnvironSizesGet() local
432 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in EnvironSizesGet()
433 Debug(wasi, "environ_sizes_get(%d, %d)\n", envc_offset, env_buf_offset); in EnvironSizesGet()
434 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in EnvironSizesGet()
445 uvwasi_errno_t err = uvwasi_environ_sizes_get(&wasi->uvw_, in EnvironSizesGet()
458 WASI* wasi; in FdAdvise() local
468 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdAdvise()
469 Debug(wasi, "fd_advise(%d, %d, %d, %d)\n", fd, offset, len, advice); in FdAdvise()
470 uvwasi_errno_t err = uvwasi_fd_advise(&wasi->uvw_, fd, offset, len, advice); in FdAdvise()
476 WASI* wasi; in FdAllocate() local
484 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdAllocate()
485 Debug(wasi, "fd_allocate(%d, %d, %d)\n", fd, offset, len); in FdAllocate()
486 uvwasi_errno_t err = uvwasi_fd_allocate(&wasi->uvw_, fd, offset, len); in FdAllocate()
492 WASI* wasi; in FdClose() local
496 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdClose()
497 Debug(wasi, "fd_close(%d)\n", fd); in FdClose()
498 uvwasi_errno_t err = uvwasi_fd_close(&wasi->uvw_, fd); in FdClose()
504 WASI* wasi; in FdDatasync() local
508 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdDatasync()
509 Debug(wasi, "fd_datasync(%d)\n", fd); in FdDatasync()
510 uvwasi_errno_t err = uvwasi_fd_datasync(&wasi->uvw_, fd); in FdDatasync()
516 WASI* wasi; in FdFdstatGet() local
524 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdFdstatGet()
525 Debug(wasi, "fd_fdstat_get(%d, %d)\n", fd, buf); in FdFdstatGet()
526 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdFdstatGet()
529 uvwasi_errno_t err = uvwasi_fd_fdstat_get(&wasi->uvw_, fd, &stats); in FdFdstatGet()
539 WASI* wasi; in FdFdstatSetFlags() local
545 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdFdstatSetFlags()
546 Debug(wasi, "fd_fdstat_set_flags(%d, %d)\n", fd, flags); in FdFdstatSetFlags()
547 uvwasi_errno_t err = uvwasi_fd_fdstat_set_flags(&wasi->uvw_, fd, flags); in FdFdstatSetFlags()
553 WASI* wasi; in FdFdstatSetRights() local
561 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdFdstatSetRights()
562 Debug(wasi, in FdFdstatSetRights()
567 uvwasi_errno_t err = uvwasi_fd_fdstat_set_rights(&wasi->uvw_, in FdFdstatSetRights()
576 WASI* wasi; in FdFilestatGet() local
584 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdFilestatGet()
585 Debug(wasi, "fd_filestat_get(%d, %d)\n", fd, buf); in FdFilestatGet()
586 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdFilestatGet()
589 uvwasi_errno_t err = uvwasi_fd_filestat_get(&wasi->uvw_, fd, &stats); in FdFilestatGet()
599 WASI* wasi; in FdFilestatSetSize() local
605 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdFilestatSetSize()
606 Debug(wasi, "fd_filestat_set_size(%d, %d)\n", fd, st_size); in FdFilestatSetSize()
607 uvwasi_errno_t err = uvwasi_fd_filestat_set_size(&wasi->uvw_, fd, st_size); in FdFilestatSetSize()
613 WASI* wasi; in FdFilestatSetTimes() local
623 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdFilestatSetTimes()
624 Debug(wasi, in FdFilestatSetTimes()
630 uvwasi_errno_t err = uvwasi_fd_filestat_set_times(&wasi->uvw_, in FdFilestatSetTimes()
640 WASI* wasi; in FdPread() local
654 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdPread()
655 Debug(wasi, in FdPread()
662 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdPread()
682 err = uvwasi_fd_pread(&wasi->uvw_, fd, iovs.data(), iovs_len, offset, &nread); in FdPread()
691 WASI* wasi; in FdPrestatGet() local
699 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdPrestatGet()
700 Debug(wasi, "fd_prestat_get(%d, %d)\n", fd, buf); in FdPrestatGet()
701 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdPrestatGet()
704 uvwasi_errno_t err = uvwasi_fd_prestat_get(&wasi->uvw_, fd, &prestat); in FdPrestatGet()
714 WASI* wasi; in FdPrestatDirName() local
724 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdPrestatDirName()
725 Debug(wasi, "fd_prestat_dir_name(%d, %d, %d)\n", fd, path_ptr, path_len); in FdPrestatDirName()
726 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdPrestatDirName()
728 uvwasi_errno_t err = uvwasi_fd_prestat_dir_name(&wasi->uvw_, in FdPrestatDirName()
737 WASI* wasi; in FdPwrite() local
751 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdPwrite()
752 Debug(wasi, in FdPwrite()
759 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdPwrite()
782 err = uvwasi_fd_pwrite(&wasi->uvw_, in FdPwrite()
796 WASI* wasi; in FdRead() local
808 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdRead()
809 Debug(wasi, "fd_read(%d, %d, %d, %d)\n", fd, iovs_ptr, iovs_len, nread_ptr); in FdRead()
810 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdRead()
830 err = uvwasi_fd_read(&wasi->uvw_, fd, iovs.data(), iovs_len, &nread); in FdRead()
839 WASI* wasi; in FdReaddir() local
853 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdReaddir()
854 Debug(wasi, in FdReaddir()
861 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdReaddir()
868 uvwasi_errno_t err = uvwasi_fd_readdir(&wasi->uvw_, in FdReaddir()
882 WASI* wasi; in FdRenumber() local
888 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdRenumber()
889 Debug(wasi, "fd_renumber(%d, %d)\n", from, to); in FdRenumber()
890 uvwasi_errno_t err = uvwasi_fd_renumber(&wasi->uvw_, from, to); in FdRenumber()
896 WASI* wasi; in FdSeek() local
908 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdSeek()
909 Debug(wasi, "fd_seek(%d, %d, %d, %d)\n", fd, offset, whence, newoffset_ptr); in FdSeek()
910 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdSeek()
916 uvwasi_errno_t err = uvwasi_fd_seek(&wasi->uvw_, in FdSeek()
929 WASI* wasi; in FdSync() local
933 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdSync()
934 Debug(wasi, "fd_sync(%d)\n", fd); in FdSync()
935 uvwasi_errno_t err = uvwasi_fd_sync(&wasi->uvw_, fd); in FdSync()
941 WASI* wasi; in FdTell() local
949 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdTell()
950 Debug(wasi, "fd_tell(%d, %d)\n", fd, offset_ptr); in FdTell()
951 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdTell()
957 uvwasi_errno_t err = uvwasi_fd_tell(&wasi->uvw_, fd, &offset); in FdTell()
967 WASI* wasi; in FdWrite() local
979 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in FdWrite()
980 Debug(wasi, in FdWrite()
986 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in FdWrite()
1009 err = uvwasi_fd_write(&wasi->uvw_, fd, iovs.data(), iovs_len, &nwritten); in FdWrite()
1018 WASI* wasi; in PathCreateDirectory() local
1028 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathCreateDirectory()
1029 Debug(wasi, "path_create_directory(%d, %d, %d)\n", fd, path_ptr, path_len); in PathCreateDirectory()
1030 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathCreateDirectory()
1032 uvwasi_errno_t err = uvwasi_path_create_directory(&wasi->uvw_, in PathCreateDirectory()
1041 WASI* wasi; in PathFilestatGet() local
1055 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathFilestatGet()
1056 Debug(wasi, in PathFilestatGet()
1061 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathFilestatGet()
1068 uvwasi_errno_t err = uvwasi_path_filestat_get(&wasi->uvw_, in PathFilestatGet()
1082 WASI* wasi; in PathFilestatSetTimes() local
1100 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathFilestatSetTimes()
1101 Debug(wasi, in PathFilestatSetTimes()
1110 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathFilestatSetTimes()
1112 uvwasi_errno_t err = uvwasi_path_filestat_set_times(&wasi->uvw_, in PathFilestatSetTimes()
1125 WASI* wasi; in PathLink() local
1143 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathLink()
1144 Debug(wasi, in PathLink()
1153 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathLink()
1156 uvwasi_errno_t err = uvwasi_path_link(&wasi->uvw_, in PathLink()
1169 WASI* wasi; in PathOpen() local
1191 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathOpen()
1192 Debug(wasi, in PathOpen()
1203 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathOpen()
1207 uvwasi_errno_t err = uvwasi_path_open(&wasi->uvw_, in PathOpen()
1225 WASI* wasi; in PathReadlink() local
1241 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathReadlink()
1242 Debug(wasi, in PathReadlink()
1250 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathReadlink()
1258 uvwasi_errno_t err = uvwasi_path_readlink(&wasi->uvw_, in PathReadlink()
1273 WASI* wasi; in PathRemoveDirectory() local
1283 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathRemoveDirectory()
1284 Debug(wasi, "path_remove_directory(%d, %d, %d)\n", fd, path_ptr, path_len); in PathRemoveDirectory()
1285 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathRemoveDirectory()
1287 uvwasi_errno_t err = uvwasi_path_remove_directory(&wasi->uvw_, in PathRemoveDirectory()
1296 WASI* wasi; in PathRename() local
1312 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathRename()
1313 Debug(wasi, in PathRename()
1321 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathRename()
1324 uvwasi_errno_t err = uvwasi_path_rename(&wasi->uvw_, in PathRename()
1336 WASI* wasi; in PathSymlink() local
1350 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathSymlink()
1351 Debug(wasi, in PathSymlink()
1358 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathSymlink()
1361 uvwasi_errno_t err = uvwasi_path_symlink(&wasi->uvw_, in PathSymlink()
1372 WASI* wasi; in PathUnlinkFile() local
1382 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PathUnlinkFile()
1383 Debug(wasi, "path_unlink_file(%d, %d, %d)\n", fd, path_ptr, path_len); in PathUnlinkFile()
1384 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PathUnlinkFile()
1386 uvwasi_errno_t err = uvwasi_path_unlink_file(&wasi->uvw_, in PathUnlinkFile()
1395 WASI* wasi; in PollOneoff() local
1407 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in PollOneoff()
1408 Debug(wasi, in PollOneoff()
1414 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in PollOneoff()
1436 uvwasi_errno_t err = uvwasi_poll_oneoff(&wasi->uvw_, in PollOneoff()
1455 WASI* wasi; in ProcExit() local
1459 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in ProcExit()
1460 Debug(wasi, "proc_exit(%d)\n", code); in ProcExit()
1461 args.GetReturnValue().Set(uvwasi_proc_exit(&wasi->uvw_, code)); in ProcExit()
1466 WASI* wasi; in ProcRaise() local
1470 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in ProcRaise()
1471 Debug(wasi, "proc_raise(%d)\n", sig); in ProcRaise()
1472 uvwasi_errno_t err = uvwasi_proc_raise(&wasi->uvw_, sig); in ProcRaise()
1478 WASI* wasi; in RandomGet() local
1486 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in RandomGet()
1487 Debug(wasi, "random_get(%d, %d)\n", buf_ptr, buf_len); in RandomGet()
1488 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in RandomGet()
1490 uvwasi_errno_t err = uvwasi_random_get(&wasi->uvw_, in RandomGet()
1498 WASI* wasi; in SchedYield() local
1500 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in SchedYield()
1501 Debug(wasi, "sched_yield()\n"); in SchedYield()
1502 uvwasi_errno_t err = uvwasi_sched_yield(&wasi->uvw_); in SchedYield()
1507 WASI* wasi; in SockAccept() local
1517 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in SockAccept()
1518 Debug(wasi, in SockAccept()
1523 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in SockAccept()
1527 uvwasi_errno_t err = uvwasi_sock_accept(&wasi->uvw_, in SockAccept()
1539 WASI* wasi; in SockRecv() local
1555 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in SockRecv()
1556 Debug(wasi, in SockRecv()
1564 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in SockRecv()
1584 err = uvwasi_sock_recv(&wasi->uvw_, in SockRecv()
1601 WASI* wasi; in SockSend() local
1615 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in SockSend()
1616 Debug(wasi, in SockSend()
1623 GET_BACKING_STORE_OR_RETURN(wasi, args, &memory, &mem_size); in SockSend()
1644 err = uvwasi_sock_send(&wasi->uvw_, in SockSend()
1658 WASI* wasi; in SockShutdown() local
1664 ASSIGN_INITIALIZED_OR_RETURN_UNWRAP(&wasi, args.This()); in SockShutdown()
1665 Debug(wasi, "sock_shutdown(%d, %d)\n", sock, how); in SockShutdown()
1666 uvwasi_errno_t err = uvwasi_sock_shutdown(&wasi->uvw_, sock, how); in SockShutdown()
1672 WASI* wasi; in _SetMemory() local
1673 ASSIGN_OR_RETURN_UNWRAP(&wasi, args.This()); in _SetMemory()
1677 wasi->env(), in _SetMemory()
1681 wasi->memory_.Reset(wasi->env()->isolate(), args[0].As<WasmMemoryObject>()); in _SetMemory()
1768 NODE_BINDING_CONTEXT_AWARE_INTERNAL(wasi, node::wasi::Initialize)