This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Change __ASSUME_ACCEPT4 on powerpc to 2.6.37
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 04 Jun 2013 11:38:19 -0300
- Subject: Re: [PATCH] Change __ASSUME_ACCEPT4 on powerpc to 2.6.37
- References: <20130604124225 dot GQ4389 at 0c3 dot net>
Hi Adam,
I believe this patch is incomplete: if you build GLIBC on a system with recent kernel
headers __NR_accept4 will be defined and therefore sysdeps/unix/sysv/linux/accept4.c
will be built to use accept4 syscall instead of __internal_accept4 (which uses socketcall).
On 04-06-2013 09:42, Adam Conrad wrote:
> In Debian, we currently build with a minimum kernel version of 2.6.32
> for backward compat with squeeze, lucid, and RHEL6. __ASSUME_ACCEPT4
> is enabled for kernel versions >= 2.6.28 on x86, sparc, powerpc, and
> s390, however this wasn't actually exported on powerpc until 2.6.37ish
> in commit 86250b9d12caa1a3dee12a7cf638b7dd70eaadb6:
>
> $ git tag --contains 86250b9d12caa1a3dee12a7cf638b7dd70eaadb6 | grep -v rc
> v2.6.37
> v2.6.38
> v2.6.39
> v3.0
> v3.1
> [...]
>
> In light of this, I'm proposing the following simple commit.
>
> ... Adam
>
> - snip -
>
> * sysdeps/unix/sysv/linux/kernel-features.h: Restrict accept4 on
> powerpc to kernels >= 2.6.37.
>
> diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
> index ccd4c59..6a6a2dd 100644
> --- a/sysdeps/unix/sysv/linux/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/kernel-features.h
> @@ -166,11 +166,16 @@
>
> /* Support for the accept4 syscall was added in 2.6.28. */
> #if __LINUX_KERNEL_VERSION >= 0x02061c \
> - && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
> + && (defined __i386__ || defined __x86_64__ \
> || defined __sparc__ || defined __s390__)
> # define __ASSUME_ACCEPT4 1
> #endif
>
> +/* Support for the accept4 syscall was added in 2.6.37 on powerpc. */
> +#if __LINUX_KERNEL_VERSION >= 0x020625 && defined __powerpc__
> +# define __ASSUME_ACCEPT4 1
> +#endif
> +
> /* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29. */
> #if __LINUX_KERNEL_VERSION >= 0x02061d
> # define __ASSUME_FUTEX_CLOCK_REALTIME 1
>