This is almost equivalent to __WORDSIZE == 64
&& OTHER_SHLIB_COMPAT (librt, GLIBC_2_1, GLIBC_2_3_3), except
that this expression is true for mips64/n64 targets as well,
even though those did not undergo the timer_t transition.
For the architecture-specific override to work, it is necessary
to switch from "..." includes to <...> includes.
---
.../sysv/linux/alpha/kernel-posix-timers.h | 22 +++++++++++++++++++
.../sysv/linux/ia64/kernel-posix-timers.h | 22 +++++++++++++++++++
sysdeps/unix/sysv/linux/kernel-posix-timers.h | 4 ++++
.../powerpc/powerpc64/kernel-posix-timers.h | 22 +++++++++++++++++++
.../linux/s390/s390-64/kernel-posix-timers.h | 22 +++++++++++++++++++
.../linux/sparc/sparc64/kernel-posix-timers.h | 22 +++++++++++++++++++
sysdeps/unix/sysv/linux/timer_create.c | 2 +-
sysdeps/unix/sysv/linux/timer_delete.c | 2 +-
sysdeps/unix/sysv/linux/timer_getoverr.c | 2 +-
sysdeps/unix/sysv/linux/timer_gettime.c | 2 +-
sysdeps/unix/sysv/linux/timer_routines.c | 2 +-
sysdeps/unix/sysv/linux/timer_settime.c | 2 +-
.../linux/x86_64/64/kernel-posix-timers.h | 22 +++++++++++++++++++
.../unix/sysv/linux/x86_64/timer_gettime.c | 2 +-
.../unix/sysv/linux/x86_64/timer_settime.c | 2 +-
15 files changed, 144 insertions(+), 8 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/alpha/kernel-posix-timers.h
create mode 100644 sysdeps/unix/sysv/linux/ia64/kernel-posix-timers.h
create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel-posix-timers.h
create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/kernel-posix-timers.h
create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/kernel-posix-timers.h
create mode 100644 sysdeps/unix/sysv/linux/x86_64/64/kernel-posix-timers.h
On 17/06/2021 15:59, Florian Weimer via Libc-alpha wrote:
> diff --git a/sysdeps/unix/sysv/linux/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/kernel-posix-timers.h
> index 17fc32d48f..874b809eba 100644
> --- a/sysdeps/unix/sysv/linux/kernel-posix-timers.h
> +++ b/sysdeps/unix/sysv/linux/kernel-posix-timers.h
> @@ -103,3 +103,7 @@ timerid_to_kernel_timer (timer_t timerid)
> else
> return (kernel_timer_t) ((uintptr_t) timerid);
> }
> +
> +/* New targets use int instead of timer_t. The difference only
> + matters on 64-bit targets. */
> +#define TIMER_T_WAS_INT_COMPAT 0
I think it would be better to move this to its own file, so there is no need to
include, undef, define on each arch-specific files.
new file mode 100644
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. alpha version.
+ Copyright (C) 2021 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <https://www.gnu.org/licenses/>. */
+
+#include <sysdeps/unix/sysv/linux/kernel-posix-timers.h>
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
new file mode 100644
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. ia64 version.
+ Copyright (C) 2021 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <https://www.gnu.org/licenses/>. */
+
+#include <sysdeps/unix/sysv/linux/kernel-posix-timers.h>
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
@@ -103,3 +103,7 @@ timerid_to_kernel_timer (timer_t timerid)
else
return (kernel_timer_t) ((uintptr_t) timerid);
}
+
+/* New targets use int instead of timer_t. The difference only
+ matters on 64-bit targets. */
+#define TIMER_T_WAS_INT_COMPAT 0
new file mode 100644
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. powerpc64 version.
+ Copyright (C) 2021 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <https://www.gnu.org/licenses/>. */
+
+#include <sysdeps/unix/sysv/linux/kernel-posix-timers.h>
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
new file mode 100644
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. s390x version.
+ Copyright (C) 2021 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <https://www.gnu.org/licenses/>. */
+
+#include <sysdeps/unix/sysv/linux/kernel-posix-timers.h>
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
new file mode 100644
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. sparc64 version.
+ Copyright (C) 2021 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <https://www.gnu.org/licenses/>. */
+
+#include <sysdeps/unix/sysv/linux/kernel-posix-timers.h>
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
@@ -25,7 +25,7 @@
#include <sysdep.h>
#include <internaltypes.h>
#include <pthreadP.h>
-#include "kernel-posix-timers.h"
+#include <kernel-posix-timers.h>
#include "kernel-posix-cpu-timers.h"
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <time.h>
#include <sysdep.h>
-#include "kernel-posix-timers.h"
+#include <kernel-posix-timers.h>
#ifdef timer_delete_alias
@@ -19,7 +19,7 @@
#include <errno.h>
#include <time.h>
#include <sysdep.h>
-#include "kernel-posix-timers.h"
+#include <kernel-posix-timers.h>
#ifdef timer_getoverrun_alias
@@ -21,7 +21,7 @@
#include <time.h>
#include <sysdep.h>
#include <kernel-features.h>
-#include "kernel-posix-timers.h"
+#include <kernel-posix-timers.h>
int
__timer_gettime64 (timer_t timerid, struct __itimerspec64 *value)
@@ -22,7 +22,7 @@
#include <stdbool.h>
#include <sysdep-cancel.h>
#include <pthreadP.h>
-#include "kernel-posix-timers.h"
+#include <kernel-posix-timers.h>
/* List of active SIGEV_THREAD timers. */
@@ -21,7 +21,7 @@
#include <time.h>
#include <sysdep.h>
#include <kernel-features.h>
-#include "kernel-posix-timers.h"
+#include <kernel-posix-timers.h>
int
__timer_settime64 (timer_t timerid, int flags,
new file mode 100644
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. x86_64 version.
+ Copyright (C) 2021 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <https://www.gnu.org/licenses/>. */
+
+#include <sysdeps/unix/sysv/linux/kernel-posix-timers.h>
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
@@ -18,7 +18,7 @@
#include <shlib-compat.h>
#include <sysdep.h>
-#include "kernel-posix-timers.h"
+#include <kernel-posix-timers.h>
#include "compat-timer.h"
int
@@ -18,7 +18,7 @@
#include <shlib-compat.h>
#include <sysdep.h>
-#include "kernel-posix-timers.h"
+#include <kernel-posix-timers.h>
#include "compat-timer.h"
int