From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66]) by sourceware.org (Postfix) with ESMTPS id 528A93858D20 for ; Sun, 11 Jun 2023 04:54:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 528A93858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 12DBE3C09FA06; Sat, 10 Jun 2023 21:54:51 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id isHiGMvNYhHB; Sat, 10 Jun 2023 21:54:50 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 048FE3C10C5E2; Sat, 10 Jun 2023 21:54:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 048FE3C10C5E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1686459290; bh=QfmyvH4m5hTq/Cehj0elqATrnO1uFGQa7oz6bjAhHQ4=; h=Message-ID:Date:MIME-Version:To:From; b=VkjWyXWQbHMNPJxg3QliK0Hh+jXTZ7HSkxwqIiRjspCIGrqfQA9YBP+Jrmhiff4HK mbD+CSs4ArLlGgA64Hoxs1TrrTltbzxsWs4rbJFRumNUsQcXNOUkw8fi/2p+/UuMmR c+sKHaT1Ea6m/CUbbPdgPR9HCt/TlJwkSCTC/97cjY11mqxyARO9+pg2pAla50UWwQ jKWlrl+8u+NCB0Jwt7QBlqU4sP17Uonngvox6EYOLvWIh8/e+LgCOUKv/VN44k1TCN DHHcyh5ofskHdszhDxL4PtyQyGjx1kia1toW9dVlFr9mvw+cy9gQjV27qK6cvasOPz Qu0nD9r00HGaQ== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yx9xFxJMFSa2; Sat, 10 Jun 2023 21:54:49 -0700 (PDT) Received: from [192.168.0.90] (c-71-232-5-12.hsd1.vt.comcast.net [71.232.5.12]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 6FF5C3C09FA06; Sat, 10 Jun 2023 21:54:49 -0700 (PDT) Message-ID: <3033f0f6-58a3-0e38-b1fd-7edd6a730310@cs.ucla.edu> Date: Sun, 11 Jun 2023 00:54:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate Content-Language: en-US To: Sergey Bugaev Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org, Samuel Thibault References: <20230604204258.2026816-1-bugaevc@gmail.com> <20230604204258.2026816-3-bugaevc@gmail.com> <9c2a4fb7-5b9e-94ac-dedf-b3fb29529650@cs.ucla.edu> From: Paul Eggert In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 6/10/23 12:13, Sergey Bugaev wrote: > O_IGNORE_CTTY is not about > acquiring a ctty if you don't yet have one (that never happens > implicitly on the Hurd), but about (re)opening your current ctty. OK, I'm starting to see the distinction now. > I don't know whether any programs actually care about this ctty > feature. Presumably users care? -- as I understand it, this is > intended to be used with job control in the shell If so, it's a well-kept secret, as Bash doesn't use O_IGNORE_CTTY. The only program I know of that uses O_IGNORE_CTTY is Emacs, and it's for what appears to be relatively minor optimization when it is opening a file that is a tty. On non-Hurd platforms Emacs instead uses setsid to remove the controlling tty entirely (since the notion of controlling terminal doesn't mix well with how Emacs operates).