On Friday 17 July 2015 14:59:48 Arnd Bergmann wrote:
Also, __kernel_timespec is defined to be always 64-bit wide. This means if we do this change (assuming we drop the #define above), then user space will always see the new definition of this structure, and programs compiled against the latest header will no longer work on older kernels.
Is this what you had in mind?
We could decide to do it like this, and we have historically done changes to the ioctl interface this way, but I'm not sure if we want to do it for all ioctls.
The alternative is to leave the 'timespec' visible here for user space, so user programs will see either the old or the new definition of struct depending on their timespec definition, and only programs built with 64-bit time_t will require new kernels.
For clarification: The approach of changing the existing data structure definition will work in this particular case, but a lot of other ioctl commands just pass a plain time_t / timespec / timeval.
For those commands, we absolutely have to make sure that kernel and user space agree on the command code for old and new argument format, and that will involve an #ifdef like the example I gave. Aside from ioctl, we need the same thing for a couple of other interfaces like setsockopts.
Arnd