This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] s390{,x} kernel-features.h fixes


Hi!

waitid was added in 2.6.12 not only on ppc*, but also on s390*.

32-bit getdents with d_type is even more complicated.
Although it has been added in sys_getdents in 2.6.4-rc1, most of the
compat wrappers weren't adjusted accordingly.
Particularly, x86_64, ppc64 and sparc64 32-bit compat wrappers were adjusted
in 2.6.5, then in 2.6.8 ia64 patch replaced ia64 broken 32-bit compat
wrapper with generic compat_sys_getdents and sparc64 started using it as
well, then in 2.6.11 s390x which previously had the wrapper broken switched
to compat_sys_getdents
(http://www.ussg.iu.edu/hypermail/linux/kernel/0502.0/0372.html)
and then in 2.6.15 ppc64 switched to compat_sys_getdents.
So I guess to stay on the safe side, we should only enable it for 2.6.8+
on non-s390{,x} and for 2.6.11+ for s390{,x} instead of already in
2.6.4+ everywhere.  Otherwise e.g. gcc fails to bootstrap on s390.

2006-01-05  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_WAITID_SYSCALL):
	Only define for 2.6.12+ on s390{,x}.
	(__ASSUME_GETDENTS32_D_TYPE): Only define for 2.6.8+ on most arches
	and only for 2.6.11+ on s390{,x}.

--- libc/sysdeps/unix/sysv/linux/kernel-features.h.jj	2005-12-13 16:42:22.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/kernel-features.h	2006-01-05 22:52:21.000000000 +0100
@@ -1,6 +1,6 @@
 /* Set flags signalling availability of kernel features based on given
    kernel version number.
-   Copyright (C) 1999-2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1999-2003, 2004, 2005, 2006 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
@@ -423,8 +423,10 @@
 #endif
 
 /* Starting with version 2.6.4-rc1 the getdents syscall returns d_type
-   information as well.  */
-#if __LINUX_KERNEL_VERSION >= 132612
+   information as well and in between 2.6.5 and 2.6.8 most compat wrappers
+   were fixed too.  Except s390{,x} which was fixed in 2.6.11.  */
+#if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \
+    || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__)
 # define __ASSUME_GETDENTS32_D_TYPE	1
 #endif
 
@@ -435,9 +437,11 @@
 #endif
 
 /* Starting with version 2.6.9, the waitid system call is available.
-   Except for powerpc and powerpc64, where it is available in 2.6.12.  */
-#if (__LINUX_KERNEL_VERSION >= 0x020609 && !defined __powerpc__) \
-    || (__LINUX_KERNEL_VERSION >= 0x02060c && defined __powerpc__)
+   Except for powerpc{,64} and s390{,x}, where it is available in 2.6.12.  */
+#if (__LINUX_KERNEL_VERSION >= 0x020609 \
+     && !defined __powerpc__ && !defined __s390__) \
+    || (__LINUX_KERNEL_VERSION >= 0x02060c \
+	&& (defined __powerpc__ || defined __s390__))
 # define __ASSUME_WAITID_SYSCALL	1
 #endif
 

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]