Last active
November 6, 2020 01:13
-
-
Save 0xc0d/7832476adaf0f3dfba12629d8b8109a9 to your computer and use it in GitHub Desktop.
reexec is something like clone.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
args := []string{"fork"} | |
... | |
cmd := reexec.Command(args...) | |
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr | |
cmd.SysProcAttr = &syscall.SysProcAttr{ | |
Cloneflags: syscall.CLONE_NEWUTS | | |
syscall.CLONE_NEWIPC | | |
syscall.CLONE_NEWPID | | |
syscall.CLONE_NEWNS, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment