[darwin][process]: fix errno handling and library lifetime on darwin
Read errno through __error() resolved before the libc call, so that the dlsym and allocation performed by symbol resolution cannot overwrite it first. Apply the same to CwdWithContext, which additionally read errno without checking for failure and could surface a stale EPERM. Share dlopen handles process-wide instead of opening and closing them per call, completing for libSystem what #1832 did for IOKit and CoreFoundation. Stop populating ReadBytes/WriteBytes on darwin, which #2117 filled with the disk figures. They mean all I/O including cache on other platforms, so reusing the disk value there would silently change what the field means depending on the platform.
S
shirou committed
2114d0d1831ca2e306aebb0426b9c2dd4fae475c
Parent: f8c8657