With reentrant C libraries like the GNUPro C library, errno is a macro which expands to the per-thread error value. This makes it thread safe.
When the user provides his own matherr function, it must be reentrant for the math library as a whole to be reentrant.
In normal debugged programs, there are usually no math subroutine errors—and therefore no assignments to errno and no matherr calls; in that situation, the math functions behave reentrantly.