Implements the native method 'init'.
36 {
37#if FIRST_PASS
38 throw new NotImplementedException();
39#else
40 if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
41 return;
42
43
44 var size = LibIkvm.Instance.sig_get_size_sigaction();
45 Debug.Assert(size > 0);
46 var save = stackalloc byte[size];
47
48
49 if (LibIkvm.Instance.sig_get_chld_action(save) != 0)
51
52 try
53 {
54 __callerID ??= global::ikvm.@internal.CallerID.create(UNIXProcessAccessor.Type.TypeHandle);
55 __jniPtr__init ??= Marshal.GetDelegateForFunctionPointer<__jniDelegate__init>(
JNIFrame.
GetFuncPtr(__callerID,
"java/lang/UNIXProcess", nameof(
init),
"()V"));
57 var jniEnv = jniFrm.Enter(__callerID);
58 try
59 {
60 __jniPtr__init(jniEnv, jniFrm.MakeLocalRef(typeof(
ClassLiteral<>).MakeGenericType(UNIXProcessAccessor.Type)));
61 }
62 catch (Exception ex)
63 {
64 global::System.Console.WriteLine("*** exception in native code ***");
65 global::System.Console.WriteLine(ex);
66 throw;
67 }
68 finally
69 {
70 jniFrm.Leave();
71 }
72 }
73 finally
74 {
75
76 if (LibIkvm.Instance.sig_set_chld_action(save) != 0)
78 }
79#endif
80 }
static unsafe void init()
Implements the native method 'init'.
Provides a static cache of java.lang.Class instances per .NET type.
Represents an internal error that occurred within IKVM.
static nint GetFuncPtr(object callerID, string clazz, string name, string sig)
Invoked by managed code to acquire a function pointer to a native JNI method.