summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/strace/futex.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2018-12-06 11:42:23 -0800
committerShentubot <shentubot@google.com>2018-12-06 11:43:11 -0800
commit666db00c262c7d6d6359fbaba28e344d015a7823 (patch)
treebe5e9ca85570c04ec5625b79657ab47b0a38aada /pkg/sentry/strace/futex.go
parent000fa84a3bb1aebeda235c56545c942d7c29003d (diff)
Convert ValueSet to a map
Unlike FlagSet, order doesn't matter here, so it can simply be a map. PiperOrigin-RevId: 224377910 Change-Id: I15810c698a7f02d8614bf09b59583ab73cba0514
Diffstat (limited to 'pkg/sentry/strace/futex.go')
-rw-r--r--pkg/sentry/strace/futex.go65
1 files changed, 13 insertions, 52 deletions
diff --git a/pkg/sentry/strace/futex.go b/pkg/sentry/strace/futex.go
index ceb3dc21d..f4aa7fcad 100644
--- a/pkg/sentry/strace/futex.go
+++ b/pkg/sentry/strace/futex.go
@@ -21,58 +21,19 @@ import (
// FutexCmd are the possible futex(2) commands.
var FutexCmd = abi.ValueSet{
- {
- Value: linux.FUTEX_WAIT,
- Name: "FUTEX_WAIT",
- },
- {
- Value: linux.FUTEX_WAKE,
- Name: "FUTEX_WAKE",
- },
- {
- Value: linux.FUTEX_FD,
- Name: "FUTEX_FD",
- },
- {
- Value: linux.FUTEX_REQUEUE,
- Name: "FUTEX_REQUEUE",
- },
- {
- Value: linux.FUTEX_CMP_REQUEUE,
- Name: "FUTEX_CMP_REQUEUE",
- },
- {
- Value: linux.FUTEX_WAKE_OP,
- Name: "FUTEX_WAKE_OP",
- },
- {
- Value: linux.FUTEX_LOCK_PI,
- Name: "FUTEX_LOCK_PI",
- },
- {
- Value: linux.FUTEX_UNLOCK_PI,
- Name: "FUTEX_UNLOCK_PI",
- },
- {
- Value: linux.FUTEX_TRYLOCK_PI,
- Name: "FUTEX_TRYLOCK_PI",
- },
- {
- Value: linux.FUTEX_WAIT_BITSET,
- Name: "FUTEX_WAIT_BITSET",
- },
- {
- Value: linux.FUTEX_WAKE_BITSET,
- Name: "FUTEX_WAKE_BITSET",
- },
- {
- Value: linux.FUTEX_WAIT_REQUEUE_PI,
- Name: "FUTEX_WAIT_REQUEUE_PI",
- },
- {
- Value: linux.FUTEX_CMP_REQUEUE_PI,
- Name: "FUTEX_CMP_REQUEUE_PI",
- },
+ linux.FUTEX_WAIT: "FUTEX_WAIT",
+ linux.FUTEX_WAKE: "FUTEX_WAKE",
+ linux.FUTEX_FD: "FUTEX_FD",
+ linux.FUTEX_REQUEUE: "FUTEX_REQUEUE",
+ linux.FUTEX_CMP_REQUEUE: "FUTEX_CMP_REQUEUE",
+ linux.FUTEX_WAKE_OP: "FUTEX_WAKE_OP",
+ linux.FUTEX_LOCK_PI: "FUTEX_LOCK_PI",
+ linux.FUTEX_UNLOCK_PI: "FUTEX_UNLOCK_PI",
+ linux.FUTEX_TRYLOCK_PI: "FUTEX_TRYLOCK_PI",
+ linux.FUTEX_WAIT_BITSET: "FUTEX_WAIT_BITSET",
+ linux.FUTEX_WAKE_BITSET: "FUTEX_WAKE_BITSET",
+ linux.FUTEX_WAIT_REQUEUE_PI: "FUTEX_WAIT_REQUEUE_PI",
+ linux.FUTEX_CMP_REQUEUE_PI: "FUTEX_CMP_REQUEUE_PI",
}
func futex(op uint64) string {