Skip to main content

fd_control

Function fd_control 

Source
pub unsafe fn fd_control(
    fd: i32,
    command: u32,
    input: *const u8,
    input_length: u32,
    output: *mut u8,
    output_length: u32,
) -> i32
Expand description

Runs a file-system-specific control command on an open descriptor.

input and output must point to guest memory, use 16-byte-aligned storage, and not overlap. The host validates both spans and limits payloads to 256 bytes. The command is opaque to WASI and forwarded to the file.

ยงSafety

input must be valid to read for input_length bytes and output must be valid to write for output_length bytes. Both pointers must refer to guest memory, be 16-byte aligned, and their spans must not overlap.