github.com/opencontainers/runc@v1.2.0-rc.1.0.20240520010911-492dc558cdd6/libcontainer/seccomp/seccomp_unsupported.go (about)

     1  //go:build !linux || !cgo || !seccomp
     2  // +build !linux !cgo !seccomp
     3  
     4  package seccomp
     5  
     6  import (
     7  	"errors"
     8  	"os"
     9  
    10  	"github.com/opencontainers/runc/libcontainer/configs"
    11  	"github.com/opencontainers/runtime-spec/specs-go"
    12  )
    13  
    14  var ErrSeccompNotEnabled = errors.New("seccomp: config provided but seccomp not supported")
    15  
    16  // InitSeccomp does nothing because seccomp is not supported.
    17  func InitSeccomp(config *configs.Seccomp) (*os.File, error) {
    18  	if config != nil {
    19  		return nil, ErrSeccompNotEnabled
    20  	}
    21  	return nil, nil
    22  }
    23  
    24  // FlagSupported tells if a provided seccomp flag is supported.
    25  func FlagSupported(_ specs.LinuxSeccompFlag) error {
    26  	return ErrSeccompNotEnabled
    27  }
    28  
    29  // Version returns major, minor, and micro.
    30  func Version() (uint, uint, uint) {
    31  	return 0, 0, 0
    32  }
    33  
    34  // Enabled is true if seccomp support is compiled in.
    35  const Enabled = false