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 12978 invoked from network); 16 May 2021 18:37:43 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 May 2021 18:37:43 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1621190263; b=cFlbL59IEVr/AAmHaNKYQlZ1egewXwBCv4ShNYfB8FjQ8VHRCPi6teyrOMSe4A0UYQh/XhBlPO UqCIIU77icND+22zTZV2grPqGIDwWIGArmd2ETUlrH7VpTMK1iMyGz3JlENtRZATK2rxgK7+gE RgncXJhn0BGf0ANUMHrxyC2uFV52ujYKREySxtbZJeO+JmgNH+7ligFp7AONsfmM01pjMGjVnR ym07ragyGCpVBGxLwlxF8ayh06Qpn+ScY3Y9EGeLQzlOMD7lRDIidFuVEU/FczGKt7/g2m3COo Duq1m0WGp8e362sHnRk9ZxZLiljMi7+PdmJlNL/JYoq+wg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f47.google.com) smtp.remote-ip=209.85.210.47; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1621190263; bh=CmYX10HWUspg241xl+aPsMmlPiV03w6NoTwCoZx7who=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=noEYYCsPskfDI6ODBYiLeCubMegTOt6vn6mqOMryw4arWDufwcRSvRlFqrZuVD252t8IyRStpg nliuGiNT/dOoT+/BSbO2l0kauszdQa2lN9tO3ufy1/k7LwGsbnyOsVcEHXP6Xd9z6+pkzixRY+ +vVLdW7ael2BvRZrrPae6luryw8Fb2n96qYsFKJ0qt/AgKbWsB6y4AoSbYRz8lT9J2H7TKIodU PjpyG3SDTqUgiXM+pJgoUKCT995Ho2jZUtM8XF6aj2WIA/pwclXHFddQRFUJJ+uRbq3bNqOGyi AMawbgN+729SIMufaoG9YthiKUNhnB5Pvdz0J/CUNGfFXA==; 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-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=JQiaSibalM2+Uja6jHlTo6twxsljt3YRl6uO9iuCies=; b=gKDXNCDSwE6pQ42njN366TGEmr zNyyVeKr4y0SCs2cEt/gFHdTpJkU6AI4tYFFUIxnxId6yJpT4tiyOYdPcSkZgylG4wBeUK2VkECxv XUigJ2h0nD2zejuIPzHrSx+uvC/DLqNjcgSjYl1e247ResF4wmkKTnD6KgUzdn/isagSK8C0keYnU X8W62IhYFMrqSP45cJgYq9KVi04GRYG04rLIdCtKykgGT+hiAzz1C5J+BjzfonTyYSOngXWr2GO5a 0ounuWQrp5Euya1AlcTH/hT2JsN4DjKM9wBGslD4sOWUCQQD1wV2OE9UWDQnkjs4SLUpDjmNDs38T HLzJu9iw==; Received: from authenticated user by zero.zsh.org with local id 1liLe2-000867-S2; Sun, 16 May 2021 18:37:42 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f47.google.com) smtp.remote-ip=209.85.210.47; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f47.google.com ([209.85.210.47]:36717) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1liLdn-0007ke-EW; Sun, 16 May 2021 18:37:27 +0000 Received: by mail-ot1-f47.google.com with SMTP id n32-20020a9d1ea30000b02902a53d6ad4bdso3760716otn.3 for ; Sun, 16 May 2021 11:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=JQiaSibalM2+Uja6jHlTo6twxsljt3YRl6uO9iuCies=; b=Y/CSFJ+v6PHCwjSqyvU9ayPb6C/fJf8pObdGPzMnhF7Z6ZA/BxkPKCpoi+0G1VYQGq 7C4I10baFbttE0Ny21OluUZkKQnCmjZEXsFrpG3XnoLnFecNcY6O/fCmmq4BO/tZibV1 JuDWPRMXeKtpSYL3/jE3tu6lN1mZTulWDJX+xKR7pPFEMBGkqaE8x2nGws6+0rvzSl/C hcS5nbCZR4OG6WZ5GSyZ3yJ3oZjAfrNGopRXicFGBM8LVOzxOIj9jnzn3/eWSodQRRrb U1AYXuYVzrXwIsZlFJyPVLhu4f0bZ8zWZJu3KBvbnP2JL0KtHlkwza1wAtT74Vl1o68c uqmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=JQiaSibalM2+Uja6jHlTo6twxsljt3YRl6uO9iuCies=; b=arFluBqQeZvZJulGRUmtR3/TGxGrupRTCVIeISGCo4OMmXY8Ms/d02DvD/Ub8CUvH4 dTSUvItKiOl+mBsBQoJVdul4VzlA+yWKz+C0iasy1j9htgBaPET8drAVoDArR2UPJNcy 2OpvNTiH46RAfhsVtVUPXc/7sv626o8ttjLuOtbPRZuArMLQOq1YAUgSkvK7PkkFVWqb +w0sPpBxnGisdcSB7g6/Gya3/vjtHLCdXK+uop+PeeFhREK17OlJKuSGY3qVBoi/xr/G 7+MrGPHVdXbarDdLbKsYaIwJe+zHkKMco24XKYacId1gbJCzvmM50hnPhAdcm4T9wt0C 1CQg== X-Gm-Message-State: AOAM533oSQNtyKWUFgFoR7xXac3ZInyEmgs+VVjZScUOxztRZdvqXbAH KT840bFA8X4CTGyVLvYp4Sz+cvPq75z6c7j8CBViAPmRXz4= X-Google-Smtp-Source: ABdhPJzin2epklqYm/fM2DTMbzxLdfV5oiZdJtwLTMbfep8p2Gkmu3Q7o2FkKN4lbrpLMR5vy1YtM5Ew8bGjM1yaB9A= X-Received: by 2002:a9d:f66:: with SMTP id 93mr47209966ott.229.1621190246406; Sun, 16 May 2021 11:37:26 -0700 (PDT) MIME-Version: 1.0 References: <20210516152418.GA39669@zira.vinc17.org> In-Reply-To: <20210516152418.GA39669@zira.vinc17.org> From: Bart Schaefer Date: Sun, 16 May 2021 11:37:15 -0700 Message-ID: Subject: Re: $PPID not updated when the PPID changes (parent killed) To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48852 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: On Sun, May 16, 2021 at 8:24 AM Vincent Lefevre wrote: > > i.e. $PPID is not updated when the PPID changes, i.e. the parent > process is killed. $PPID means the ID of the process that spawned this one, not the current value of getppid(). If you want the latter, it's $sysparams[ppid] (with the zsh/system module loaded). In fact the correct way to determine whether the original parent has exited is to check (( PPID != sysparams[ppid] )). We could enable a non-portable way to be alerted on parent exit using prctl() now that HAVE_PRCTL is being checked by configure, but it would be expensive to emulate in other cases.