Add Pty and CloseStdin RPCs

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-04-06 12:19:00 -07:00
parent c1325a5aa9
commit a7da08b7ba
15 changed files with 1031 additions and 231 deletions

View File

@@ -28,6 +28,7 @@ type initProcess struct {
status int
pid int
closers []io.Closer
stdin io.Closer
}
func newInitProcess(context context.Context, path string, r *shimapi.CreateRequest) (*initProcess, error) {
@@ -83,6 +84,7 @@ func newInitProcess(context context.Context, path string, r *shimapi.CreateReque
if err != nil {
return nil, err
}
p.stdin = sc
p.closers = append(p.closers, sc)
}
if socket != nil {
@@ -175,3 +177,7 @@ func (p *initProcess) killAll(context context.Context) error {
func (p *initProcess) Signal(sig int) error {
return syscall.Kill(p.pid, syscall.Signal(sig))
}
func (p *initProcess) Stdin() io.Closer {
return p.stdin
}