unix icon indicating copy to clipboard operation
unix copied to clipboard

Fix CTimeVal definition for platforms where time_t isn't CLong

Open liskin opened this issue 1 year ago • 5 comments
trafficstars

One such platform is Debian unstable armhf, which is in the process of transitioning to 64-bit time_t: https://wiki.debian.org/ReleaseGoals/64bit-time

On that platform (as well as any other glibc/musl platform), however, CTimeVal isn't used for anything at all because there are #ifdefs that prefer using utimensat which takes CTimeSpec instead. This fix is therefore quite theoretical, as it is unknown whether there are any platforms actually affected.

Related: https://github.com/haskell/unix/pull/252

liskin avatar Apr 30 '24 16:04 liskin

@liskin could you please rebase? Hopefully CI will get better.

Bodigrim avatar May 01 '24 22:05 Bodigrim

@liskin could you please rebase? Hopefully CI will get better.

Done, pls reapprove the CI workflows.

liskin avatar May 02 '24 07:05 liskin

Posix standard is very clear: https://pubs.opengroup.org/onlinepubs/009604599/basedefs/sys/time.h.html

time_t         tv_sec      Seconds. 
suseconds_t    tv_usec     Microseconds.

So this doesn't seem theoretical to me at all. It must be fixed.

hasufell avatar May 02 '24 07:05 hasufell

So this doesn't seem theoretical to me at all. It must be fixed.

Yeah, sure, it's just a bit silly that we have no idea whether there is an actual platform where that code is being used, and if so, what that platform is…

liskin avatar May 02 '24 07:05 liskin

@hs-viktor any opinions?

hasufell avatar May 02 '24 13:05 hasufell

@vdukhovni what do you think about this?

Bodigrim avatar May 29 '24 18:05 Bodigrim

I'm fairly confident about this.

@liskin ping me in a week (or at Zurihac) and I'll merge, unless there are objections in the meantime.

hasufell avatar May 30 '24 00:05 hasufell

@liskin ping me in a week (or at Zurihac) and I'll merge, unless there are objections in the meantime.

Won't be attending ZuriHac this year unfortunately, so just a ping. 🍻

liskin avatar Jun 07 '24 16:06 liskin

Thanks!

Bodigrim avatar Jun 17 '24 22:06 Bodigrim