aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/testdata')
-rw-r--r--src/runtime/testdata/testprog/signal_pid1.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprog/signal_pid1.go b/src/runtime/testdata/testprog/signal_pid1.go
new file mode 100644
index 0000000000..7446056e2d
--- /dev/null
+++ b/src/runtime/testdata/testprog/signal_pid1.go
@@ -0,0 +1,26 @@
+// Copyright 2026 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+ "fmt"
+ "os"
+ "time"
+)
+
+func init() {
+ register("SignalPid1", SignalPid1)
+}
+
+// SignalPid1 is a helper for TestSignalPid1.
+func SignalPid1() {
+ if os.Getpid() != 1 {
+ fmt.Fprintln(os.Stderr, "I am not PID 1")
+ return
+ }
+ fmt.Println("ready")
+
+ time.Sleep(time.Hour)
+}