Define an __errno_location function. (#347)

This function returns the address of `errno`, which makes it easier to
access from non-C languages since `errno` is a thread-local variable
which requires a special ABI.
This commit is contained in:
Dan Gohman 2022-11-28 13:50:04 -08:00 committed by GitHub
parent a00bf321ee
commit 2bb5abedbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -48,6 +48,7 @@ __do_des
__do_orphaned_stdio_locks
__duplocale
__env_rm_add
__errno_location
__exp2f_data
__exp_data
__expo2

View File

@ -38,6 +38,7 @@ __des_setkey
__do_des
__duplocale
__env_rm_add
__errno_location
__exp2f_data
__exp_data
__expo2

View File

@ -0,0 +1,5 @@
#include <errno.h>
int *__errno_location(void) {
return &errno;
}