源码如下:
```
package main
import (
"os/exec"
"log"
"syscall"
"os"
)
func main() {
cmd := exec.Command("sh")
cmd.SysProcAttr = &syscall.SysProcAttr{Cloneflags: syscall.CLONE_NEWUTS, }
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatal("error occurs in run sh")
}
}
```
编译上报:
unknown field 'Cloneflags' in struct literal of type syscall.SysProcAttr
多谢各位大神。
有疑问加站长微信联系(非本文作者)