Skip to content
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

syscall: updates types related to "time_t" to 64-bit on linux/arm #60248

Open
xray-bit opened this issue May 17, 2023 · 3 comments
Open

syscall: updates types related to "time_t" to 64-bit on linux/arm #60248

xray-bit opened this issue May 17, 2023 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@xray-bit
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.20.4 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

linux/arm

What did you do?

What did you expect to see?

I'm hoping it can be made compatible with the 64-bit "time_t" type to solve the "2038 problem".

What did you see instead?

All types in ztypes_linux_arm.go related to "time_t" are 32-bit (such as Timespec, Timeval, Time_t, etc.). However, as of Linux 5.10, all "time_t"-related types have been updated to 64-bit (although I'm not certain from which kernel version this change was made).

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 17, 2023
@heschi heschi added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 17, 2023
@heschi heschi added this to the Backlog milestone May 17, 2023
@heschi
Copy link
Contributor

heschi commented May 17, 2023

cc @golang/runtime

@mknyszek mknyszek changed the title syscall: types related to "time_t" on linux/arm syscall: updates types related to "time_t" to 64-bit on linux/arm May 17, 2023
@mknyszek
Copy link
Contributor

ARM, 386, and MIPS are I think all using a 32-bit time_t. I don't think any of us are going to work on this in the short-term. It's also a question of whether we should even update the syscall package, because it's frozen (not saying we shouldn't anyway but it is indeed frozen). We should at least update golang.org/x/sys/unix if it isn't already.

@ianlancetaylor
Copy link
Contributor

My understanding is that implementing this means changing Time_t to be 64 bits, and then changing the following functions to call the 64-bit versions of the system calls:

  • ClockGettime
  • ClockAdjtime
  • ClockGetres
  • ClockNanosleep
  • Futimesat
  • Gettimeofday
  • Select
  • Time
  • TimerfdGettime
  • TimerfdSettime
  • Utimes
  • UtimesNanoAt
  • Pselect
  • Ppoll

As the 64-bit system calls are not available on all supported Linux versions, the code will have to fall back to the 32-bit versions of the system calls if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

5 participants