fn init_vdso_clock_gettime(clk: clockid_t, ts: *timespec) callconv(.c) usize 2166
2167
2168
2169
2170
2171
2172
2173
2174fn init_vdso_clock_gettime(clk: clockid_t, ts: *timespec) callconv(.c) usize {
const ptr: ?VdsoClockGettime = @ptrFromInt(vdso.lookup(VDSO.CGT_VER, VDSO.CGT_SYM));
// Note that we may not have a VDSO at all, update the stub address anyway
// so that clock_gettime will fall back on the good old (and slow) syscall
@atomicStore(?VdsoClockGettime, &vdso_clock_gettime, ptr, .monotonic);
// Call into the VDSO if available
if (ptr) |f| return f(clk, ts);
return @bitCast(-@as(isize, @backingInt(E.NOSYS)));
}