summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/loader.go
diff options
context:
space:
mode:
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r--runsc/boot/loader.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index 2733c4d69..ae2226e12 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -31,6 +31,7 @@ import (
"gvisor.googlesource.com/gvisor/pkg/abi/linux"
"gvisor.googlesource.com/gvisor/pkg/cpuid"
"gvisor.googlesource.com/gvisor/pkg/log"
+ "gvisor.googlesource.com/gvisor/pkg/sentry/arch"
"gvisor.googlesource.com/gvisor/pkg/sentry/inet"
"gvisor.googlesource.com/gvisor/pkg/sentry/kernel"
"gvisor.googlesource.com/gvisor/pkg/sentry/kernel/auth"
@@ -576,3 +577,19 @@ func newEmptyNetworkStack(conf *Config, clock tcpip.Clock) (inet.Stack, error) {
panic(fmt.Sprintf("invalid network configuration: %v", conf.Network))
}
}
+
+func (l *Loader) signal(cid string, signo int32) error {
+ l.mu.Lock()
+ tgid, ok := l.containerRootTGIDs[cid]
+ l.mu.Unlock()
+ if !ok {
+ return fmt.Errorf("failed to signal container %q: no such container", cid)
+ }
+
+ // The thread group ID of a process is the leading task's thread ID.
+ t := l.k.TaskSet().Root.TaskWithID(tgid)
+ if t == nil {
+ return fmt.Errorf("cannot signal: no task with ID %d", tgid)
+ }
+ return t.SendSignal(&arch.SignalInfo{Signo: signo})
+}