C variable for any error codes that have occured.

Can be annoying with threads when app is not compiled with -D_REENTRANT.

This is typically set by a system call or libc function. For whatever reason, the crooked Windows API doesn't use this, and instead uses GetLastError() and SetLastError(), adding 2 functions when all you need is a variable.