[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <06279d25-73d6-01f5-dcf8-8667415048d2@netscape.net>
Date: Tue, 18 Nov 2025 08:33:07 -0800
From: Ned Ulbricht <nedu@...scape.net>
To: "H. Peter Anvin" <hpa@...or.com>, "Maciej W. Rozycki" <macro@...am.me.uk>
Cc: Greg KH <gregkh@...uxfoundation.org>, Theodore Ts'o <tytso@....edu>,
Maarten Brock <Maarten.Brock@...ls.nl>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: RFC: Serial port DTR/RTS - O_<something>
On 11/15/25 16:47, H. Peter Anvin wrote:
> On 2025-11-15 13:29, Ned Ulbricht wrote:
>> |
>> | O_TTY_INIT
>>
>> https://pubs.opengroup.org/onlinepubs/9799919799/
>>
>> That's what motivates my first-glance preference to name this new flag,
>> which will have approximately opposite behavior, as O_TTY_NOINIT.
>>
>> But as a generic abstraction, I more prefer O_KEEP.
>>
>
> O_KEEP seems a little vague, but O_KEEPCONFIG seems like a decent name.
>
> It seems like we don't have several new flags:
>
> O_EXEC
> O_SEARCH
> O_CLOFORK
> O_TTY_INIT
> O_RSYNC
> O_NOCLOBBER
>
> Some of them *may* be possible to construct with existing Linux options, I'm
> not 100% sure; in particular O_SEARCH might be the same as (O_DIRECTORY|O_PATH).
>
> O_NOCLOBBER looks like an odd in-between between O_EXCL and
> (O_EXCL|O_NOFOLLOW); stated to be specifically to implement the shell
> "noclobber" semantic.
"(O_EXCL|O_NOFOLLOW)" provokes a thought...
As essential context, fs/open.c build_open_flags() has:
if (flags & O_CREAT) {
op->intent |= LOOKUP_CREATE;
if (flags & O_EXCL) {
op->intent |= LOOKUP_EXCL;
flags |= O_NOFOLLOW;
}
}
if (!(flags & O_NOFOLLOW))
lookup_flags |= LOOKUP_FOLLOW;
So with that context, just imagine hypothetically implementing both a
non-zero O_TTY_INIT flag and an O_KEEPCONFIG flag. What would
build_open_flags() look like to handle the case where userspace
simultaneously asserts both flags? Even if it's documented, specified
as unspecified behavior, what would the code actually do?
Or, alternatively, should an hypothetical standardization insist that in
any implementation, one of O_TTY_INIT, O_KEEPCONFIG must be #define'd 0?
Ned
Powered by blists - more mailing lists