mirror of
https://github.com/containers/podman
synced 2024-10-20 17:23:30 +00:00
a0575d6e46
(make localunit) complains about the unbuildable subpackage; silence that. Actually, I can't find any user of checkseccomp in this repo; maybe it is entirely unused? Signed-off-by: Miloslav Trmač <mitr@redhat.com> Closes: #1115 Approved by: rhatdan
21 lines
412 B
Go
21 lines
412 B
Go
// +build seccomp
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func main() {
|
|
// Check if Seccomp is supported, via CONFIG_SECCOMP.
|
|
if err := unix.Prctl(unix.PR_GET_SECCOMP, 0, 0, 0, 0); err != unix.EINVAL {
|
|
// Make sure the kernel has CONFIG_SECCOMP_FILTER.
|
|
if err := unix.Prctl(unix.PR_SET_SECCOMP, unix.SECCOMP_MODE_FILTER, 0, 0, 0); err != unix.EINVAL {
|
|
os.Exit(0)
|
|
}
|
|
}
|
|
os.Exit(1)
|
|
}
|