github.com/geofffranks/garden-linux@v0.0.0-20160715111146-26c893169cfa/system/test_capabilities/test_capabilities.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  	"time"
     7  
     8  	"flag"
     9  
    10  	"code.cloudfoundry.org/garden-linux/system"
    11  )
    12  
    13  func main() {
    14  	extendedWhitelist := flag.Bool("extendedWhitelist", false, "")
    15  	flag.Parse()
    16  
    17  	caps := system.ProcessCapabilities{Pid: os.Getpid()}
    18  	if err := caps.Limit(*extendedWhitelist); err != nil {
    19  		panic(err)
    20  	}
    21  	fmt.Println("banana")
    22  
    23  	time.Sleep(time.Hour)
    24  }