about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-08-14 03:21:23 +0000
committerUlrich Drepper <drepper@redhat.com>2007-08-14 03:21:23 +0000
commit22502ea2a70d56057159b72d75f152ce2ccc1aec (patch)
tree91790983b742aef49e7650bf66b4da1f5701ba8c /sysdeps/unix/sysv/linux
parent4baf59ada82537c87bae0a761ce43d334135f2e7 (diff)
downloadglibc-22502ea2a70d56057159b72d75f152ce2ccc1aec.tar.gz
glibc-22502ea2a70d56057159b72d75f152ce2ccc1aec.tar.xz
glibc-22502ea2a70d56057159b72d75f152ce2ccc1aec.zip
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PSELECT, cvs/fedora-glibc-20070814T0725 cvs/fedora-glibc-20070814T0643
	__ASSUME_PPOLL, __ASSUME_ATFCTS, __ASSUME_SET_ROBUST_LIST,
	__ASSUME_UTIMENSAT, __ASSUME_FALLOCATE): Update per-arch conditions
	when each feature was introduced.

	* sysdeps/unix/sysv/linux/dl-vdso.c: Don't include dl-hash.h.
	* sysdeps/unix/sysv/linux/dl-vdso.h: Don't include dl-hash.h if NDEBUG.
	(CHECK_HASH): New macro.
	(PREPARE_VERSION): Use it.

	* sysdeps/unix/sysv/linux/pselect.c (__generic_pselect): Only provide
	prototype if not __ASSUME_PSELECT.
	* sysdeps/unix/sysv/linux/ppoll.c (__generic_ppoll): Only provide
	prototype if not __ASSUME_PPOLL.

	* sysdeps/unix/sysv/linux/dl-osinfo.h (ROUND): #undef after use.

	* sysdeps/unix/clock_settime.c (freq, __pthread_clock_settime,
	hp_timing_settime): Don't define or declare if HANDLED_CPUTIME
	is defined.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/dl-osinfo.h1
-rw-r--r--sysdeps/unix/sysv/linux/dl-vdso.c1
-rw-r--r--sysdeps/unix/sysv/linux/dl-vdso.h9
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h50
-rw-r--r--sysdeps/unix/sysv/linux/ppoll.c4
-rw-r--r--sysdeps/unix/sysv/linux/pselect.c4
6 files changed, 46 insertions, 23 deletions
diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
index 203c828b21..e3c605e4c7 100644
--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -71,6 +71,7 @@ _dl_discover_osversion (void)
 #define ROUND(len) (((len) + sizeof note->n_type - 1) & -sizeof note->n_type)
 		note = ((const void *) (note + 1)
 			+ ROUND (note->n_namesz) + ROUND (note->n_descsz));
+#undef ROUND
 	      }
 	  }
     }
diff --git a/sysdeps/unix/sysv/linux/dl-vdso.c b/sysdeps/unix/sysv/linux/dl-vdso.c
index f12b4c37fd..28d4bb1d42 100644
--- a/sysdeps/unix/sysv/linux/dl-vdso.c
+++ b/sysdeps/unix/sysv/linux/dl-vdso.c
@@ -18,7 +18,6 @@
    02111-1307 USA.  */
 
 #include "config.h"
-#include <dl-hash.h>
 #include <ldsodefs.h>
 
 
diff --git a/sysdeps/unix/sysv/linux/dl-vdso.h b/sysdeps/unix/sysv/linux/dl-vdso.h
index 0a76dbe6f3..7e433e03ab 100644
--- a/sysdeps/unix/sysv/linux/dl-vdso.h
+++ b/sysdeps/unix/sysv/linux/dl-vdso.h
@@ -21,9 +21,14 @@
 #define _DL_VDSO_H	1
 
 #include <assert.h>
-#include <dl-hash.h>
 #include <ldsodefs.h>
 
+#ifdef NDEBUG
+# define CHECK_HASH(var) do {} while (0)
+#else
+# include <dl-hash.h>
+# define CHECK_HASH(var) assert (var.hash == _dl_elf_hash (var.name))
+#endif
 
 /* Create version number record for lookup.  */
 #define PREPARE_VERSION(var, vname, vhash) \
@@ -31,7 +36,7 @@
   var.name = vname;							      \
   var.hidden = 1;							      \
   var.hash = vhash;							      \
-  assert (var.hash == _dl_elf_hash (vname));				      \
+  CHECK_HASH (var);							      \
   /* We don't have a specific file where the symbol can be found.  */	      \
   var.filename = NULL
 
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index f8116d8885..aab3df348e 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -428,29 +428,37 @@
 # define __ASSUME_TMPFS_NAME	1
 #endif
 
-/* pselect was introduced just after 2.6.16-rc1.  Due to the way the
-   kernel versions are advertised we can only rely on 2.6.17 to have
-   the code.  */
-#if __LINUX_KERNEL_VERSION >= 0x020611 && !defined __x86_64__
+/* pselect/ppoll were introduced just after 2.6.16-rc1.  Due to the way
+   the kernel versions are advertised we can only rely on 2.6.17 to have
+   the code.  On x86_64 and SH this appeared first in 2.6.19-rc1,
+   on ia64 in 2.6.22-rc1 and on alpha just after 2.6.22-rc1.  */
+#if __LINUX_KERNEL_VERSION >= 0x020611 \
+    && ((!defined __x86_64__ && !defined __sh__ && !defined __ia64__ \
+	 && !defined __alpha__) \
+	|| (__LINUX_KERNEL_VERSION >= 0x020613 \
+	    && (defined __x86_64__ || defined __sh__)) \
+	|| (__LINUX_KERNEL_VERSION >= 0x020616 && defined __ia64__) \
+	|| (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
 # define __ASSUME_PSELECT	1
-#endif
-
-/* ppoll was introduced just after 2.6.16-rc1.  Due to the way the
-   kernel versions are advertised we can only rely on 2.6.17 to have
-   the code.  */
-#if __LINUX_KERNEL_VERSION >= 0x020611 && !defined __x86_64__
-# define __ASSUME_PPOLL	1
+# define __ASSUME_PPOLL		1
 #endif
 
 /* The *at syscalls were introduced just after 2.6.16-rc1.  Due to the way the
    kernel versions are advertised we can only rely on 2.6.17 to have
-   the code.  */
-#if __LINUX_KERNEL_VERSION >= 0x020611
+   the code.  On PPC they were introduced in 2.6.17-rc1, on SH in 2.6.19-rc1
+   and on Alpha just after 2.6.22-rc1.  */
+#if __LINUX_KERNEL_VERSION >= 0x020611 \
+    && ((!defined __sh__ && !defined __alpha__) \
+	|| (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
+	|| (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
 # define __ASSUME_ATFCTS	1
 #endif
 
 /* Support for inter-process robust mutexes was added in 2.6.17.  */
-#if __LINUX_KERNEL_VERSION >= 0x020611
+#if __LINUX_KERNEL_VERSION >= 0x020611 \
+    && ((!defined __sh__ && !defined __alpha__) \
+	|| (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
+	|| (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
 # define __ASSUME_SET_ROBUST_LIST	1
 #endif
 
@@ -459,8 +467,11 @@
 # define __ASSUME_FUTEX_LOCK_PI	1
 #endif
 
-/* Support for utimensat syscall was added in 2.6.22.  */
-#if __LINUX_KERNEL_VERSION >= 0x020616
+/* Support for utimensat syscall was added in 2.6.22, on alpha and s390
+   only after 2.6.22-rc1.  */
+#if __LINUX_KERNEL_VERSION >= 0x020616 \
+    && ((!defined __sh__ && !defined __alpha__) \
+	|| __LINUX_KERNEL_VERSION >= 0x020617)
 # define __ASSUME_UTIMENSAT	1
 #endif
 
@@ -469,7 +480,10 @@
 # define __ASSUME_PRIVATE_FUTEX	1
 #endif
 
-/* Support for fallocate was added in 2.6.23.  */
-#if __LINUX_KERNEL_VERSION >= 0x020617
+/* Support for fallocate was added in 2.6.23, on s390
+   only after 2.6.23-rc1.  */
+#if __LINUX_KERNEL_VERSION >= 0x020617 \
+    && ((!defined __s390__ && !defined __alpha__) \
+	|| (__LINUX_KERNEL_VERSION >= 0x020618 && defined __s390__))
 # define __ASSUME_FALLOCATE	1
 #endif
diff --git a/sysdeps/unix/sysv/linux/ppoll.c b/sysdeps/unix/sysv/linux/ppoll.c
index cfc86ba806..14eb3111b9 100644
--- a/sysdeps/unix/sysv/linux/ppoll.c
+++ b/sysdeps/unix/sysv/linux/ppoll.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
 
@@ -26,9 +26,11 @@
 
 
 #ifdef __NR_ppoll
+# ifndef __ASSUME_PPOLL
 static int __generic_ppoll (struct pollfd *fds, nfds_t nfds,
 			    const struct timespec *timeout,
 			    const sigset_t *sigmask);
+# endif
 
 
 int
diff --git a/sysdeps/unix/sysv/linux/pselect.c b/sysdeps/unix/sysv/linux/pselect.c
index 0dd744f527..f39ee920cd 100644
--- a/sysdeps/unix/sysv/linux/pselect.c
+++ b/sysdeps/unix/sysv/linux/pselect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
 
@@ -26,10 +26,12 @@
 
 
 #ifdef __NR_pselect6
+# ifndef __ASSUME_PSELECT
 static int __generic_pselect (int nfds, fd_set *readfds, fd_set *writefds,
 			      fd_set *exceptfds,
 			      const struct timespec *timeout,
 			      const sigset_t *sigmask);
+# endif
 
 
 int