[PATCH v7 5/5] linux: Add mount_setattr
Florian Weimer
fweimer@redhat.com
Mon Jul 11 12:53:54 GMT 2022
* Adhemerval Zanella:
>> On 11 Jul 2022, at 05:55, Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * Adhemerval Zanella via Libc-alpha:
>>
>>> I am not sure how to handle it, glibc sys/mount.h should be a standalone
>>> header.
>>
>> Is it really necessary to keep <sys/mount.h> standalone? It's not even
>> a standard interface, and we don't have conform tests for this header as
>> far as I can see.
>>
>> So I think the usual __has_include approach should work here, too.
>
> The main problem is sys/mount.h defines interfaces for syscall added
> in multiple releases. It means that depending of the kernel version
> used by the compiler we will need to add some defines (for instance
> fsconfig_command). There is also a small difference where glibc
> header define the MS_* constant as a unnamed enum (not sure if this
> affects C++ mangling).
You are right, I had missed that.
> I know that using kernel headers simplify some support, specially sync
> with newer releases; but this also adds more complexity where we need
> to handle integration outside glibc project.
For openat2, we got a separate header. Maybe we can request that for
the fsmount interfaces, too? Than we can do the usual thing just for
<linux/fsmount.h>. <linux/mount.h> can still include <linux/fsmount.h>,
so the change would be transparent.
Thanks,
Florian
More information about the Libc-alpha
mailing list