On Friday 17 July 2015 14:37:41 Mark Brown wrote:
On Fri, Jul 17, 2015 at 03:26:38PM +0200, Arnd Bergmann wrote:
I think we will have to provide a macro from user space that tells the UAPI headers what the size of time_t is. This means that here we'd end up with something like
#if BITS_PER_TIME_T == BITS_PER_LONG #define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int) #else #define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x15, int) #endif
this way we'll be able to let user space implicitly do the correct setting that matches its timespec format.
Yeah, that was where my thinking was going. You should then be able to make the else case expose a 32 bit version under a different name so applications that really wanted to be able to do fallback on old kernels could do so but the default would DTRT.
I'm unsure if that would actually help anybody: The new version would only be seen for applications that are built with a 64-bit time_t, and that requires a new kernel for a number of reasons. It might help bridge the window between kernels that have support for basic syscalls but not a particular ioctl like this one, but approach so far was that I'd just treat that case as a bug and tell people to not expect 64-bit time_t in user space to work in all cases until we have a kernel that has all drivers converted.
Arnd