mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Work on magic numbers for aarch64
This commit is contained in:
parent
59766efd3e
commit
5a455eaa0b
2070 changed files with 4567 additions and 4200 deletions
|
@ -95,13 +95,19 @@ int clock_gettime(int clock, struct timespec *ts) {
|
|||
return rc;
|
||||
}
|
||||
|
||||
#ifdef __aarch64__
|
||||
#define CGT_VDSO __vdsosym("LINUX_2.6.39", "__kernel_clock_gettime")
|
||||
#else
|
||||
#define CGT_VDSO __vdsosym("LINUX_2.6", "__vdso_clock_gettime")
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns pointer to fastest clock_gettime().
|
||||
*/
|
||||
clock_gettime_f *__clock_gettime_get(bool *opt_out_isfast) {
|
||||
bool isfast;
|
||||
clock_gettime_f *res;
|
||||
if (IsLinux() && (res = __vdsosym("LINUX_2.6", "__vdso_clock_gettime"))) {
|
||||
if (IsLinux() && (res = CGT_VDSO)) {
|
||||
isfast = true;
|
||||
} else if (IsXnu()) {
|
||||
isfast = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue