MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / LoadUnix1

Method LoadUnix1

StereoKit/Native/NativeLib.cs:129–136  ·  view source on GitHub ↗
(string arch)

Source from the content-addressed store, hash-verified

127 [DllImport("dl", CharSet = CharSet.Ansi)]
128 static extern IntPtr dlopen(string fileName, int flags);
129 static bool LoadUnix1(string arch)
130 {
131 const int RTLD_NOW = 2;
132 if (dlopen($"./runtimes/linux-{arch}/native/libStereoKitC.so", RTLD_NOW) != IntPtr.Zero) return true;
133 if (dlopen($"{AppDomain.CurrentDomain.BaseDirectory}/runtimes/linux-{arch}/native/libStereoKitC.so", RTLD_NOW) != IntPtr.Zero) return true;
134 if (dlopen("libStereoKitC.so", RTLD_NOW) != IntPtr.Zero) return true;
135 return false;
136 }
137
138 // libdl.so.2 is apparently preferred when present?
139 [DllImport("libdl.so.2", CharSet = CharSet.Ansi, EntryPoint = "dlopen")]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected