From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20916 invoked from network); 16 May 2021 15:24:36 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 May 2021 15:24:36 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1621178676; b=IsW40qdtfxvQ+wRnnnHh+0NIcSTW/CUjy9IF7CO5l/0vhSUwEq+K+hYp+chIQboZP1KxmXO2oj jV7BkgT8QxgMV0m81yDp6MoU2qH1HuS4earuPgYJbrrte11sgL02djXbrsj45ZUCBeZkAlE7Lm EJ/j0lAyXkaAV0Q1V9sZ9Zn1L/i3CRvBJZzmVf/0isjj4srze2iPuqgz9p2STHA9ehdRerWzJa V3kkdrCNoNGyEkfH7ztC8gi8Kx4czWPqDfLfqPTeUJV5zrv+X1hPDpJ7YV96LzjpCMfxCNoM6w P7CuB+7Bw9SNeK0m4XtUcG8zGkBZVB/ioR3hUDzHFHiAmQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1621178676; bh=miMX7nf88NjptCy0E9VesN5LdfF8gk6JiRiSm9I9ECs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Subject:To:From:Date:DKIM-Signature; b=NCognV8T8QC8jfi3kpHgpkF/+8H5vnKxuZgIzlizn0CLuTYEkhIpxdfbDl1ES9NtVvxuAQzHjn sBvx1uzUsBUT6V9HNk/haz1Q+hNfQis6rfhyARJxI5z6KXZ5xi+NmVZv4RJNqStPbC5f7W2bk5 lQw2saj1Geg2KRIAT6u3Hf9ABrz2e0ZzPCdu59qEzyBq6MLNmjvh1eIZVtxNMVJHzxCurWo7pI +sg3M1c35+IgHshKJ0dY32Y5fZVuHyt6Pm8z4sEVmav4Xi6YwgirSEYycGesVBGzqGOPp5sPgn Dke98YCknt1sUYkm2BWZ0uIcMgPDFerM9zDFsClot2xMfA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=wvShO6Vx75bbweSaSLplBC9iSH4EDRFqd+VBIbdKzM8=; b=rxFjmB3sYKyzGT3HhD1Cy1SOuJ jJC933Ky0fViDTABQCtVEn4rF8tQTE44ezmAsmrAW6l9BJz/ALQ/R2XPSJHkGRVa+caGJp0ODTTHT rX5Czr/csbvLh6cy51lj+qHvSLYWduYfEWOE4Jwna9A6JJ3XChd2zmRIVt5ocJOuThTg5MNQbcqxG QjhrTmzXTmieCrxkIANS2f/Xl+l6DZ5ufykAMQ7V1bAU1LNuZDFm2Esf1zk3Mb/aRho1mf91yCp7H YCQ2XLcoSLsA8sskYSji5E6EJOT1dd8cVVM8bL0jZ4RBTN0TOH5JSOGQf31FnGv0NizkGOLOyBgSO UyV8xI+A==; Received: from authenticated user by zero.zsh.org with local id 1liId9-000M2D-OS; Sun, 16 May 2021 15:24:35 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:34860) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1liIct-000Lko-O0; Sun, 16 May 2021 15:24:20 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 6C0A010B; Sun, 16 May 2021 17:24:18 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 33DF9C21877; Sun, 16 May 2021 17:24:18 +0200 (CEST) Date: Sun, 16 May 2021 17:24:18 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: $PPID not updated when the PPID changes (parent killed) Message-ID: <20210516152418.GA39669@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.0.7+174 (4c786d87) vl-137001 (2021-05-15) X-Seq: 48838 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Consider the following script: #!/usr/bin/env zsh echo $ZSH_VERSION f() { grep PPid /proc/$$/status; echo $PPID } f kill -9 $PPID sleep 1 f Under Linux, I get: zira% sh -c ./tst.zsh; sleep 2 5.8 PPid: 39867 39867 zsh: killed sh -c ./tst.zsh PPid: 1 39867 zira% i.e. $PPID is not updated when the PPID changes, i.e. the parent process is killed. The zshparam(1) man page says: PPID The process ID of the parent of the shell. As for $$, the value indicates the parent of the original shell and does not change in subshells. This implies that it should be updated when the process ID of the parent of the shell changes. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)