2022-11-16 15:29:45 -06:00
|
|
|
//go:build (!windows && !plan9 && !openbsd) || (!windows && !plan9 && !mips64)
|
|
|
|
|
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"syscall"
|
|
|
|
|
|
|
|
"github.com/creack/pty"
|
|
|
|
)
|
|
|
|
|
2023-07-10 19:12:12 -05:00
|
|
|
func getSysProcAttr(_ string, tty bool) *syscall.SysProcAttr {
|
2022-11-16 15:29:45 -06:00
|
|
|
if tty {
|
|
|
|
return &syscall.SysProcAttr{
|
|
|
|
Setsid: true,
|
|
|
|
Setctty: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return &syscall.SysProcAttr{
|
|
|
|
Setpgid: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func openPty() (*os.File, *os.File, error) {
|
|
|
|
return pty.Open()
|
|
|
|
}
|