Files
semi-libc/src/errno/__errno_location.c
T
Rich Felker e13063aad7 add hidden version of &errno accessor function
this significantly improves codegen in functions that need to access
errno but otherwise have no need for a GOT pointer.

we could probably improve it much more by including an inline version
of the &errno accessor function, but that depends on having the
definitions of struct __pthread and __pthread_self(), which at present
would expose a lot more than is appropriate. moving them to a small
tls.h later might make this more reasonable.
2018-09-14 23:08:53 -04:00

10 lines
166 B
C

#include <errno.h>
#include "pthread_impl.h"
int *__errno_location(void)
{
return &__pthread_self()->errno_val;
}
weak_alias(__errno_location, ___errno_location);