Skip to content

Use CApiFFI for syscalls that break with glibc's handling of 64-bit time_t #16

Open
@iliastsi

Description

As part of the effort to support 64-bit time_t on 32-bit platforms, glibc uses macros to define functions like clock_gettime(), time(), mktime(), localtime() etc. This breaks old-time which uses the ccall calling convention.

As an example, the following code breaks on a 32-bit system with 64-bit time_t:

import System.Time

main = do
  let clock = TOD 3000000000 0
  let utc = toUTCTime clock
  print $ show clock
  print $ show $ toClockTime utc

output:

"Sat Jan 24 05:20:00 UTC 2065"
"Sun Feb  7 06:28:15 UTC 2106"

Here are some related fixes on other Haskell libraries:

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions