- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for findProcess (0.3 sec)
-
src/os/pidfd_linux_test.go
} 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. if proc == nil { t.Fatal("FindProcess: got nil, want non-nil") } if proc.Status() != os.StatusDone {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 11 18:08:44 UTC 2024 - 1.6K bytes - Viewed (0) -
src/os/exec_unix_test.go
// EINVAL (see waitid in usr/src/uts/common/os/exit.c in // illumos). This is configurable via sysconf(_SC_MAXPID), but // we'll just take the default. pid = 30000-1 } p, err := FindProcess(pid) if err != nil { t.Fatalf("FindProcess(math.MaxInt32) got err %v, want nil", err) } if ps, err := p.Wait(); !errors.Is(err, syscall.ECHILD) { t.Errorf("Wait() got err %v (ps %+v), want %v", err, ps, syscall.ECHILD) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 11 18:08:44 UTC 2024 - 2K bytes - Viewed (0) -
src/os/signal/example_unix_test.go
// it should abandon its work after a signal is received. func ExampleNotifyContext() { ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) defer stop() p, err := os.FindProcess(os.Getpid()) if err != nil { log.Fatal(err) } // On a Unix-like system, pressing Ctrl+C on a keyboard sends a // SIGINT signal to the process of the program in execution. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Nov 09 15:34:56 UTC 2023 - 1.1K bytes - Viewed (0) -
src/os/exec.go
// Getppid returns the process id of the caller's parent. func Getppid() int { return syscall.Getppid() } // FindProcess looks for a running process by its pid. // // The [Process] it returns can be used to obtain information // about the underlying operating system process. // // On Unix systems, FindProcess always succeeds and returns a Process // for the given pid, regardless of whether the process exists. To test whether
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 10 22:06:47 UTC 2024 - 12.8K bytes - Viewed (0) -
src/os/exec_test.go
"os" "os/signal" "runtime" "syscall" "testing" "time" ) func TestProcessLiteral(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("Process literals do not work on Windows. FindProcess/etc must initialize the process handle") } 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)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 11 18:08:44 UTC 2024 - 1.8K bytes - Viewed (0) -
src/os/exec_plan9.go
p.Pid = -1 // Just mark the PID unusable. p.pidDeactivate(statusReleased) // no need for a finalizer anymore runtime.SetFinalizer(p, nil) return nil } func findProcess(pid int) (p *Process, err error) { // NOOP for Plan 9. return newPIDProcess(pid), nil } // ProcessState stores information about a process, as reported by Wait. type ProcessState struct {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 10 22:06:47 UTC 2024 - 3.4K bytes - Viewed (0) -
src/os/exec_unix.go
case modePID: // Just mark the PID unusable. p.pidDeactivate(statusReleased) } // no need for a finalizer anymore runtime.SetFinalizer(p, nil) return nil } func findProcess(pid int) (p *Process, err error) { h, err := pidfdFind(pid) if err == ErrProcessDone { // We can't return an error here since users are not expecting // it. Instead, return a process with a "done" state already
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 10 22:06:47 UTC 2024 - 4.1K bytes - Viewed (0) -
src/os/exec_windows.go
} // no need for a finalizer anymore runtime.SetFinalizer(p, nil) return nil } func (p *Process) closeHandle() { 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 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 10 22:06:47 UTC 2024 - 5K bytes - Viewed (0) -
doc/next/9-todo.md
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 11 17:18:52 UTC 2024 - 6K bytes - Viewed (0) -
src/os/signal/signal_cgo_test.go
if err != nil { t.Fatalf("error reading child pid: %v\n", err) } if n != 8 { t.Fatalf("unexpected short read n = %d\n", n) } pid := binary.LittleEndian.Uint64(b[:]) process, err := os.FindProcess(int(pid)) if err != nil { t.Fatalf("unable to find child process: %v", err) } // Wait for the third child to write a byte indicating that it is // entering the read. b = make([]byte, 1)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 20 10:09:15 UTC 2024 - 10.7K bytes - Viewed (0)