summaryrefslogtreecommitdiffhomepage
path: root/pkg/abi/linux
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2021-01-12 12:36:17 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-12 12:38:22 -0800
commit4e03e87547853523d4ff941935a6ef1712518c61 (patch)
treee930ce0e5f15f7041e7b74daca05acc7afbd2558 /pkg/abi/linux
parenta20da708291e2e5bdece5176dce61c1b4b10b7d9 (diff)
Fix simple mistakes identified by goreportcard.
These are primarily simplification and lint mistakes. However, minor fixes are also included and tests added where appropriate. PiperOrigin-RevId: 351425971
Diffstat (limited to 'pkg/abi/linux')
-rw-r--r--pkg/abi/linux/fadvise.go1
-rw-r--r--pkg/abi/linux/ipc.go14
-rw-r--r--pkg/abi/linux/netfilter_ipv6.go1
-rw-r--r--pkg/abi/linux/sched.go1
-rw-r--r--pkg/abi/linux/seccomp.go2
-rw-r--r--pkg/abi/linux/sem.go5
6 files changed, 19 insertions, 5 deletions
diff --git a/pkg/abi/linux/fadvise.go b/pkg/abi/linux/fadvise.go
index b06ff9964..97e2e4532 100644
--- a/pkg/abi/linux/fadvise.go
+++ b/pkg/abi/linux/fadvise.go
@@ -14,6 +14,7 @@
package linux
+// Fadvise constants.
const (
POSIX_FADV_NORMAL = 0
POSIX_FADV_RANDOM = 1
diff --git a/pkg/abi/linux/ipc.go b/pkg/abi/linux/ipc.go
index c6e65df62..f84144355 100644
--- a/pkg/abi/linux/ipc.go
+++ b/pkg/abi/linux/ipc.go
@@ -14,8 +14,9 @@
package linux
-// Control commands used with semctl, shmctl, and msgctl. Source:
-// include/uapi/linux/ipc.h.
+// Control commands used with semctl, shmctl, and msgctl.
+//
+// Source: include/uapi/linux/ipc.h.
const (
IPC_RMID = 0
IPC_SET = 1
@@ -23,14 +24,19 @@ const (
IPC_INFO = 3
)
-// resource get request flags. Source: include/uapi/linux/ipc.h
+// Resource get request flags.
+//
+// Source: include/uapi/linux/ipc.h
const (
IPC_CREAT = 00001000
IPC_EXCL = 00002000
IPC_NOWAIT = 00004000
)
-const IPC_PRIVATE = 0
+// IPC flags.
+const (
+ IPC_PRIVATE = 0
+)
// In Linux, amd64 does not enable CONFIG_ARCH_WANT_IPC_PARSE_VERSION, so SysV
// IPC unconditionally uses the "new" 64-bit structures that are needed for
diff --git a/pkg/abi/linux/netfilter_ipv6.go b/pkg/abi/linux/netfilter_ipv6.go
index 6d31eb5e3..bcb57642e 100644
--- a/pkg/abi/linux/netfilter_ipv6.go
+++ b/pkg/abi/linux/netfilter_ipv6.go
@@ -288,6 +288,7 @@ type IP6TIP struct {
_ [3]byte
}
+// SizeOfIP6TIP is the size of an IP6 header.
const SizeOfIP6TIP = 136
// Flags in IP6TIP.Flags. Corresponding constants are in
diff --git a/pkg/abi/linux/sched.go b/pkg/abi/linux/sched.go
index 70e820823..2a67921e6 100644
--- a/pkg/abi/linux/sched.go
+++ b/pkg/abi/linux/sched.go
@@ -29,6 +29,7 @@ const (
SCHED_RESET_ON_FORK = 0x40000000
)
+// Scheduling priority group selectors.
const (
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
diff --git a/pkg/abi/linux/seccomp.go b/pkg/abi/linux/seccomp.go
index 5be3f10f9..e64501fac 100644
--- a/pkg/abi/linux/seccomp.go
+++ b/pkg/abi/linux/seccomp.go
@@ -30,8 +30,10 @@ const (
SECCOMP_GET_ACTION_AVAIL = 2
)
+// BPFAction is an action for a BPF filter.
type BPFAction uint32
+// BPFAction definitions.
const (
SECCOMP_RET_KILL_PROCESS BPFAction = 0x80000000
SECCOMP_RET_KILL_THREAD BPFAction = 0x00000000
diff --git a/pkg/abi/linux/sem.go b/pkg/abi/linux/sem.go
index 2424884c1..bc7b4f0ee 100644
--- a/pkg/abi/linux/sem.go
+++ b/pkg/abi/linux/sem.go
@@ -49,7 +49,10 @@ const (
SEMUSZ = 20
)
-const SEM_UNDO = 0x1000
+// Semaphore flags.
+const (
+ SEM_UNDO = 0x1000
+)
// Sembuf is equivalent to struct sembuf.
//