wasmedge_sys::ffi

Function WasmEdge_ModuleInstanceWASIGetNativeHandler

Source
pub unsafe extern "C" fn WasmEdge_ModuleInstanceWASIGetNativeHandler(
    Cxt: *const WasmEdge_ModuleInstanceContext,
    Fd: i32,
    NativeHandler: *mut u64,
) -> u32
Expand description

Get the native handler from the WASI mapped FD/Handler.

This function will return the raw FD/Handler from a given mapped Fd or Handler.

\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object. \param Fd the WASI mapped Fd. \param [out] NativeHandler the raw Fd/Handler.

\returns the error code. Return 0 if the Native Handler is found. Return 1 if the Cxt is NULL. Return 2 if the given mapped Fd/handler is not found.