Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 74 for kill (0.03 sec)

  1. src/os/exec_plan9.go

    // on all systems are Interrupt (send the process an interrupt) and
    // Kill (force the process to exit). Interrupt is not implemented on
    // Windows; using it with [os.Process.Signal] will return an error.
    var (
    	Interrupt Signal = syscall.Note("interrupt")
    	Kill      Signal = syscall.Note("kill")
    )
    
    func startProcess(name string, argv []string, attr *ProcAttr) (p *Process, err error) {
    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/pidfd_linux_test.go

    	}
    
    	// Check that all Process' public methods work as expected with
    	// "done" Process.
    	if err := proc.Kill(); err != os.ErrProcessDone {
    		t.Errorf("Kill: got %v, want %v", err, os.ErrProcessDone)
    	}
    	if err := proc.Signal(os.Kill); err != os.ErrProcessDone {
    		t.Errorf("Signal: got %v, want %v", err, os.ErrProcessDone)
    	}
    	if _, err := proc.Wait(); !errors.Is(err, syscall.ECHILD) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  3. src/os/exec_posix.go

    // systems are os.Interrupt (send the process an interrupt) and os.Kill (force
    // the process to exit). On Windows, sending os.Interrupt to a process with
    // os.Process.Signal is not implemented; it will return an error instead of
    // sending a signal.
    var (
    	Interrupt Signal = syscall.SIGINT
    	Kill      Signal = syscall.SIGKILL
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  4. src/os/exec_unix_test.go

    	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)
    	}
    }
    
    // Lookup of a process that does not exist at time of lookup.
    func TestProcessAlreadyDone(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 2K bytes
    - Viewed (0)
  5. src/os/exec.go

    	//
    	// On Windows, calling Release a second time returns EINVAL.
    	return p.release()
    }
    
    // Kill causes the [Process] to exit immediately. Kill does not wait until
    // the Process has actually exited. This only kills the Process itself,
    // not any other processes it may have started.
    func (p *Process) Kill() error {
    	return p.kill()
    }
    
    // Wait waits for the [Process] to exit, and then returns a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  6. pkg/kubelet/kuberuntime/kuberuntime_manager_test.go

    	// GetPodStatus and the following SyncPod will not return errors in the
    	// case where the pod has been deleted. We are not adding any pods into
    	// the fakePodProvider so they are 'deleted'.
    	podStatus, err := m.GetPodStatus(ctx, pod.UID, pod.Name, pod.Namespace)
    	assert.NoError(t, err)
    	result := m.SyncPod(context.Background(), pod, podStatus, []v1.Secret{}, backOff)
    	// This will return an error if the pod has _not_ been deleted.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 14 16:09:17 UTC 2024
    - 96K bytes
    - Viewed (0)
  7. src/os/exec/exec_test.go

    	go func() {
    		defer wg.Done()
    		// We don't check the error return of Kill. It is
    		// possible that the process has already exited, in
    		// which case Kill will return an error "process
    		// already finished". The purpose of this test is to
    		// see whether the race detector reports an error; it
    		// doesn't matter whether this Kill succeeds or not.
    		cmd.Process.Kill()
    	}()
    
    	go func() {
    		defer wg.Done()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 20:13:53 UTC 2024
    - 48.4K bytes
    - Viewed (0)
  8. src/os/exec/exec.go

    		// c.Process.Wait returned and we've handed the timer off to c.Wait.
    		// It will take care of goroutine shutdown from here.
    		return
    	case <-timer.C:
    	}
    
    	killed := false
    	if killErr := c.Process.Kill(); killErr == nil {
    		// We appear to have killed the process. c.Process.Wait should return a
    		// non-nil error to c.Wait unless the Kill signal races with a successful
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 20:13:53 UTC 2024
    - 41.4K bytes
    - Viewed (0)
  9. src/os/exec_unix.go

    	case statusReleased:
    		return nil, syscall.EINVAL
    	}
    
    	// If we can block until Wait4 will succeed immediately, do so.
    	ready, err := p.blockUntilWaitable()
    	if err != nil {
    		return nil, err
    	}
    	if ready {
    		// Mark the process done now, before the call to Wait4,
    		// so that Process.pidSignal will not send a signal.
    		p.pidDeactivate(statusDone)
    		// Acquire a write lock on sigMu to wait for any
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  10. src/os/exec_windows.go

    	handle, status := p.handleTransientAcquire()
    	switch status {
    	case statusDone:
    		return ErrProcessDone
    	case statusReleased:
    		return syscall.EINVAL
    	}
    	defer p.handleTransientRelease()
    
    	if sig == Kill {
    		var terminationHandle syscall.Handle
    		e := syscall.DuplicateHandle(^syscall.Handle(0), syscall.Handle(handle), ^syscall.Handle(0), &terminationHandle, syscall.PROCESS_TERMINATE, false, 0)
    		if e != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 5K bytes
    - Viewed (0)
Back to top