Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for Pid (0.02 sec)

  1. src/os/exec_unix.go

    	}
    
    	return convertESRCH(syscall.Kill(p.Pid, s))
    }
    
    func convertESRCH(err error) error {
    	if err == syscall.ESRCH {
    		return ErrProcessDone
    	}
    	return err
    }
    
    func (p *Process) release() error {
    	// We clear the Pid field only for API compatibility. On Unix, Release
    	// has always set Pid to -1. Internally, the implementation relies
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  2. src/os/exec_plan9.go

    		return nil, ErrInvalid
    	}
    
    	err = syscall.WaitProcess(p.Pid, &waitmsg)
    	if err != nil {
    		return nil, NewSyscallError("wait", err)
    	}
    
    	p.pidDeactivate(statusDone)
    	ps = &ProcessState{
    		pid:    waitmsg.Pid,
    		status: &waitmsg,
    	}
    	return ps, nil
    }
    
    func (p *Process) release() error {
    	p.Pid = -1
    
    	// Just mark the PID unusable.
    	p.pidDeactivate(statusReleased)
    
    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/sync/pool.go

    	l := p.local                              // load-consume
    	if uintptr(pid) < s {
    		return indexLocal(l, pid), pid
    	}
    	return p.pinSlow()
    }
    
    func (p *Pool) pinSlow() (*poolLocal, int) {
    	// Retry under the mutex.
    	// Can not lock the mutex while pinned.
    	runtime_procUnpin()
    	allPoolsMu.Lock()
    	defer allPoolsMu.Unlock()
    	pid := runtime_procPin()
    	// poolCleanup won't be called while we are pinned.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  4. src/os/exec.go

    	// It is unused on other GOOSes.
    	handle uintptr
    }
    
    func newPIDProcess(pid int) *Process {
    	p := &Process{
    		Pid:  pid,
    		mode: modePID,
    	}
    	runtime.SetFinalizer(p, (*Process).Release)
    	return p
    }
    
    func newHandleProcess(pid int, handle uintptr) *Process {
    	p := &Process{
    		Pid:    pid,
    		mode:   modeHandle,
    		handle: handle,
    	}
    	p.state.Store(1) // 1 persistent reference
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  5. src/os/pidfd_linux.go

    	if !pidfdWorks() {
    		return 0, false
    	}
    
    	return uintptr(*sysAttr.PidFD), true
    }
    
    func pidfdFind(pid int) (uintptr, error) {
    	if !pidfdWorks() {
    		return 0, syscall.ENOSYS
    	}
    
    	h, err := unix.PidFDOpen(pid, 0)
    	if err != nil {
    		return 0, convertESRCH(err)
    	}
    	return h, nil
    }
    
    // _P_PIDFD is used as idtype argument to waitid syscall.
    const _P_PIDFD = 3
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  6. pkg/kubelet/pleg/generic.go

    func computeEvents(oldPod, newPod *kubecontainer.Pod, cid *kubecontainer.ContainerID) []*PodLifecycleEvent {
    	var pid types.UID
    	if oldPod != nil {
    		pid = oldPod.ID
    	} else if newPod != nil {
    		pid = newPod.ID
    	}
    	oldState := getContainerState(oldPod, cid)
    	newState := getContainerState(newPod, cid)
    	return generateEvents(pid, cid.ID, oldState, newState)
    }
    
    func (g *GenericPLEG) cacheEnabled() bool {
    	return g.cache != nil
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  7. src/os/exec_unix_test.go

    	}
    }
    
    // Lookup of a process that does not exist at time of lookup.
    func TestProcessAlreadyDone(t *testing.T) {
    	// Theoretically MaxInt32 is a valid PID, but the chance of it actually
    	// being used is extremely unlikely.
    	pid := math.MaxInt32
    	if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" {
    		// Solaris/Illumos have a lower limit, above which wait returns
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 2K bytes
    - Viewed (0)
  8. src/os/exec_posix.go

    		var ok bool
    		h, ok = getPidfd(sysattr.Sys)
    		if !ok {
    			return newPIDProcess(pid), nil
    		}
    	}
    
    	return newHandleProcess(pid, h), nil
    }
    
    func (p *Process) kill() error {
    	return p.Signal(Kill)
    }
    
    // ProcessState stores information about a process, as reported by Wait.
    type ProcessState struct {
    	pid    int                // The process's id.
    	status syscall.WaitStatus // System-dependent status info.
    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/os/exec_windows.go

    	syscall.CloseHandle(syscall.Handle(p.handle))
    }
    
    func findProcess(pid int) (p *Process, err error) {
    	const da = syscall.STANDARD_RIGHTS_READ |
    		syscall.PROCESS_QUERY_INFORMATION | syscall.SYNCHRONIZE
    	h, e := syscall.OpenProcess(da, false, uint32(pid))
    	if e != nil {
    		return nil, NewSyscallError("OpenProcess", e)
    	}
    	return newHandleProcess(pid, uintptr(h)), nil
    }
    
    func init() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 5K bytes
    - Viewed (0)
  10. src/os/pidfd_linux_test.go

    	}
    
    	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.
    	if err != nil {
    		t.Fatalf("FindProcess: got error %v, want <nil>", err)
    	}
    	// FindProcess should never return nil Process.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 1.6K bytes
    - Viewed (0)
Back to top