Implemented support for thread-local storage
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
|
||||
#include <sys/_errno.h>
|
||||
|
||||
#define errno (*__errno_location())
|
||||
#define errno (__get_errno())
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int *__errno_location(void);
|
||||
extern void __set_errno(int v);
|
||||
extern int __get_errno(void);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
11
photon/libc/sys/horizon/machine/x86_64/pthread.s
Normal file
11
photon/libc/sys/horizon/machine/x86_64/pthread.s
Normal file
@@ -0,0 +1,11 @@
|
||||
.global pthread_self
|
||||
.type pthread_self, @function
|
||||
|
||||
pthread_self:
|
||||
push %rbp
|
||||
mov %rsp, %rbp
|
||||
|
||||
mov %fs:0, %rax
|
||||
|
||||
pop %rbp
|
||||
ret
|
||||
Reference in New Issue
Block a user