mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 02:38:31 +00:00
Incorporate more small improvements
This commit is contained in:
parent
1d4eb08fa1
commit
f83eb440f7
20 changed files with 121 additions and 256 deletions
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/errno.h"
|
||||
#include "libc/thread/tls.h"
|
||||
|
||||
/**
|
||||
* Global variable for last error.
|
||||
|
@ -31,3 +32,14 @@
|
|||
* @see __errno_location() stable abi
|
||||
*/
|
||||
errno_t __errno;
|
||||
|
||||
/**
|
||||
* Returns address of `errno` variable.
|
||||
*/
|
||||
errno_t *__errno_location(void) {
|
||||
if (__tls_enabled) {
|
||||
return &__get_tls()->tib_errno;
|
||||
} else {
|
||||
return &__errno;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue