xref: /aosp_15_r20/external/musl/src/network/h_errno.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1*c9945492SAndroid Build Coastguard Worker #include <netdb.h>
2*c9945492SAndroid Build Coastguard Worker #include "pthread_impl.h"
3*c9945492SAndroid Build Coastguard Worker 
4*c9945492SAndroid Build Coastguard Worker #undef h_errno
5*c9945492SAndroid Build Coastguard Worker int h_errno;
6*c9945492SAndroid Build Coastguard Worker 
__h_errno_location(void)7*c9945492SAndroid Build Coastguard Worker int *__h_errno_location(void)
8*c9945492SAndroid Build Coastguard Worker {
9*c9945492SAndroid Build Coastguard Worker 	if (!__pthread_self()->stack) return &h_errno;
10*c9945492SAndroid Build Coastguard Worker 	return &__pthread_self()->h_errno_val;
11*c9945492SAndroid Build Coastguard Worker }
12