Replace the errno symbol with a weak reference and a default implementation which returns a global shared errno pointer; a pthreads implementation will override the weak reference, and can access the global value if needed.