[PATCH v4 2/3] 32-bit ABIs: support stat syscall family
Joseph Myers
joseph@codesourcery.com
Tue Aug 9 21:04:00 GMT 2016
On Tue, 9 Aug 2016, Arnd Bergmann wrote:
> We cannot define 'struct timespec' to be incompatible with the version
> used by the kernel, that would break all other interfaces passing a
> timespec.
>
> While in theory the kernel could change the definition of its "compat"
> data types for 32-bit tasks on 64-bit kernels (as it does for x86/x32),
> we are not doing that for aarch64, in order to stay compatible with
> device drivers that already have working compat mode on 32-bit ARM.
So in that case, if the kernel's struct stat uses 64-bit timespec, it's
inevitably different from the userspace timespec. Which leaves me
wondering what the advantages of a userspace layout that's almost but not
quite the same as the kernel's layout (and so needs timespec fields
rearranged on structs received from the kernel) are over not doing
anything special about the timespec fields in the userspace struct
definition (that is, no special padding / alignment) and instead using the
existing machinery for converting struct stat to convert from the kernel
structure to the userspace structure.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list