2020-07-12 14:30:16 -05:00
|
|
|
#include <sys/syscalls.h>
|
|
|
|
|
|
|
|
#define QUAUX(X) #X
|
|
|
|
#define QU(X) QUAUX(X)
|
|
|
|
|
2019-04-08 15:58:30 -05:00
|
|
|
int* __get_errno_address() {
|
|
|
|
int* address;
|
|
|
|
asm volatile(" \
|
2020-07-12 14:30:16 -05:00
|
|
|
mov $" QU(SYSCALL_GET_ERRNO_ADDR) ", %%eax; \
|
2019-04-08 15:58:30 -05:00
|
|
|
int $80; \
|
|
|
|
":"=b"(address):);
|
|
|
|
return address;
|
|
|
|
}
|