mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-29 19:57:51 +00:00
The seccomp/containers-golang library is not maintained any more and we should stick to containers/common. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
32 lines
875 B
Go
32 lines
875 B
Go
package seccomp
|
|
|
|
import "fmt"
|
|
|
|
var goArchToSeccompArchMap = map[string]Arch{
|
|
"386": ArchX86,
|
|
"amd64": ArchX86_64,
|
|
"amd64p32": ArchX32,
|
|
"arm": ArchARM,
|
|
"arm64": ArchAARCH64,
|
|
"mips": ArchMIPS,
|
|
"mips64": ArchMIPS64,
|
|
"mips64le": ArchMIPSEL64,
|
|
"mips64p32": ArchMIPS64N32,
|
|
"mips64p32le": ArchMIPSEL64N32,
|
|
"mipsle": ArchMIPSEL,
|
|
"ppc": ArchPPC,
|
|
"ppc64": ArchPPC64,
|
|
"ppc64le": ArchPPC64LE,
|
|
"s390": ArchS390,
|
|
"s390x": ArchS390X,
|
|
}
|
|
|
|
// GoArchToSeccompArch converts a runtime.GOARCH to a seccomp `Arch`. The
|
|
// function returns an error if the architecture conversion is not supported.
|
|
func GoArchToSeccompArch(goArch string) (Arch, error) {
|
|
arch, ok := goArchToSeccompArchMap[goArch]
|
|
if !ok {
|
|
return "", fmt.Errorf("unsupported go arch provided: %s", goArch)
|
|
}
|
|
return arch, nil
|
|
}
|