def SeccompAction.clip

bend-osdev-bpf@0.1.0.0 · seccomp.bend:128

import bend-osdev-bpf@0.1.0.0/seccomp.bend as Seccomp
import Base

128# the same action with its data cut to the 16 bits a return value holds
129def SeccompAction.clip(a: SeccompAction) -> SeccompAction:
130  match a:
131    case SeccompTrap{d}:
132      SeccompTrap{U32.and(65535, d)}
133    case SeccompErrno{d}:
134      SeccompErrno{U32.and(65535, d)}
135    case SeccompTrace{d}:
136      SeccompTrace{U32.and(65535, d)}
137    case other:
138      other

Uses (2)

Used by (1)