errno doesn't have to be a global, in the strict sense.
Suppose:
When you call errno, it will expand to my_errno_function(), which returns a pointer to the current thread's errno variable. MS' CRT implements it this way; most POSIX platforms too.Code:extern int* my_errno_function(void); #define errno (*my_errno_function())