Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for ProcAttr (0.26 sec)

  1. src/os/exec_plan9.go

    var (
    	Interrupt Signal = syscall.Note("interrupt")
    	Kill      Signal = syscall.Note("kill")
    )
    
    func startProcess(name string, argv []string, attr *ProcAttr) (p *Process, err error) {
    	sysattr := &syscall.ProcAttr{
    		Dir: attr.Dir,
    		Env: attr.Env,
    		Sys: attr.Sys,
    	}
    
    	sysattr.Files = make([]uintptr, 0, len(attr.Files))
    	for _, f := range attr.Files {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  2. src/os/exec_unix_test.go

    	"math"
    	. "os"
    	"runtime"
    	"syscall"
    	"testing"
    )
    
    func TestErrProcessDone(t *testing.T) {
    	testenv.MustHaveGoBuild(t)
    	t.Parallel()
    
    	p, err := StartProcess(testenv.GoToolPath(t), []string{"go"}, &ProcAttr{})
    	if err != nil {
    		t.Fatalf("starting test process: %v", err)
    	}
    	p.Wait()
    	if got := p.Signal(Kill); got != ErrProcessDone {
    		t.Errorf("got %v want %v", got, ErrProcessDone)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 2K bytes
    - Viewed (0)
  3. src/os/pidfd_linux_test.go

    	if err := os.CheckPidfdOnce(); err != nil {
    		// Non-pidfd code paths tested in exec_unix_test.go.
    		t.Skipf("skipping: pidfd not available: %v", err)
    	}
    
    	p, err := os.StartProcess(testenv.GoToolPath(t), []string{"go"}, &os.ProcAttr{})
    	if err != nil {
    		t.Fatalf("starting test process: %v", err)
    	}
    	p.Wait()
    
    	// Use pid of a non-existing process.
    	proc, err := os.FindProcess(p.Pid)
    	// FindProcess should never return errors on Unix.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  4. src/os/exec_posix.go

    // sending a signal.
    var (
    	Interrupt Signal = syscall.SIGINT
    	Kill      Signal = syscall.SIGKILL
    )
    
    func startProcess(name string, argv []string, attr *ProcAttr) (p *Process, err error) {
    	// If there is no SysProcAttr (ie. no Chroot or changed
    	// UID/GID), double-check existence of the directory we want
    	// to chdir into. We can make the error clearer this way.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  5. src/os/exec_test.go

    	r, w, err := os.Pipe()
    	if err != nil {
    		t.Fatalf("Pipe() got err %v, want nil", err)
    	}
    	defer r.Close()
    	defer w.Close()
    
    	p, err := os.StartProcess(testenv.GoToolPath(t), []string{"go"}, &os.ProcAttr{
    		// N.B. On Windows, StartProcess requires exactly 3 Files. Pass
    		// in a dummy pipe to avoid irrelevant output on the test stdout.
    		Files: []*os.File{r, w, w},
    	})
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  6. src/os/exec.go

    	// returning the wait status, while future calls error with "process
    	// released" rather than "process done".
    	p.state.CompareAndSwap(0, uint64(reason))
    }
    
    // ProcAttr holds the attributes that will be applied to a new process
    // started by StartProcess.
    type ProcAttr struct {
    	// If Dir is non-empty, the child changes into the directory before
    	// creating the process.
    	Dir string
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  7. src/os/exec/exec.go

    	childFiles = append(childFiles, stderr)
    	childFiles = append(childFiles, c.ExtraFiles...)
    
    	env, err := c.environ()
    	if err != nil {
    		return err
    	}
    
    	c.Process, err = os.StartProcess(lp, c.argv(), &os.ProcAttr{
    		Dir:   c.Dir,
    		Files: childFiles,
    		Env:   env,
    		Sys:   c.SysProcAttr,
    	})
    	if err != nil {
    		return err
    	}
    	started = true
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 20:13:53 UTC 2024
    - 41.4K bytes
    - Viewed (0)
Back to top