std.posix: Use separate clock ID enums for clock_gettime() and timerfd_create() (#22627)
This commit is contained in:
@@ -543,7 +543,7 @@ const PosixImpl = struct {
|
||||
// This can be changed with pthread_condattr_setclock, but it's an extension and may not be available everywhere.
|
||||
var ts: c.timespec = undefined;
|
||||
if (timeout) |timeout_ns| {
|
||||
std.posix.clock_gettime(c.CLOCK.REALTIME, &ts) catch unreachable;
|
||||
ts = std.posix.clock_gettime(c.CLOCK.REALTIME) catch unreachable;
|
||||
ts.sec +|= @as(@TypeOf(ts.sec), @intCast(timeout_ns / std.time.ns_per_s));
|
||||
ts.nsec += @as(@TypeOf(ts.nsec), @intCast(timeout_ns % std.time.ns_per_s));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user