bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate


From: Paul Eggert
Subject: Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate
Date: Tue, 13 Jun 2023 22:40:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

On 6/13/23 03:54, Sergey Bugaev wrote:

"Do not recognize the named file as the controlling terminal, even if
it refers to the process’s existing controlling terminal device.
Operations on the new file descriptor will never induce job control
signals."

This is an opportunity to improve the docs!7

The first-quoted sentence is confusing and arguably wrong. If the named file is the process's existing controlling terminal, it will continue to be recognized as the controlling terminal.

What's different is that I/O to the new fd won't induce SIGTTIN etc. So the second sentence is correct and the first is wrong. Perhaps the first sentence could be replaced by:

"Cause operations on the new file descriptor to act as if the named file is not the process's controlling terminal, even if it is."

you
can't get an estimate for whether any software cares by grepping it
for O_IGNORE_CTTY.

Fair enough. Still, I still doubt many would care if O_IGNORE_CTTY became the default, particularly since O_NOCTTY is 0. What's the scenario whereby a Bash user would care, for example?


Speaking of Emacs, and seeing that Emacs already defines O_IGNORE_CTTY
to 0 on non-Hurd, and that you're one of the Emacs maintainers (is
that right?): could perhaps Emacs benefit from using O_IGNORE_CTTY
more broadly too? I imagine loading all the .el files in ~/.emacs.d
involves way too many pointless ctty checks, for example.

It might, I suppose. Got a patch?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]