spacemonkeygo / monotime

monotonic timers for Go 1.2

Home Page:http://godoc.org/github.com/spacemonkeygo/monotime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More strict error handling may be required in `Monotonic`

hnes opened this issue · comments

Hi, I am not good at golang's asm, but the implementation logic probably seems not so strict in the monotime/mono_linux_amd64.s:

  1. As the __vdso_clock_gettime_sym may not support CLOCK_MONOTONIC_RAW ($ man clock_gettime: since Linux 2.6.28; Linux-specific), so we should also check the ret status (EINVAL|EFAULT|EPERM).

  2. When vdso_is_sad is been executed, the monotime's ret is also invalid. But it seems that there does not have any checking codes in the go function Monotonic.

Thanks a lot.