mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall, os, exec: introduce *syscall.SysProcAttr field in os.ProcAttr and exec.Cmd
R=r, bradfitz, alex.brainman, borman, vincent.vanackere CC=golang-dev https://golang.org/cl/4607046
This commit is contained in:
parent
371aa14e06
commit
4d0f2e9195
8 changed files with 83 additions and 44 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Error records the name of a binary that failed to be be executed
|
||||
|
|
@ -62,6 +63,10 @@ type Cmd struct {
|
|||
Stdout io.Writer
|
||||
Stderr io.Writer
|
||||
|
||||
// SysProcAttr holds optional, operating system-specific attributes.
|
||||
// Run passes it to os.StartProcess as the os.ProcAttr's Sys field.
|
||||
SysProcAttr *syscall.SysProcAttr
|
||||
|
||||
// Process is the underlying process, once started.
|
||||
Process *os.Process
|
||||
|
||||
|
|
@ -225,6 +230,7 @@ func (c *Cmd) Start() os.Error {
|
|||
Dir: c.Dir,
|
||||
Files: c.childFiles,
|
||||
Env: c.envv(),
|
||||
Sys: c.SysProcAttr,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue