From patchwork Mon Jun 21 09:32:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 12334233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A88CC48BE5 for ; Mon, 21 Jun 2021 09:36:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31C76611B0 for ; Mon, 21 Jun 2021 09:36:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31C76611B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvGLn-0000B8-8m for qemu-devel@archiver.kernel.org; Mon, 21 Jun 2021 05:36:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvGIg-0005V2-Th for qemu-devel@nongnu.org; Mon, 21 Jun 2021 05:33:03 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:60744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvGIf-0007Ia-6z for qemu-devel@nongnu.org; Mon, 21 Jun 2021 05:33:02 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id D454121962; Mon, 21 Jun 2021 09:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624267979; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=eqRE7qmcA+ACgFVUsG730VxH4AJiybneGdnbtljZOVs=; b=CUWTApyQJmggTBFwln+jgbgvOiGjxwfCkiuOADIrGmLNlQA7m3m+n4BwwCWyk4jb1GF9Cj KKu0Qye0t+VLT+tVGQExHl/N0MGdrNSv+87lRCZg0qhijMQVeHrNCY5yxc9bJ4aPKSHZCf llkQ/HN/l36R88JFGa+e6s1w9CfxNd8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624267979; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=eqRE7qmcA+ACgFVUsG730VxH4AJiybneGdnbtljZOVs=; b=L0GhVgc/C4LJxK6yF7WfvBHJHPSUKLY25GaQi3qbtzqKiWhqPrB6vAzyPD2kjxrLTGAAw5 jvFW+LVi7FXCa9Bg== Received: from hawking.suse.de (hawking.suse.de [10.160.4.0]) by relay2.suse.de (Postfix) with ESMTP id CDCF3A3BAC; Mon, 21 Jun 2021 09:32:59 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id C20D344618D; Mon, 21 Jun 2021 11:32:59 +0200 (CEST) From: Andreas Schwab To: Laurent Vivier Subject: [PATCH] linux-user: fill ppid field in /proc/self/stat X-Yow: I'm having BEAUTIFUL THOUGHTS about the INSIPID WIVES of smug and wealthy CORPORATE LAWYERS.. Date: Mon, 21 Jun 2021 11:32:59 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Received-SPF: pass client-ip=195.135.220.28; envelope-from=schwab@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Andreas Schwab Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 974dd46c9a..dababe463c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7940,6 +7940,9 @@ static int open_self_stat(void *cpu_env, int fd) gchar *bin = g_strrstr(ts->bprm->argv[0], "/"); bin = bin ? bin + 1 : ts->bprm->argv[0]; g_string_printf(buf, "(%.15s) ", bin); + } else if (i == 3) { + /* ppid */ + g_string_printf(buf, FMT_pid " ", getppid()); } else if (i == 27) { /* stack bottom */ g_string_printf(buf, TARGET_ABI_FMT_ld " ", ts->info->start_stack);