Lines Matching refs:info

54 // Acquire the additional handle from |info|.
58 static zx_status_t zxrio_object_extract_handle(const zxrio_node_info_t* info,
60 switch (info->tag) {
62 if (info->file.e != ZX_HANDLE_INVALID) {
63 *out = info->file.e;
68 if (info->pipe.s != ZX_HANDLE_INVALID) {
69 *out = info->pipe.s;
74 if (info->vmofile.v != ZX_HANDLE_INVALID) {
75 *out = info->vmofile.v;
80 if (info->device.e != ZX_HANDLE_INVALID) {
81 *out = info->device.e;
263 // Decodes the handle into |info|, if it exists and should
265 static zx_status_t zxrio_decode_describe_handle(zxrio_describe_t* info,
271 switch (info->extra.tag) {
278 handle_target = &info->extra.file.e;
281 handle_target = &info->extra.device.e;
288 handle_target = &info->extra.pipe.s;
291 handle_target = &info->extra.vmofile.v;
326 static zx_status_t zxrio_process_open_response(zx_handle_t h, zxrio_describe_t* info) {
331 uint32_t dsize = sizeof(*info);
334 zx_status_t r = zx_channel_read(h, 0, info, &extra_handle, dsize, 1, &dsize,
339 if (dsize < ZXRIO_DESCRIBE_HDR_SZ || info->hdr.ordinal != fuchsia_io_NodeOnOpenOrdinal) {
342 r = info->status;
366 "RIO Node Info doesn't align with FIDL object info");
378 return zxrio_decode_describe_handle(info, extra_handle);
456 zx_info_socket_t info;
457 memset(&info, 0, sizeof(info));
458 zx_status_t status = zx_object_get_info(socket, ZX_INFO_SOCKET, &info, sizeof(info), NULL, NULL);
464 if ((info.options & ZX_SOCKET_HAS_CONTROL) != 0) {
467 if ((info.options & ZX_SOCKET_DATAGRAM) != 0) {
483 // Create a fdio (if possible) from handles and info.
486 // handles may be provided in the |info| object.
491 static zx_status_t fdio_from_handles(zx_handle_t handle, zxrio_node_info_t* info,
498 switch (info->tag) {
513 if (info->file.e == ZX_HANDLE_INVALID) {
517 io = fdio_remote_create(handle, info->file.e);
518 xprintf("rio (%x,%x) -> %p\n", handle, info->file.e, io);
526 if (info->device.e == ZX_HANDLE_INVALID) {
530 io = fdio_remote_create(handle, info->device.e);
531 xprintf("rio (%x,%x) -> %p\n", handle, info->device.e, io);
539 if (info->vmofile.v == ZX_HANDLE_INVALID) {
543 *out = fdio_vmofile_create(handle, info->vmofile.v, info->vmofile.offset,
544 info->vmofile.length);
551 if (info->pipe.s == ZX_HANDLE_INVALID) {
556 return fdio_acquire_socket(info->pipe.s, out);
564 if (zxrio_object_extract_handle(info, &extra) == ZX_OK) {
577 zxrio_node_info_t info;
579 // Pack additional handles into |info|, if possible.
594 info.tag = fuchsia_io_NodeInfoTag_pipe;
600 info.pipe.s = handles[0];
607 if ((r = fdio_from_handles(ZX_HANDLE_INVALID, &info, &io)) != ZX_OK) {
631 zxrio_describe_t* info, zx_handle_t* out) {
660 if ((r = zxrio_process_open_response(h, info)) != ZX_OK) {
670 // Returns a description of the opened object in |info|, and
673 // |info| may contain an additional handle.
676 zxrio_describe_t* info, zx_handle_t* out) {
687 return zxrio_sync_open_connection(rio_h, op, flags, mode, name, len, info, out);
699 info->status = ZX_OK;
700 info->extra.tag = fuchsia_io_NodeInfoTag_service;
709 zxrio_describe_t info;
710 zx_status_t r = zxrio_getobject(h, fuchsia_io_DirectoryOpenOrdinal, path, flags, mode, &info, &control_channel);
714 return fdio_from_handles(control_channel, &info.extra, out);
725 zxrio_describe_t info;
726 zx_status_t r = zxrio_getobject(rio->h, fuchsia_io_NodeCloneOrdinal, "", 0, 0, &info, &h);