github.com/endophage/docker@v1.4.2-0.20161027011718-242853499895/pkg/chrootarchive/chroot_unix.go (about)

     1  // +build !windows,!linux
     2  
     3  package chrootarchive
     4  
     5  import "syscall"
     6  
     7  func chroot(path string) error {
     8  	if err := syscall.Chroot(path); err != nil {
     9  		return err
    10  	}
    11  	return syscall.Chdir("/")
    12  }