corsis / clock

High-resolution clock functions: monotonic, realtime, cputime.
Other
58 stars 25 forks source link

clock_gettime error handling #61

Closed rumkeller closed 3 years ago

rumkeller commented 4 years ago

clock_gettime returns -1 to indicate an error. However, the return value appears to be ignored:

foreign import ccall unsafe clock_gettime :: #{type clockid_t} -> Ptr TimeSpec -> IO ()

This could be remedied by a call to throwErrnoIfMinus1_.