-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time_change_fd doesn't work on time64 userspace with pre-time64 kernel #14362
Comments
Uh, systems that claim 64bit time_t support but don't actually do, and without any way to determine what the actual supported range is? Couldn't there at least be clock_getmax() á la clock_getres()? Hmm, it sounds strange to me to support 64bit time_t apis on kernels that can't do them. What's the point? (Also, on Linux ENOSUP is actually an alias for EOPNOTSUPP, and the actual name is the latter. Don't tell me musl does it the other way round? Meh.) |
@fweimer, what's glibc's plan on this? |
…nel does not Fixes: systemd#14362
I prepped a potential fix in #14364. Lacking an installation of an affected system it's pretty much written from thin air though and untested... |
Fix LGTM. Re:
Re: 64-bit I would think distros using glibc will do similar (start building everything with 64-bit |
I haven't seen a patch, but glibc will likely use EOVERFLOW in this case, based on the already implemented wrappers. See |
@fweimer: We should take this back to libc-alpha, but I think that should be changed based on standard semantics of these error codes. |
As per systemd#14362 (comment) let's also prepare for EOVERFLOW.
As per systemd#14362 (comment) let's also prepare for EOVERFLOW.
As per #14362 (comment) let's also prepare for EOVERFLOW.
As per systemd/systemd#14362 (comment) let's also prepare for EOVERFLOW.
As per systemd/systemd#14362 (comment) let's also prepare for EOVERFLOW. (cherry picked from commit 9e7c8f6) (cherry picked from commit 9afd65f)
As per systemd/systemd#14362 (comment) let's also prepare for EOVERFLOW. (cherry picked from commit 9e7c8f6)
As per systemd/systemd#14362 (comment) let's also prepare for EOVERFLOW. (cherry picked from commit 9e7c8f6) (cherry picked from commit 9afd65f) (cherry picked from commit 55e0f99)
As per systemd/systemd#14362 (comment) let's also prepare for EOVERFLOW. (cherry picked from commit 9e7c8f64cfda101496f56f5546097221e8ad5d6a) (cherry picked from commit 9afd65f15e931f777e2ba3743560d63505c90ac7)
…nel does not Fixes: systemd#14362 (cherry picked from commit 601f91b) (cherry picked from commit 608d882)
…nel does not Fixes: systemd#14362 (cherry picked from commit 601f91b)
In
time_change_fd
, a value ofTIME_T_MAX
is used to set a timerfd timer for which no expiration even is ever desired (only the cancellation when clock is set is wanted):https://github.com/systemd/systemd/blob/master/src/basic/time-util.c#L1485
However, it's possible with 64-bit
time_t
("time64") on a 32-bit arch that the kernel does not support such large timeouts. Thetimerfd_settime
function is expected to use the old time32 syscall if the new time64 one is not available (this is what musl does and it's my understanding of what glibc intends to do when they eventually upstream time64 support), but silently setting the incorrect timeout, which the application could observe via reading it back withtimerfd_gettime
, is not reasonable behavior, so it must fail in this case (ENOTSUP
is the error musl uses for this; I expect glibc will do the same but I'm not sure).I'm not sure what the cleanest fix is, but if callers can tolerate a spurious timer expiration event after 68 years of uptime, just setting
INT_MAX
should be safe and easy.The text was updated successfully, but these errors were encountered: