I am on Sonoma 14.3.1, I believe I need to do something like the below but am having difficulty determining the correct dylib and APIs I can use in managed code.
[DllImport("/usr/lib/libSystem.dylib", EntryPoint = "os_log_create")]
private static extern IntPtr os_log_create(string subsystem, string category);
[DllImport("libSystem.dylib")]
private static extern int getpid();