github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/chrootarchive/chroot_unix.go (about)

     1  // +build !windows,!linux
     2  
     3  package chrootarchive // import "github.com/demonoid81/moby/pkg/chrootarchive"
     4  
     5  import "golang.org/x/sys/unix"
     6  
     7  func chroot(path string) error {
     8  	if err := unix.Chroot(path); err != nil {
     9  		return err
    10  	}
    11  	return unix.Chdir("/")
    12  }
    13  
    14  func realChroot(path string) error {
    15  	return chroot(path)
    16  }