Author: aurel32 Date: 2009-07-24 17:53:57 +0000 (Fri, 24 Jul 2009) New Revision: 3643
Added: glibc-package/branches/eglibc-2.10/debian/patches/any/submitted-signalfd-eventfd.diff Modified: glibc-package/branches/eglibc-2.10/debian/changelog glibc-package/branches/eglibc-2.10/debian/patches/kfreebsd/local-sysdeps.diff glibc-package/branches/eglibc-2.10/debian/patches/series Log: Merge from trunk, revisions 3640-3642. Modified: glibc-package/branches/eglibc-2.10/debian/changelog =================================================================== --- glibc-package/branches/eglibc-2.10/debian/changelog 2009-07-24 17:45:53 UTC (rev 3642) +++ glibc-package/branches/eglibc-2.10/debian/changelog 2009-07-24 17:53:57 UTC (rev 3643) @@ -108,9 +108,11 @@ eglibc (2.9-22) UNSTABLE; urgency=low - * kfreebsd/local-sysdeps.diff: update to revision 2653 (from glibc-bsd). + * kfreebsd/local-sysdeps.diff: update to revision 2670 (from glibc-bsd). + * any/submitted-signalfd-eventfd.diff: new patch to support < 2.6.27 + kernels in eventfd/signalfd. Closes: #537509. - -- Aurelien Jarno <[email protected]> Mon, 20 Jul 2009 11:53:15 +0200 + -- Aurelien Jarno <[email protected]> Mon, 20 Jul 2009 20:33:36 +0200 eglibc (2.9-21) unstable; urgency=low Added: glibc-package/branches/eglibc-2.10/debian/patches/any/submitted-signalfd-eventfd.diff =================================================================== --- glibc-package/branches/eglibc-2.10/debian/patches/any/submitted-signalfd-eventfd.diff (rev 0) +++ glibc-package/branches/eglibc-2.10/debian/patches/any/submitted-signalfd-eventfd.diff 2009-07-24 17:53:57 UTC (rev 3643) @@ -0,0 +1,162 @@ +2009-07-20 Aurelien Jarno <[email protected]> + + * sysdeps/unix/sysv/linux/kernel-features.h: Define + __ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4. + * sysdeps/unix/sysv/linux/eventfd.c: Fall back to the old syscall + in case the signalfd4 syscall is not available. + * sysdeps/unix/sysv/linux/signalfd.c: Fall back to the old syscall + in case the eventfd2 syscall is not available. + +--- a/sysdeps/unix/sysv/linux/eventfd.c ++++ b/sysdeps/unix/sysv/linux/eventfd.c +@@ -19,14 +19,20 @@ + #include <errno.h> + #include <sys/eventfd.h> + #include <sysdep.h> ++#include <kernel-features.h> + + + int + eventfd (int count, int flags) + { + #ifdef __NR_eventfd2 +- return INLINE_SYSCALL (eventfd2, 2, count, flags); +-#else ++ int res = INLINE_SYSCALL (eventfd2, 2, count, flags); ++# ifndef __ASSUME_EVENTFD2 ++ if (res != -1 || errno != ENOSYS) ++# endif ++ return res; ++#endif ++ + /* The old system call has no flag parameter which is bad. So we have + to wait until we have to support to pass additional values to the + kernel (sys_indirect) before implementing setting flags like +@@ -37,11 +43,10 @@ eventfd (int count, int flags) + return -1; + } + +-# ifdef __NR_eventfd ++#ifdef __NR_eventfd + return INLINE_SYSCALL (eventfd, 1, count); +-# else ++#else + __set_errno (ENOSYS); + return -1; +-# endif + #endif + } +--- a/sysdeps/unix/sysv/linux/kernel-features.h ++++ b/sysdeps/unix/sysv/linux/kernel-features.h +@@ -529,3 +529,12 @@ + # define __ASSUME_PIPE2 1 + # define __ASSUME_PACCEPT 1 + #endif ++ ++/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27. */ ++#if __LINUX_KERNEL_VERSION >= 0x02061b \ ++ && (defined __i386__ || defined __x86_64__ || defined __ia64__ \ ++ || defined __powerpc__ || defined __s390__ || defined __sparc__ \ ++ || defined __sh__) ++# define __ASSUME_EVENTFD2 1 ++# define __ASSUME_SIGNALFD4 1 ++#endif +--- a/sysdeps/unix/sysv/linux/signalfd.c ++++ b/sysdeps/unix/sysv/linux/signalfd.c +@@ -20,14 +20,20 @@ + #include <signal.h> + #include <sys/signalfd.h> + #include <sysdep.h> ++#include <kernel-features.h> + + + int + signalfd (int fd, const sigset_t *mask, int flags) + { + #ifdef __NR_signalfd4 +- return INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags); +-#else ++ int res = INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags); ++# ifndef __ASSUME_SIGNALFD4 ++ if (res != -1 || errno != ENOSYS) ++# endif ++ return res; ++#endif ++ + /* The old system call has no flag parameter which is bad. So we have + to wait until we have to support to pass additional values to the + kernel (sys_indirect) before implementing setting flags like +@@ -38,11 +44,10 @@ signalfd (int fd, const sigset_t *mask, int flags) + return -1; + } + +-# ifdef __NR_signalfd ++#ifdef __NR_signalfd + return INLINE_SYSCALL (signalfd, 3, fd, mask, _NSIG / 8); +-# else ++#else + __set_errno (ENOSYS); + return -1; +-# endif + #endif + } +2009-07-20 Aurelien Jarno <[email protected]> + + * sysdeps/unix/sysv/linux/arm/kernel-features.h: Define + __ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4. + +--- a/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h ++++ b/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h +@@ -61,6 +61,12 @@ + # define __ASSUME_FUTEX_LOCK_PI 1 + #endif + ++/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27. */ ++#if __LINUX_KERNEL_VERSION >= 0x02061b ++# define __ASSUME_EVENTFD2 1 ++# define __ASSUME_SIGNALFD4 1 ++#endif ++ + #include_next <kernel-features.h> + + /* These syscalls are not implemented yet for ARM. */ + + +2009-07-20 Aurelien Jarno <[email protected]> + + * sysdeps/unix/sysv/linux/hppa/kernel-features.h: Define + __ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4. + +--- a/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h ++++ b/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h +@@ -46,4 +46,10 @@ + # define __ASSUME_FUTEX_LOCK_PI 1 + #endif + ++/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.28. */ ++#if __LINUX_KERNEL_VERSION >= 0x02061c ++# define __ASSUME_EVENTFD2 1 ++# define __ASSUME_SIGNALFD4 1 ++#endif ++ + #include_next <kernel-features.h> + + +2009-07-20 Aurelien Jarno <[email protected]> + + * sysdeps/unix/sysv/linux/mips/kernel-features.h: Define + __ASSUME_EVENTFD2 and __ASSUME_SIGNALFD4. + +--- a/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h ++++ b/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h +@@ -42,4 +42,10 @@ + # define __ASSUME_FUTEX_LOCK_PI 1 + #endif + ++/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27. */ ++#if __LINUX_KERNEL_VERSION >= 0x02061c ++# define __ASSUME_EVENTFD2 1 ++# define __ASSUME_SIGNALFD4 1 ++#endif ++ + #include_next <kernel-features.h> Modified: glibc-package/branches/eglibc-2.10/debian/patches/kfreebsd/local-sysdeps.diff =================================================================== --- glibc-package/branches/eglibc-2.10/debian/patches/kfreebsd/local-sysdeps.diff 2009-07-24 17:45:53 UTC (rev 3642) +++ glibc-package/branches/eglibc-2.10/debian/patches/kfreebsd/local-sysdeps.diff 2009-07-24 17:53:57 UTC (rev 3643) @@ -129,7 +129,7 @@ +# For <sys/socket.h>. +sysdep_routines += bsd_sendfile +# For <sys/sysctl.h>. -+sysdep_routines += sysctl sysctlbyname ++sysdep_routines += sysctl sysctlbyname sysctlnametomib +# For <sys/uio.h>. +sysdep_routines += sys_readv sys_writev +# Other. @@ -22452,7 +22452,7 @@ +#include <sysdeps/posix/sysconf.c> --- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/sysctlbyname.c -@@ -0,0 +1,44 @@ +@@ -0,0 +1,38 @@ +/* Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Bruno Haible <[email protected]>, 2002. @@ -22482,13 +22482,7 @@ + int request[CTL_MAXNAME]; + size_t requestlen = sizeof (request); + -+ /* Convert the string NAME to a binary encoded request. The kernel -+ contains a routine for doing this, called "name2oid". But the way -+ to call it is a little bit strange. */ -+ int name2oid_request[2] = { 0, 3 }; -+ if (__sysctl (name2oid_request, 2, request, &requestlen, -+ (void *) name, strlen (name)) -+ < 0) ++ if (__sysctlnametomib(name, request, &requestlen) < 0) + return -1; + + /* Now call sysctl using the binary encoded request. */ @@ -22498,6 +22492,46 @@ + +weak_alias (__sysctlbyname, sysctlbyname) --- /dev/null ++++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/sysctlnametomib.c +@@ -0,0 +1,37 @@ ++/* Copyright (C) 2009 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; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#include <string.h> ++ ++int ++__sysctlnametomib (const char *name, int *mibp, size_t *sizep) ++{ ++ int request[CTL_MAXNAME]; ++ size_t requestlen = sizeof (request); ++ ++ /* Convert the string NAME to a binary encoded request. The kernel ++ contains a routine for doing this, called "name2oid". But the way ++ to call it is a little bit strange. */ ++ int name2oid_request[2] = { 0, 3 }; ++ return __sysctl (name2oid_request, 2, mibp, sizep, (void *) name, ++ strlen (name)); ++} ++ ++weak_alias (__sysctlnametomib, sysctlnametomib) +--- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/tcdrain.c @@ -0,0 +1,41 @@ +/* Copyright (C) 1995, 1996, 1997, 2002 Free Software Foundation, Inc. Modified: glibc-package/branches/eglibc-2.10/debian/patches/series =================================================================== --- glibc-package/branches/eglibc-2.10/debian/patches/series 2009-07-24 17:45:53 UTC (rev 3642) +++ glibc-package/branches/eglibc-2.10/debian/patches/series 2009-07-24 17:53:57 UTC (rev 3643) @@ -185,6 +185,7 @@ any/submitted-autotools.diff any/cvs-sunrpc-license.diff any/submitted-tst-cpucount.diff +any/submitted-signalfd-eventfd.diff any/submitted-accept4.diff any/cvs-nptl-init.diff any/submitted-accept4-hidden.diff -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

