Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for Pid (0.13 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/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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. platforms/core-runtime/launcher/src/main/java/org/gradle/launcher/daemon/server/DaemonServices.java

            );
        }
    
        @Provides
        protected DaemonLogFile createDaemonLogFile(DaemonContext daemonContext, DaemonDir daemonDir) {
            final Long pid = daemonContext.getPid();
            String fileName = "daemon-" + (pid == null ? UUID.randomUUID() : pid) + ".out.log";
            return new DaemonLogFile(new File(daemonDir.getVersionedDir(), fileName));
        }
    
        @Provides
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Jun 11 09:51:15 UTC 2024
    - 9.7K bytes
    - Viewed (0)
  10. src/os/exec_test.go

    	}
    	if runtime.GOARCH == "wasm" {
    		t.Skip("Signals send + notify not fully supported om wasm port")
    	}
    
    	c := make(chan os.Signal, 1)
    	signal.Notify(c, os.Interrupt)
    	defer signal.Stop(c)
    
    	p := &os.Process{Pid: os.Getpid()}
    	if err := p.Signal(os.Interrupt); err != nil {
    		t.Fatalf("Signal got err %v, want nil", err)
    	}
    
    	// Verify we actually received the signal.
    	select {
    	case <-time.After(1 * time.Second):
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 1.8K bytes
    - Viewed (0)
Back to top