Function getIpcFd [src]

Posix-only. Thread-safe. Assumes the node is storing an IPC file descriptor.

Prototype

pub fn getIpcFd(node: Node) ?posix.fd_t

Parameters

node: Node

Source

pub fn getIpcFd(node: Node) ?posix.fd_t { const index = node.index.unwrap() orelse return null; const storage = storageByIndex(index); const int = @atomicLoad(u32, &storage.completed_count, .monotonic); return switch (@typeInfo(posix.fd_t)) { .int => @bitCast(int), .pointer => @ptrFromInt(int), else => @compileError("unsupported fd_t of " ++ @typeName(posix.fd_t)), }; }