[PATCH v4] linux: Add openat2 (BZ 31664)

Florian Weimer fweimer@redhat.com
Wed Aug 27 05:26:25 GMT 2025


* Paul Eggert:

> On 8/26/25 07:44, Florian Weimer wrote:
>> * Paul Eggert:
>>> Can you give a sample call that would break?
>> Starting with GCC 14, the last two lines are reported as containing
>> errors:
>> void f(char *);
>> void fc(const char *);
>> void (*pf)(const char *) = f;
>> void (*pfc)(char *) = fc;
>
> Sure, but that's not a sample call as I requested. It's a contrived
> example that is not likely to occur in real code. (And if there is
> true concern about this instead of language-lawyering, I'm sure there
> are workarounds.)

The open function is sometimes used with function pointers.  We know
because developers use incorrect non-variadic prototypes, which do not
work on POWER.

>> If we don't pass through the system call interface unchanged, past
>> experience tells us that this causes problems in the future.
>
> For this particular case there will be problems no matter what we
> do. That's clear from the Linux man pages, which give two disagreeing
> APIs for openat2. In cases like these, it's often better to do the
> right thing even if it's a bit more work, than to do the wrong thing.

We can figure out what the intended way for future evolution is,
document that with comments in the kernel sources, and update the manual
pages.  Collaboration is possible.

Thanks,
Florian



More information about the Libc-alpha mailing list