MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / WasmEdge_ModuleInstanceWASIGetNativeHandler

Function WasmEdge_ModuleInstanceWASIGetNativeHandler

lib/api/wasmedge.cpp:2417–2435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2415}
2416
2417WASMEDGE_CAPI_EXPORT extern uint32_t
2418WasmEdge_ModuleInstanceWASIGetNativeHandler(
2419 const WasmEdge_ModuleInstanceContext *Cxt, int32_t Fd,
2420 uint64_t *NativeHandler) noexcept {
2421 if (!Cxt) {
2422 return 1;
2423 }
2424 auto *WasiMod =
2425 dynamic_cast<const WasmEdge::Host::WasiModule *>(fromModCxt(Cxt));
2426 if (!WasiMod) {
2427 return 2;
2428 }
2429 auto Handler = WasiMod->getNativeHandler(Fd);
2430 if (!Handler) {
2431 return 2;
2432 }
2433 *NativeHandler = *Handler;
2434 return 0;
2435}
2436
2437WASMEDGE_CAPI_EXPORT uint32_t WasmEdge_ModuleInstanceWASIGetExitCode(
2438 const WasmEdge_ModuleInstanceContext *Cxt) noexcept {

Callers 1

TESTFunction · 0.85

Calls 1

getNativeHandlerMethod · 0.45

Tested by 1

TESTFunction · 0.68