Fix __ASSUME_PREADV and __ASSUME_PWRITEV for Alpha and MicroBlaze (bug 16649)

Message ID Pine.LNX.4.64.1403121746040.13379@digraph.polyomino.org.uk
State Committed
Headers

Commit Message

Joseph Myers March 12, 2014, 5:47 p.m. UTC
  Reviewing (for all architectures, with a baseline kernel version of
2.6.32) the kernel support for features for which __ASSUME_* macros
would be affected by a move to 2.6.32 as minimum kernel version showed
up that __ASSUME_PREADV and __ASSUME_PWRITEV were wrongly defined for
MicroBlaze (despite the corresponding syscall table entries not being
wired up in the kernel) and Alpha for 2.6.30 and above (although the
support on Alpha was added in 2.6.33).  This patch makes the
kernel-features.h files undefine those macros for appropriate
versions.

2014-03-12  Joseph Myers  <joseph@codesourcery.com>

	[BZ #16649]
	* sysdeps/unix/sysv/linux/alpha/kernel-features.h
	[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_PREADV): Undefine.
	[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_PWRITEV): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
	(__ASSUME_PREADV): Undefine.
	(__ASSUME_PWRITEV): Likewise.
  

Comments

David Holsgrove March 13, 2014, 4:37 a.m. UTC | #1
Hi Joseph,

> -----Original Message-----

> From: Joseph Myers [mailto:joseph@codesourcery.com]

> Sent: Thursday, 13 March 2014 3:48 am

> To: libc-alpha@sourceware.org; David Holsgrove; Richard Henderson

> Subject: Fix __ASSUME_PREADV and __ASSUME_PWRITEV for Alpha and

> MicroBlaze (bug 16649)

> 

> Reviewing (for all architectures, with a baseline kernel version of

> 2.6.32) the kernel support for features for which __ASSUME_* macros

> would be affected by a move to 2.6.32 as minimum kernel version showed

> up that __ASSUME_PREADV and __ASSUME_PWRITEV were wrongly defined for

> MicroBlaze (despite the corresponding syscall table entries not being

> wired up in the kernel) and Alpha for 2.6.30 and above (although the

> support on Alpha was added in 2.6.33).  This patch makes the

> kernel-features.h files undefine those macros for appropriate

> versions.

> 

> 2014-03-12  Joseph Myers  <joseph@codesourcery.com>

> 

> 	[BZ #16649]

> 	* sysdeps/unix/sysv/linux/alpha/kernel-features.h

> 	[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_PREADV):

> Undefine.

> 	[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_PWRITEV):

> Likewise.

> 	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h

> 	(__ASSUME_PREADV): Undefine.

> 	(__ASSUME_PWRITEV): Likewise.

> 

> diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h

> b/sysdeps/unix/sysv/linux/alpha/kernel-features.h

> index e691bb0..f3a7a55 100644

> --- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h

> @@ -93,4 +93,10 @@

>  # define __ASSUME_FDATASYNC	1

>  #endif

> 

> +/* Support for preadv and pwritev was added for alpha in 2.6.33.  */

> +#if __LINUX_KERNEL_VERSION < 0x020621

> +# undef __ASSUME_PREADV

> +# undef __ASSUME_PWRITEV

> +#endif

> +

>  #endif /* _KERNEL_FEATURES_H */

> diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h

> b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h

> index dfb8344..f9a61a9 100644

> --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h

> @@ -43,5 +43,8 @@

> 

>  #include_next <kernel-features.h>

> 

> -/* The MicroBlaze kernel does not support the pselect6 syscall.  */

> +/* The MicroBlaze kernel does not support the pselect6, preadv and

> +   pwritev syscalls.  */

>  #undef __ASSUME_PSELECT

> +#undef __ASSUME_PREADV

> +#undef __ASSUME_PWRITEV

> 


Okay for MicroBlaze.

Kernel patches to wire pselect, preadv and pwritev queued up for inclusion
by the MicroBlaze kernel maintainer.

Once available in a released kernel, I'll set the version in glibc (hopefully v3.15).

thanks again,
David

> --

> Joseph S. Myers

> joseph@codesourcery.com
  
Joseph Myers March 18, 2014, 10:17 p.m. UTC | #2
Ping.  The Alpha part of this patch 
<https://sourceware.org/ml/libc-alpha/2014-03/msg00279.html> is pending 
review.
  
Richard Henderson March 19, 2014, 2:27 a.m. UTC | #3
On 03/18/2014 03:17 PM, Joseph S. Myers wrote:
> Ping.  The Alpha part of this patch 
> <https://sourceware.org/ml/libc-alpha/2014-03/msg00279.html> is pending 
> review.
> 

This is ok.  Sorry for the delay.


r~
  

Patch

diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
index e691bb0..f3a7a55 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
@@ -93,4 +93,10 @@ 
 # define __ASSUME_FDATASYNC	1
 #endif
 
+/* Support for preadv and pwritev was added for alpha in 2.6.33.  */
+#if __LINUX_KERNEL_VERSION < 0x020621
+# undef __ASSUME_PREADV
+# undef __ASSUME_PWRITEV
+#endif
+
 #endif /* _KERNEL_FEATURES_H */
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
index dfb8344..f9a61a9 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -43,5 +43,8 @@ 
 
 #include_next <kernel-features.h>
 
-/* The MicroBlaze kernel does not support the pselect6 syscall.  */
+/* The MicroBlaze kernel does not support the pselect6, preadv and
+   pwritev syscalls.  */
 #undef __ASSUME_PSELECT
+#undef __ASSUME_PREADV
+#undef __ASSUME_PWRITEV