diff options
Diffstat (limited to 'pkg/sentry/fs/timerfd')
-rw-r--r-- | pkg/sentry/fs/timerfd/BUILD | 19 | ||||
-rw-r--r-- | pkg/sentry/fs/timerfd/timerfd_state_autogen.go | 40 |
2 files changed, 40 insertions, 19 deletions
diff --git a/pkg/sentry/fs/timerfd/BUILD b/pkg/sentry/fs/timerfd/BUILD deleted file mode 100644 index d16cdb4df..000000000 --- a/pkg/sentry/fs/timerfd/BUILD +++ /dev/null @@ -1,19 +0,0 @@ -load("//tools:defs.bzl", "go_library") - -package(licenses = ["notice"]) - -go_library( - name = "timerfd", - srcs = ["timerfd.go"], - visibility = ["//pkg/sentry:internal"], - deps = [ - "//pkg/context", - "//pkg/sentry/fs", - "//pkg/sentry/fs/anon", - "//pkg/sentry/fs/fsutil", - "//pkg/sentry/kernel/time", - "//pkg/syserror", - "//pkg/usermem", - "//pkg/waiter", - ], -) diff --git a/pkg/sentry/fs/timerfd/timerfd_state_autogen.go b/pkg/sentry/fs/timerfd/timerfd_state_autogen.go new file mode 100644 index 000000000..2a411ceab --- /dev/null +++ b/pkg/sentry/fs/timerfd/timerfd_state_autogen.go @@ -0,0 +1,40 @@ +// automatically generated by stateify. + +package timerfd + +import ( + "gvisor.dev/gvisor/pkg/state" +) + +func (x *TimerOperations) StateTypeName() string { + return "pkg/sentry/fs/timerfd.TimerOperations" +} + +func (x *TimerOperations) StateFields() []string { + return []string{ + "timer", + "val", + } +} + +func (x *TimerOperations) beforeSave() {} + +func (x *TimerOperations) StateSave(m state.Sink) { + x.beforeSave() + if !state.IsZeroValue(&x.events) { + state.Failf("events is %#v, expected zero", &x.events) + } + m.Save(0, &x.timer) + m.Save(1, &x.val) +} + +func (x *TimerOperations) afterLoad() {} + +func (x *TimerOperations) StateLoad(m state.Source) { + m.Load(0, &x.timer) + m.Load(1, &x.val) +} + +func init() { + state.Register((*TimerOperations)(nil)) +} |