runtime: add timer_create syscalls for Linux

Updates #35057

Change-Id: Id702b502fa4e4005ba1e450a945bc4420a8a8b8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/342052
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Than McIntosh <thanm@google.com>
This commit is contained in:
Rhys Hiltner 2021-08-13 08:34:25 -07:00 committed by Michael Pratt
parent d4007aedfa
commit 3d795ea798
21 changed files with 478 additions and 0 deletions

View file

@ -28,6 +28,9 @@ const (
_SA_RESTORER = 0x4000000
_SA_SIGINFO = 0x4
_SI_KERNEL = 0x80
_SI_TIMER = -0x2
_SIGHUP = 0x1
_SIGINT = 0x2
_SIGQUIT = 0x3
@ -79,6 +82,10 @@ const (
_ITIMER_VIRTUAL = 0x1
_ITIMER_PROF = 0x2
_CLOCK_THREAD_CPUTIME_ID = 0x3
_SIGEV_THREAD_ID = 0x4
_O_RDONLY = 0x0
_O_NONBLOCK = 0x800
_O_CLOEXEC = 0x80000
@ -212,11 +219,24 @@ type ucontext struct {
uc_sigmask uint32
}
type itimerspec struct {
it_interval timespec
it_value timespec
}
type itimerval struct {
it_interval timeval
it_value timeval
}
type sigevent struct {
value uintptr
signo int32
notify int32
// below here is a union; sigev_notify_thread_id is the only field we use
sigev_notify_thread_id int32
}
type epollevent struct {
events uint32
data [8]byte // to match amd64