On 6/9/23 14:13, Sergey Bugaev wrote:
Perhaps... but there's another reason I don't particularly like the
idea of doing it on that level.

Yes, your points make sense. No big deal either way,


Do you perhaps mean that POSIX does not require a
newly opened terminal to become your ctty even if you don't pass
O_NOCTTY?

Yes, that's right. The openat rationale mentions this topic.


So if you do pass O_IGNORE_CTTY and the file is not your ctty, you
just get a speedup. If you do pass O_IGNORE_CTTY and the file is your
ctty, you get an fd that refers to your ctty... but doesn't behave
like a ctty fd. Why you would want the latter, I have no idea (but
also it of course wasn't me who came up with O_IGNORE_CTTY, so perhaps
there is a use case).

I don't see why anybody would care if the O_IGNORE_CTTY behavior became the default. And if nobody cares, let's just make it the default. That way, you won't have to change glibc, Gnulib, git, coreutils, etc.

Do you have a scenario whereby making O_IGNORE_CTTY the default would break things? (It wouldn't break things as far as POSIX is concerned.)


Reply via email to