public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 30/35] Linux: Define TIMER_T_WAS_INT_COMPAT in kernel-posix-timers.h
Date: Fri, 04 Jun 2021 01:17:24 +0200	[thread overview]
Message-ID: <2222ff7caf5218113fbbdc35bc3feeafea14ad83.1622761829.git.fweimer@redhat.com> (raw)
In-Reply-To: <cover.1622761828.git.fweimer@redhat.com>

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

diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/alpha/kernel-posix-timers.h
new file mode 100644
index 0000000000..e84dfb97e5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/kernel-posix-timers.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/ia64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/ia64/kernel-posix-timers.h
new file mode 100644
index 0000000000..fb00698cf7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/kernel-posix-timers.h
@@ -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
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
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel-posix-timers.h
new file mode 100644
index 0000000000..718750db92
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel-posix-timers.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/s390/s390-64/kernel-posix-timers.h
new file mode 100644
index 0000000000..c8870c2dc1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/kernel-posix-timers.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel-posix-timers.h
new file mode 100644
index 0000000000..b8485379ca
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel-posix-timers.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/timer_create.c b/sysdeps/unix/sysv/linux/timer_create.c
index b21b0ca949..3dcd5455fc 100644
--- a/sysdeps/unix/sysv/linux/timer_create.c
+++ b/sysdeps/unix/sysv/linux/timer_create.c
@@ -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"
 
 
diff --git a/sysdeps/unix/sysv/linux/timer_delete.c b/sysdeps/unix/sysv/linux/timer_delete.c
index a7a183591e..ee8c364d95 100644
--- a/sysdeps/unix/sysv/linux/timer_delete.c
+++ b/sysdeps/unix/sysv/linux/timer_delete.c
@@ -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
diff --git a/sysdeps/unix/sysv/linux/timer_getoverr.c b/sysdeps/unix/sysv/linux/timer_getoverr.c
index 9c7ba3acad..b997290768 100644
--- a/sysdeps/unix/sysv/linux/timer_getoverr.c
+++ b/sysdeps/unix/sysv/linux/timer_getoverr.c
@@ -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
diff --git a/sysdeps/unix/sysv/linux/timer_gettime.c b/sysdeps/unix/sysv/linux/timer_gettime.c
index 193fe3b140..0b31324da7 100644
--- a/sysdeps/unix/sysv/linux/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/timer_gettime.c
@@ -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)
diff --git a/sysdeps/unix/sysv/linux/timer_routines.c b/sysdeps/unix/sysv/linux/timer_routines.c
index 8d8c1a1e76..fc3aa894ab 100644
--- a/sysdeps/unix/sysv/linux/timer_routines.c
+++ b/sysdeps/unix/sysv/linux/timer_routines.c
@@ -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.  */
diff --git a/sysdeps/unix/sysv/linux/timer_settime.c b/sysdeps/unix/sysv/linux/timer_settime.c
index f8bb16a4c2..b8326e36a4 100644
--- a/sysdeps/unix/sysv/linux/timer_settime.c
+++ b/sysdeps/unix/sysv/linux/timer_settime.c
@@ -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,
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/x86_64/64/kernel-posix-timers.h
new file mode 100644
index 0000000000..db0beb5920
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/64/kernel-posix-timers.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c b/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
index 3f3ae12d6b..107b1f97c7 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
@@ -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
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_settime.c b/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
index 14a05965a3..f987cd16d3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
@@ -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
-- 
2.31.1



  parent reply	other threads:[~2021-06-03 23:17 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 23:14 [PATCH 00/35] Linux: Move librt into libc Florian Weimer
2021-06-03 23:14 ` [PATCH 01/35] rt: Lexicographically sort Versions file; librt-routines in Makefile Florian Weimer
2021-06-17 11:05   ` Adhemerval Zanella
2021-06-03 23:14 ` [PATCH 02/35] Fix librt-routines-var issues for !PTHREAD_IN_LIBC Florian Weimer
2021-06-17 11:07   ` Adhemerval Zanella
2021-06-17 12:19     ` Florian Weimer
2021-06-03 23:15 ` [PATCH 03/35] rt: Replace generic stub of shm_open with the posix version Florian Weimer
2021-06-17 11:08   ` Adhemerval Zanella
2021-06-03 23:15 ` [PATCH 04/35] rt: Replace generic stub of shm_unlink " Florian Weimer
2021-06-17 11:08   ` Adhemerval Zanella
2021-06-03 23:15 ` [PATCH 05/35] rt: Move shm_open into libc Florian Weimer
2021-06-17 11:12   ` Adhemerval Zanella
2021-06-17 12:25   ` Adhemerval Zanella
2021-06-03 23:15 ` [PATCH 06/35] rt: Move shm_unlink " Florian Weimer
2021-06-17 18:00   ` Adhemerval Zanella
2021-06-03 23:15 ` [PATCH 07/35] rt: Move generic implementation from sysdeps/pthread to rt Florian Weimer
2021-06-03 23:15 ` [PATCH 08/35] nptl: Move pthreadP.h into sysdeps directory Florian Weimer
2021-06-03 23:15 ` [PATCH 09/35] nptl: Add internal macro definition of pthread_self Florian Weimer
2021-06-03 23:15 ` [PATCH 10/35] Add hidden prototypes for fsync, fdatasync Florian Weimer
2021-06-03 23:15 ` [PATCH 11/35] Linux: Move aio_init from librt into libc Florian Weimer
2021-06-03 23:15 ` [PATCH 12/35] Linux: Move aio_cancel, aio_cancel64 " Florian Weimer
2021-06-03 23:15 ` [PATCH 13/35] Linux: Move aio_error, aio_error64 " Florian Weimer
2021-06-03 23:15 ` [PATCH 14/35] Linux: Move aio_fsync, aio_fsync64 " Florian Weimer
2021-06-03 23:16 ` [PATCH 15/35] Linux: Move aio_read, aio_read64 " Florian Weimer
2021-06-03 23:16 ` [PATCH 16/35] Linux: Move aio_return, aio_return64 " Florian Weimer
2021-06-03 23:16 ` [PATCH 17/35] Linux: Move aio_suspend, aio_suspend64 from librt to libc Florian Weimer
2021-06-03 23:16 ` [PATCH 18/35] Linux: Move aio_write, aio_write64 into libc Florian Weimer
2021-06-03 23:16 ` [PATCH 19/35] rt: Rework lio_listio implementation Florian Weimer
2021-06-03 23:16 ` [PATCH 20/35] Linux: Move lio_listio, lio_listio64 from librt to libc Florian Weimer
2021-06-03 23:16 ` [PATCH 21/35] Linux: Move mq_close " Florian Weimer
2021-06-03 23:16 ` [PATCH 22/35] Linux: Move mq_setattr " Florian Weimer
2021-06-03 23:16 ` [PATCH 23/35] Linux: Move mq_getattr " Florian Weimer
2021-06-03 23:16 ` [PATCH 24/35] Linux: Move mq_notify " Florian Weimer
2021-06-03 23:16 ` [PATCH 25/35] Linux: Move mq_open, __mq_open_2 " Florian Weimer
2021-06-03 23:17 ` [PATCH 26/35] Linux: Move mq_receive, mq_timedreceive " Florian Weimer
2021-06-03 23:17 ` [PATCH 27/35] Linux: Move mq_send, mq_timedsend " Florian Weimer
2021-06-03 23:17 ` [PATCH 28/35] Linux: Move mq_unlink " Florian Weimer
2021-06-03 23:17 ` [PATCH 29/35] Linux: Move timer helper routines " Florian Weimer
2021-06-03 23:17 ` Florian Weimer [this message]
2021-06-03 23:17 ` [PATCH 31/35] Linux: Move timer_create, timer_delete " Florian Weimer
2021-06-03 23:17 ` [PATCH 32/35] Linux: Move timer_getoverrun " Florian Weimer
2021-06-03 23:17 ` [PATCH 33/35] Linux: Move timer_gettime " Florian Weimer
2021-06-03 23:17 ` [PATCH 34/35] Linux: Move timer_settime " Florian Weimer
2021-06-03 23:17 ` [PATCH 35/35] Linux: Cleanups after librt move Florian Weimer
2021-06-15 20:18 ` [PATCH 00/35] Linux: Move librt into libc Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2222ff7caf5218113fbbdc35bc3feeafea14ad83.1622761829.git.fweimer@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).