use __attribute__((const)) for errno and pthread_self if __GNUC__ is defined