From 31c2236e97db6a57ca9b6ab3771876cd2231fd85 Mon Sep 17 00:00:00 2001 From: "chris.zn" Date: Thu, 28 Mar 2019 18:04:32 -0700 Subject: set task's name when fork When fork a child process, the name filed of TaskContext is not set. It results in that when we cat /proc/{pid}/status, the name filed is null. Like this: Name: State: S (sleeping) Tgid: 28 Pid: 28 PPid: 26 TracerPid: 0 FDSize: 8 VmSize: 89712 kB VmRSS: 6648 kB Threads: 1 CapInh: 00000000a93d35fb CapPrm: 0000000000000000 CapEff: 0000000000000000 CapBnd: 00000000a93d35fb Seccomp: 0 Change-Id: I5d469098c37cedd19da16b7ffab2e546a28a321e PiperOrigin-RevId: 240893304 --- pkg/sentry/kernel/task_context.go | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg/sentry') diff --git a/pkg/sentry/kernel/task_context.go b/pkg/sentry/kernel/task_context.go index d1c82f2aa..1b4d4cf2f 100644 --- a/pkg/sentry/kernel/task_context.go +++ b/pkg/sentry/kernel/task_context.go @@ -74,6 +74,7 @@ func (tc *TaskContext) release() { // of the original's. func (tc *TaskContext) Fork(ctx context.Context, k *Kernel, shareAddressSpace bool) (*TaskContext, error) { newTC := &TaskContext{ + Name: tc.Name, Arch: tc.Arch.Fork(), st: tc.st, } -- cgit v1.2.3