diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-02-28 20:47:23 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-02-28 20:48:30 +0900 |
| commit | ad8f799703a4bf8d87741890ba831856af2dd145 (patch) | |
| tree | 26877d60bb5bd03fb98f85b28a9a99bad1d96f6d /container | |
| parent | c74c269b66770f0eddde255d2805b79f274409e9 (diff) | |
container/std: rename seccomp types
Aliases will be kept until 0.4.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container')
| -rw-r--r-- | container/netlink.go | 2 | ||||
| -rw-r--r-- | container/seccomp/std_test.go | 4 | ||||
| -rw-r--r-- | container/std/seccomp.go | 16 | ||||
| -rw-r--r-- | container/std/types.go | 8 | ||||
| -rw-r--r-- | container/syscall.go | 2 |
5 files changed, 22 insertions, 10 deletions
diff --git a/container/netlink.go b/container/netlink.go index 063494ee..412f964e 100644 --- a/container/netlink.go +++ b/container/netlink.go @@ -99,7 +99,7 @@ done: } if m.Header.Type == NLMSG_ERROR { if len(m.Data) >= 4 { - errno := Errno(-std.ScmpInt(binary.NativeEndian.Uint32(m.Data))) + errno := Errno(-std.Int(binary.NativeEndian.Uint32(m.Data))) if errno == 0 { return nil } diff --git a/container/seccomp/std_test.go b/container/seccomp/std_test.go index 438a5e3b..6d548dce 100644 --- a/container/seccomp/std_test.go +++ b/container/seccomp/std_test.go @@ -24,8 +24,8 @@ func TestSyscallResolveName(t *testing.T) { } func TestRuleType(t *testing.T) { - assertKind[std.ScmpUint, scmpUint](t) - assertKind[std.ScmpInt, scmpInt](t) + assertKind[std.Uint, scmpUint](t) + assertKind[std.Int, scmpInt](t) assertSize[std.NativeRule, syscallRule](t) assertKind[std.ScmpDatum, scmpDatum](t) diff --git a/container/std/seccomp.go b/container/std/seccomp.go index 17f36706..e808e61f 100644 --- a/container/std/seccomp.go +++ b/container/std/seccomp.go @@ -7,24 +7,28 @@ import ( type ( // ScmpUint is equivalent to C.uint. - ScmpUint uint32 + // + // Deprecated: This type has been renamed to Uint and will be removed in 0.4. + ScmpUint = Uint // ScmpInt is equivalent to C.int. - ScmpInt int32 + // + // Deprecated: This type has been renamed to Int and will be removed in 0.4. + ScmpInt = Int // ScmpSyscall represents a syscall number passed to libseccomp via [NativeRule.Syscall]. - ScmpSyscall ScmpInt + ScmpSyscall Int // ScmpErrno represents an errno value passed to libseccomp via [NativeRule.Errno]. - ScmpErrno ScmpInt + ScmpErrno Int // ScmpCompare is equivalent to enum scmp_compare; - ScmpCompare ScmpUint + ScmpCompare Uint // ScmpDatum is equivalent to scmp_datum_t. ScmpDatum uint64 // ScmpArgCmp is equivalent to struct scmp_arg_cmp. ScmpArgCmp struct { // argument number, starting at 0 - Arg ScmpUint `json:"arg"` + Arg Uint `json:"arg"` // the comparison op, e.g. SCMP_CMP_* Op ScmpCompare `json:"op"` diff --git a/container/std/types.go b/container/std/types.go new file mode 100644 index 00000000..e1b53063 --- /dev/null +++ b/container/std/types.go @@ -0,0 +1,8 @@ +package std + +type ( + // Uint is equivalent to C.uint. + Uint uint32 + // Int is equivalent to C.int. + Int int32 +) diff --git a/container/syscall.go b/container/syscall.go index e5f86cf6..5f392c35 100644 --- a/container/syscall.go +++ b/container/syscall.go @@ -58,7 +58,7 @@ const ( // schedParam is equivalent to struct sched_param from include/linux/sched.h. type schedParam struct { // sched_priority - priority std.ScmpInt + priority std.Int } // schedSetscheduler sets both the scheduling policy and parameters for the |
