2017-01-19 17:10:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2017-06-28 15:47:31 +00:00
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
2017-01-19 17:10:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
// Check if Seccomp is supported, via CONFIG_SECCOMP.
|
2017-07-18 13:32:15 +00:00
|
|
|
if err := unix.Prctl(unix.PR_GET_SECCOMP, 0, 0, 0, 0); err != unix.EINVAL {
|
2017-01-19 17:10:47 +00:00
|
|
|
// Make sure the kernel has CONFIG_SECCOMP_FILTER.
|
2017-07-18 13:32:15 +00:00
|
|
|
if err := unix.Prctl(unix.PR_SET_SECCOMP, unix.SECCOMP_MODE_FILTER, 0, 0, 0); err != unix.EINVAL {
|
2017-01-19 17:10:47 +00:00
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
os.Exit(1)
|
|
|
|
}
|