diff --git a/src/Config.cs b/src/Config.cs index 42788bd..357ad85 100644 --- a/src/Config.cs +++ b/src/Config.cs @@ -343,6 +343,20 @@ public Config WithCacheConfig(string? path) return this; } + /// + /// Configures whether, when on macOS, Mach ports are used for exception handling + /// instead of traditional Unix-based signal handling. + /// + /// This option defaults to true, using Mach ports by default. + /// + /// True to enable Mach ports or false to disable. + /// Returns the current config. + public Config WithMacosMachPorts(bool enable) + { + Native.wasmtime_config_macos_use_mach_ports(handle, enable); + return this; + } + /// public void Dispose() { @@ -450,6 +464,9 @@ private static class Native [DllImport(Engine.LibraryName)] public static extern IntPtr wasmtime_config_cache_config_load(Handle config, [MarshalAs(Extensions.LPUTF8Str)] string? path); + + [DllImport(Engine.LibraryName)] + public static extern void wasmtime_config_macos_use_mach_ports(Handle config, [MarshalAs(UnmanagedType.I1)] bool enable); } private readonly Handle handle;