getIpcFd
Posix-only. Thread-safe. Assumes the node is storing an IPC file descriptor.
Function parameters
Parameters
Type definitions in this namespace
Types
- Node
- Represents one unit of progress.
Initializes a global Progress instance.
Functions
- start
- Initializes a global Progress instance.
- lockStdErr
- Allows the caller to freely write to stderr until `unlockStdErr` is called.
- lockStderrWriter
- Allows the caller to freely write to the returned `Writer`,
= switch (builtin.os.tag) { .wasi, .freestanding, .windows => false, else => true, }
Values
- have_ipc
- = switch (builtin.os.tag) { .wasi, .freestanding, .windows => false, else => true, }
Source
Implementation
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)),
};
}