Lines Matching defs:process

13 type process struct {
20 // Pid returns the process ID of the process within the container.
21 func (process *process) Pid() int {
22 return process.p.Pid()
25 // Kill signals the process to terminate but does not wait for it to finish terminating.
26 func (process *process) Kill() error {
27 found, err := process.p.Kill(context.Background())
29 return convertProcessError(err, process)
32 return &ProcessError{Process: process, Err: ErrElementNotFound, Operation: "hcsshim::Process::Kill"}
37 // Wait waits for the process to exit.
38 func (process *process) Wait() error {
39 return convertProcessError(process.p.Wait(), process)
42 // WaitTimeout waits for the process to exit or the duration to elapse. It returns
44 func (process *process) WaitTimeout(timeout time.Duration) error {
45 process.waitOnce.Do(func() {
46 process.waitCh = make(chan struct{})
48 process.waitErr = process.Wait()
49 close(process.waitCh)
56 return &ProcessError{Process: process, Err: ErrTimeout, Operation: "hcsshim::Process::Wait"}
57 case <-process.waitCh:
58 return process.waitErr
62 // ExitCode returns the exit code of the process. The process must have
64 func (process *process) ExitCode() (int, error) {
65 code, err := process.p.ExitCode()
67 err = convertProcessError(err, process)
72 // ResizeConsole resizes the console of the process.
73 func (process *process) ResizeConsole(width, height uint16) error {
74 return convertProcessError(process.p.ResizeConsole(context.Background(), width, height), process)
80 func (process *process) Stdio() (io.WriteCloser, io.ReadCloser, io.ReadCloser, error) {
81 stdin, stdout, stderr, err := process.p.StdioLegacy()
83 err = convertProcessError(err, process)
88 // CloseStdin closes the write side of the stdin pipe so that the process is
90 func (process *process) CloseStdin() error {
91 return convertProcessError(process.p.CloseStdin(context.Background()), process)
94 // Close cleans up any state associated with the process but does not kill
96 func (process *process) Close() error {
97 return convertProcessError(process.p.Close(), process)