• Home
  • Raw
  • Download

Lines Matching refs:wrap

408   struct uvwasi_fd_wrap_t* wrap;  in uvwasi_embedder_remap_fd()  local
414 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, 0, 0); in uvwasi_embedder_remap_fd()
418 wrap->fd = new_host_fd; in uvwasi_embedder_remap_fd()
419 uv_mutex_unlock(&wrap->mutex); in uvwasi_embedder_remap_fd()
563 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_advise() local
616 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, UVWASI_RIGHT_FD_ADVISE, 0); in uvwasi_fd_advise()
623 r = posix_fadvise(wrap->fd, offset, len, mapped_advice); in uvwasi_fd_advise()
627 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_advise()
640 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_allocate() local
656 &wrap, in uvwasi_fd_allocate()
665 r = posix_fallocate(wrap->fd, offset, len); in uvwasi_fd_allocate()
671 r = uv_fs_fstat(NULL, &req, wrap->fd, NULL); in uvwasi_fd_allocate()
680 r = uv_fs_ftruncate(NULL, &req, wrap->fd, offset + len, NULL); in uvwasi_fd_allocate()
690 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_allocate()
696 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_close() local
708 err = uvwasi_fd_table_get_nolock(uvwasi->fds, fd, &wrap, 0, 0); in uvwasi_fd_close()
712 r = uv_fs_close(NULL, &req, wrap->fd, NULL); in uvwasi_fd_close()
713 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_close()
730 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_datasync() local
742 &wrap, in uvwasi_fd_datasync()
748 r = uv_fs_fdatasync(NULL, &req, wrap->fd, NULL); in uvwasi_fd_datasync()
749 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_datasync()
762 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_fdstat_get() local
776 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, 0, 0); in uvwasi_fd_fdstat_get()
780 buf->fs_filetype = wrap->type; in uvwasi_fd_fdstat_get()
781 buf->fs_rights_base = wrap->rights_base; in uvwasi_fd_fdstat_get()
782 buf->fs_rights_inheriting = wrap->rights_inheriting; in uvwasi_fd_fdstat_get()
786 r = fcntl(wrap->fd, F_GETFL); in uvwasi_fd_fdstat_get()
789 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_fdstat_get()
795 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_fdstat_get()
812 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_fdstat_set_flags()
827 &wrap, in uvwasi_fd_fdstat_set_flags()
858 r = fcntl(wrap->fd, F_SETFL, mapped_flags); in uvwasi_fd_fdstat_set_flags()
864 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_fdstat_set_flags()
875 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_fdstat_set_rights() local
888 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, 0, 0); in uvwasi_fd_fdstat_set_rights()
893 if ((fs_rights_base | wrap->rights_base) > wrap->rights_base) { in uvwasi_fd_fdstat_set_rights()
898 if ((fs_rights_inheriting | wrap->rights_inheriting) > in uvwasi_fd_fdstat_set_rights()
899 wrap->rights_inheriting) { in uvwasi_fd_fdstat_set_rights()
904 wrap->rights_base = fs_rights_base; in uvwasi_fd_fdstat_set_rights()
905 wrap->rights_inheriting = fs_rights_inheriting; in uvwasi_fd_fdstat_set_rights()
908 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_fdstat_set_rights()
916 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_filestat_get() local
931 &wrap, in uvwasi_fd_filestat_get()
937 r = uv_fs_fstat(NULL, &req, wrap->fd, NULL); in uvwasi_fd_filestat_get()
946 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_filestat_get()
956 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_filestat_set_size() local
972 &wrap, in uvwasi_fd_filestat_set_size()
978 r = uv_fs_ftruncate(NULL, &req, wrap->fd, st_size, NULL); in uvwasi_fd_filestat_set_size()
979 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_filestat_set_size()
994 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_filestat_set_times() local
1016 &wrap, in uvwasi_fd_filestat_set_times()
1027 &wrap->fd, in uvwasi_fd_filestat_set_times()
1030 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_filestat_set_times()
1035 r = uv_fs_futime(NULL, &req, wrap->fd, atim, mtim, NULL); in uvwasi_fd_filestat_set_times()
1036 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_filestat_set_times()
1052 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_pread() local
1073 &wrap, in uvwasi_fd_pread()
1081 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_pread()
1085 r = uv_fs_read(NULL, &req, wrap->fd, bufs, iovs_len, offset, NULL); in uvwasi_fd_pread()
1086 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_pread()
1102 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_prestat_get() local
1113 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, 0, 0); in uvwasi_fd_prestat_get()
1116 if (wrap->preopen != 1) { in uvwasi_fd_prestat_get()
1122 buf->u.dir.pr_name_len = strlen(wrap->path) + 1; in uvwasi_fd_prestat_get()
1125 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_prestat_get()
1134 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_prestat_dir_name() local
1148 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, 0, 0); in uvwasi_fd_prestat_dir_name()
1151 if (wrap->preopen != 1) { in uvwasi_fd_prestat_dir_name()
1156 size = strlen(wrap->path) + 1; in uvwasi_fd_prestat_dir_name()
1162 memcpy(path, wrap->path, size); in uvwasi_fd_prestat_dir_name()
1165 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_prestat_dir_name()
1176 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_pwrite() local
1197 &wrap, in uvwasi_fd_pwrite()
1205 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_pwrite()
1209 r = uv_fs_write(NULL, &req, wrap->fd, bufs, iovs_len, offset, NULL); in uvwasi_fd_pwrite()
1210 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_pwrite()
1228 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_read() local
1246 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, UVWASI_RIGHT_FD_READ, 0); in uvwasi_fd_read()
1252 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_read()
1256 r = uv_fs_read(NULL, &req, wrap->fd, bufs, iovs_len, -1, NULL); in uvwasi_fd_read()
1257 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_read()
1278 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_readdir() local
1307 &wrap, in uvwasi_fd_readdir()
1314 r = uv_fs_opendir(NULL, &req, wrap->real_path, NULL); in uvwasi_fd_readdir()
1316 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_readdir()
1407 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_readdir()
1440 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_seek() local
1454 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, UVWASI_RIGHT_FD_SEEK, 0); in uvwasi_fd_seek()
1458 err = uvwasi__lseek(wrap->fd, offset, whence, newoffset); in uvwasi_fd_seek()
1459 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_seek()
1465 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_sync() local
1477 &wrap, in uvwasi_fd_sync()
1483 r = uv_fs_fsync(NULL, &req, wrap->fd, NULL); in uvwasi_fd_sync()
1484 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_sync()
1497 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_tell() local
1508 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, UVWASI_RIGHT_FD_TELL, 0); in uvwasi_fd_tell()
1512 err = uvwasi__lseek(wrap->fd, 0, UVWASI_WHENCE_CUR, offset); in uvwasi_fd_tell()
1513 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_tell()
1523 struct uvwasi_fd_wrap_t* wrap; in uvwasi_fd_write() local
1541 err = uvwasi_fd_table_get(uvwasi->fds, fd, &wrap, UVWASI_RIGHT_FD_WRITE, 0); in uvwasi_fd_write()
1547 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_write()
1551 r = uv_fs_write(NULL, &req, wrap->fd, bufs, iovs_len, -1, NULL); in uvwasi_fd_write()
1552 uv_mutex_unlock(&wrap->mutex); in uvwasi_fd_write()
1570 struct uvwasi_fd_wrap_t* wrap; in uvwasi_path_create_directory() local
1587 &wrap, in uvwasi_path_create_directory()
1593 err = uvwasi__resolve_path(uvwasi, wrap, path, path_len, &resolved_path, 0); in uvwasi_path_create_directory()
1608 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_create_directory()
1620 struct uvwasi_fd_wrap_t* wrap; in uvwasi_path_filestat_get() local
1639 &wrap, in uvwasi_path_filestat_get()
1646 wrap, in uvwasi_path_filestat_get()
1666 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_filestat_get()
1680 struct uvwasi_fd_wrap_t* wrap; in uvwasi_path_filestat_set_times() local
1706 &wrap, in uvwasi_path_filestat_set_times()
1713 wrap, in uvwasi_path_filestat_set_times()
1745 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_filestat_set_times()
1872 struct uvwasi_fd_wrap_t *wrap; in uvwasi_path_open() local
1997 &wrap); in uvwasi_path_open()
2001 *fd = wrap->id; in uvwasi_path_open()
2002 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_open()
2022 struct uvwasi_fd_wrap_t* wrap; in uvwasi_path_readlink() local
2043 &wrap, in uvwasi_path_readlink()
2049 err = uvwasi__resolve_path(uvwasi, wrap, path, path_len, &resolved_path, 0); in uvwasi_path_readlink()
2051 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_readlink()
2056 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_readlink()
2082 struct uvwasi_fd_wrap_t* wrap; in uvwasi_path_remove_directory() local
2099 &wrap, in uvwasi_path_remove_directory()
2105 err = uvwasi__resolve_path(uvwasi, wrap, path, path_len, &resolved_path, 0); in uvwasi_path_remove_directory()
2107 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_remove_directory()
2112 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_remove_directory()
2233 struct uvwasi_fd_wrap_t* wrap; in uvwasi_path_symlink() local
2252 &wrap, in uvwasi_path_symlink()
2259 wrap, in uvwasi_path_symlink()
2265 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_symlink()
2271 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_symlink()
2286 struct uvwasi_fd_wrap_t* wrap; in uvwasi_path_unlink_file() local
2303 &wrap, in uvwasi_path_unlink_file()
2309 err = uvwasi__resolve_path(uvwasi, wrap, path, path_len, &resolved_path, 0); in uvwasi_path_unlink_file()
2311 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_unlink_file()
2316 uv_mutex_unlock(&wrap->mutex); in uvwasi_path_unlink_file()