From patchwork Wed Mar 8 13:28:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13165752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 225B9C678D5 for ; Wed, 8 Mar 2023 13:30:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZtqz-0001iL-Ch; Wed, 08 Mar 2023 08:29:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZtqv-0001g2-LH for qemu-devel@nongnu.org; Wed, 08 Mar 2023 08:29:09 -0500 Received: from mout.kundenserver.de ([212.227.17.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZtqt-00064l-Gn for qemu-devel@nongnu.org; Wed, 08 Mar 2023 08:29:09 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N0nSN-1qWPjB2UUf-00wpJB; Wed, 08 Mar 2023 14:29:04 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Andreas Schwab , Laurent Vivier Subject: [PULL 06/28] linux-user: fill out task state in /proc/self/stat Date: Wed, 8 Mar 2023 14:28:35 +0100 Message-Id: <20230308132857.161793-7-laurent@vivier.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230308132857.161793-1-laurent@vivier.eu> References: <20230308132857.161793-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:wJcpOZDzv37yo1RPCyGKNPMIC1slVZhyjjeBqOACCWQgPoZxvzY qpML9Ow6cCcnIOP6xUabBkYREPmpVH/Vyr6zOJ88XREWDBJCaluR/ofImHHltbgtl63s8f6 Tja+ezSIaQYhSd++cCivkzFgpS9u+vYj2G6t+JPpD12u2aAqGre4pumDLo3LEtj/Pheqsoo mDbui/8jz+4FhAV/QgkQA== UI-OutboundReport: notjunk:1;M01:P0:/L1A22qWeaI=;5iuf+2nq8eLR6ojXGlENZIgnUYg VBTvovrNCoKtg540/QRBGgSD1Yr++D7d/QnaHvbBLu3cHn+BNah0HVN8E5HjFWLoXddAWa1Rs dzEyQtN2lnkm3u3l11YxojSOCQcLYbbFPYY3kUhyYRKazsHCKFY/hABm+0OJvz9WYqq7OdjtY jwGGAYObED9fNnT6AGpCty4hj2qDVIH5/T6Sq9mUuQ588Zn1PFddkNpPv16aVI7ZYJMLjrHgn j+yGoNl+QbXL/zSIGzp5dmcahmTpMXJtWgT2FLtFHYQAHgdVbmkxXzqht4U8zfU+I9ryb+Duk HaWzqkt2uYClrdCgdFUMfaQ2xLGiMdupcxTNp9cK2WwOeXsMnIXxFiGoqaz3g5sp71ngchoNl Rx4ySkn0sFC3Iv99eMW8s5dTVeeeEiGxPjcpp0hX2qiv4SFcZAdL+nx0vm37I2eBV5z4qUhKQ M+pzqYNLWooU0x7LwcXIwbtnoJiTYoUhyP9WLen6/hkhsItGtBFXdjoBP56XH/3FK83dqwXxa qGk6kNjRsYV1nYuYBz6RqSMfSKeVZeqF0hMFt8L/SXNr2eWb1Y9hwpdLBK3J9x9bsCzYs1qhk wq9CDfs6cHeX417xXQ1xyXDthhtOiExDLUUxAR284Z7xlpYp0MDLcMVxL/YSSGJ/uUL1E/qkV PNkD5EFDVaa+gD07MmXU1XGNPO+YUmpL53HRPYEPtg== Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Andreas Schwab Some programs want to match an actual task state character. Signed-off-by: Andreas Schwab Reviewed-by: Laurent Vivier Message-Id: Signed-off-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 db27c85abb8d..8ecad83f7f10 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8079,6 +8079,9 @@ static int open_self_stat(CPUArchState *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 == 2) { + /* task state */ + g_string_assign(buf, "R "); /* we are running right now */ } else if (i == 3) { /* ppid */ g_string_printf(buf, FMT_pid " ", getppid());