Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for ProcAttr (0.17 sec)

  1. src/syscall/exec_unix.go

    	NoSetGroups bool     // If true, don't set supplementary groups
    }
    
    // ProcAttr holds attributes that will be applied to a new process started
    // by [StartProcess].
    type ProcAttr struct {
    	Dir   string    // Current working directory.
    	Env   []string  // Environment.
    	Files []uintptr // File descriptors.
    	Sys   *SysProcAttr
    }
    
    var zeroProcAttr ProcAttr
    var zeroSysProcAttr SysProcAttr
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. src/syscall/exec_plan9.go

    	name   *byte
    	value  *byte
    	nvalue int
    }
    
    type ProcAttr struct {
    	Dir   string    // Current working directory.
    	Env   []string  // Environment.
    	Files []uintptr // File descriptors.
    	Sys   *SysProcAttr
    }
    
    type SysProcAttr struct {
    	Rfork int // additional flags to pass to rfork
    }
    
    var zeroProcAttr ProcAttr
    var zeroSysProcAttr SysProcAttr
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  5. src/syscall/syscall_ptrace_test.go

    	"testing"
    )
    
    func TestExecPtrace(t *testing.T) {
    	testenv.MustHaveExec(t)
    
    	bin, err := exec.LookPath("sh")
    	if err != nil {
    		t.Skipf("skipped because sh is not available")
    	}
    
    	attr := &os.ProcAttr{
    		Sys: &syscall.SysProcAttr{
    			Ptrace: true,
    		},
    	}
    	proc, err := os.StartProcess(bin, []string{bin}, attr)
    	if err == nil {
    		proc.Kill()
    	}
    	if err != nil && !os.IsPermission(err) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 768 bytes
    - Viewed (0)
  6. src/runtime/fds_test.go

    	for _, e := range os.Environ() {
    		if strings.HasPrefix(e, "GODEBUG=") || strings.HasPrefix(e, "GOTRACEBACK=") {
    			continue
    		}
    		env = append(env, e)
    	}
    
    	proc, err := os.StartProcess(fdsBin, []string{fdsBin}, &os.ProcAttr{
    		Env:   env,
    		Files: []*os.File{},
    	})
    	if err != nil {
    		t.Fatal(err)
    	}
    	ps, err := proc.Wait()
    	if err != nil {
    		t.Fatal(err)
    	}
    	if ps.ExitCode() != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 25 16:33:33 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. src/syscall/exec_windows.go

    }
    
    var zeroProcAttr ProcAttr
    var zeroSysProcAttr SysProcAttr
    
    func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error) {
    	if len(argv0) == 0 {
    		return 0, 0, EWINDOWS
    	}
    	if attr == nil {
    		attr = &zeroProcAttr
    	}
    	sys := attr.Sys
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 28 18:29:48 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  10. src/syscall/syscall_js.go

    func (w WaitStatus) StopSignal() Signal { return 0 }
    func (w WaitStatus) TrapCause() int     { return 0 }
    
    // XXX made up
    type Rusage struct {
    	Utime Timeval
    	Stime Timeval
    }
    
    // XXX made up
    type ProcAttr struct {
    	Dir   string
    	Env   []string
    	Files []uintptr
    	Sys   *SysProcAttr
    }
    
    type SysProcAttr struct {
    }
    
    func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 6.7K bytes
    - Viewed (0)
Back to top