]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: Avoid using timespec for struct snd_timer_status
authorBaolin Wang <baolin.wang@linaro.org>
Tue, 24 Apr 2018 12:06:09 +0000 (20:06 +0800)
committerArnd Bergmann <arnd@arndb.de>
Wed, 11 Dec 2019 21:06:15 +0000 (22:06 +0100)
commitf78c34d23c305b09dc1dd6b498f58387e0f4de51
tree3bbe041cf1244f03fbf2db52876de60486814060
parent1937fe4cfa96460b3400f9eecf4d372d1e3dea61
ALSA: Avoid using timespec for struct snd_timer_status

struct snd_timer_status uses 'timespec' type variables to record
timestamp, which will be changed to an incompatible layout with
updated user space using 64-bit time_t.

To handle both the old and the new layout on 32-bit architectures,
this patch introduces 'struct snd_timer_status32' and 'struct snd_timer_status64'
to handle 32bit time_t and 64bit time_t in native mode and compat mode,
which replaces timespec with s64 type.

When glibc changes time_t to 64-bit, any recompiled program will issue
ioctl commands that the kernel does not understand without this patch.

In the public uapi header, snd_timer_status is now guarded by
an #ifndef __KERNEL__ to avoid referencing 'struct timespec'.
The timespec definition will be removed from the kernel to prevent
new y2038 bugs and to avoid the conflict with an incompatible libc
type of the same name.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
include/uapi/sound/asound.h
sound/core/timer.c
sound/core/timer_compat.c