diff options
author | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2009-05-31 15:14:43 +0200 |
---|---|---|
committer | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2009-05-31 15:14:43 +0200 |
commit | 8c35c309148bb67b98aa624a291f281c27f55774 (patch) | |
tree | 32ed80e84a0a521d2a7d2a57e503c06b43f2edb7 | |
parent | dd09d262b01aaf11e58bdf4afd580327d715e3af (diff) | |
download | openembedded-8c35c309148bb67b98aa624a291f281c27f55774.tar.gz |
glibc 2.6.1: backport eventfd(2), eventfd_read(2), eventfd_write(2) from glibc 2.9
-rw-r--r-- | recipes/glibc/files/glibc-2.6.1-backport-eventfd.patch | 225 | ||||
-rw-r--r-- | recipes/glibc/glibc_2.6.1.bb | 3 |
2 files changed, 227 insertions, 1 deletions
diff --git a/recipes/glibc/files/glibc-2.6.1-backport-eventfd.patch b/recipes/glibc/files/glibc-2.6.1-backport-eventfd.patch new file mode 100644 index 0000000000..5454636d60 --- /dev/null +++ b/recipes/glibc/files/glibc-2.6.1-backport-eventfd.patch @@ -0,0 +1,225 @@ +Index: glibc-2.6.1/sysdeps/unix/sysv/linux/Makefile +=================================================================== +--- glibc-2.6.1.orig/sysdeps/unix/sysv/linux/Makefile ++++ glibc-2.6.1/sysdeps/unix/sysv/linux/Makefile +@@ -13,7 +13,8 @@ + + ifeq ($(subdir),misc) + sysdep_routines += sysctl clone llseek umount umount2 readahead \ +- setfsuid setfsgid makedev epoll_pwait ++ setfsuid setfsgid makedev epoll_pwait \ ++ eventfd eventfd_read eventfd_write + + CFLAGS-gethostid.c = -fexceptions + +@@ -24,7 +25,7 @@ + sys/quota.h sys/fsuid.h \ + scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \ + sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \ +- bits/a.out.h sys/inotify.h ++ bits/a.out.h sys/inotify.h sys/eventfd.h + + install-others += $(inst_includedir)/bits/syscall.h + +Index: glibc-2.6.1/sysdeps/unix/sysv/linux/sys/eventfd.h +=================================================================== +--- /dev/null ++++ glibc-2.6.1/sysdeps/unix/sysv/linux/sys/eventfd.h +@@ -0,0 +1,52 @@ ++/* Copyright (C) 2007, 2008 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. */ ++ ++#ifndef _SYS_EVENTFD_H ++#define _SYS_EVENTFD_H 1 ++ ++#include <stdint.h> ++ ++ ++/* Type for event counter. */ ++typedef uint64_t eventfd_t; ++ ++/* Flags for signalfd. */ ++enum ++ { ++ EFD_CLOEXEC = 02000000, ++#define EFD_CLOEXEC EFD_CLOEXEC ++ EFD_NONBLOCK = 04000 ++#define EFD_NONBLOCK EFD_NONBLOCK ++ }; ++ ++ ++__BEGIN_DECLS ++ ++/* Return file descriptor for generic event channel. Set initial ++ value to COUNT. */ ++extern int eventfd (int __count, int __flags) __THROW; ++ ++/* Read event counter and possibly wait for events. */ ++extern int eventfd_read (int __fd, eventfd_t *__value); ++ ++/* Increment event counter. */ ++extern int eventfd_write (int __fd, eventfd_t value); ++ ++__END_DECLS ++ ++#endif /* sys/eventfd.h */ +Index: glibc-2.6.1/sysdeps/unix/sysv/linux/eventfd.c +=================================================================== +--- /dev/null ++++ glibc-2.6.1/sysdeps/unix/sysv/linux/eventfd.c +@@ -0,0 +1,47 @@ ++/* Copyright (C) 2007, 2008 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 <errno.h> ++#include <sys/eventfd.h> ++#include <sysdep.h> ++ ++ ++int ++eventfd (int count, int flags) ++{ ++#ifdef __NR_eventfd2 ++ return INLINE_SYSCALL (eventfd2, 2, count, flags); ++#else ++ /* 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 ++ O_NONBLOCK etc. */ ++ if (flags != 0) ++ { ++ __set_errno (EINVAL); ++ return -1; ++ } ++ ++# ifdef __NR_eventfd ++ return INLINE_SYSCALL (eventfd, 1, count); ++# else ++ __set_errno (ENOSYS); ++ return -1; ++# endif ++#endif ++} +Index: glibc-2.6.1/sysdeps/unix/sysv/linux/eventfd_read.c +=================================================================== +--- /dev/null ++++ glibc-2.6.1/sysdeps/unix/sysv/linux/eventfd_read.c +@@ -0,0 +1,28 @@ ++/* Copyright (C) 2007 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 <errno.h> ++#include <unistd.h> ++#include <sys/eventfd.h> ++ ++ ++int ++eventfd_read (int fd, eventfd_t *value) ++{ ++ return __read (fd, value, sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0; ++} +Index: glibc-2.6.1/sysdeps/unix/sysv/linux/eventfd_write.c +=================================================================== +--- /dev/null ++++ glibc-2.6.1/sysdeps/unix/sysv/linux/eventfd_write.c +@@ -0,0 +1,29 @@ ++/* Copyright (C) 2007 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 <errno.h> ++#include <unistd.h> ++#include <sys/eventfd.h> ++ ++ ++int ++eventfd_write (int fd, eventfd_t value) ++{ ++ return __write (fd, &value, ++ sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0; ++} +Index: glibc-2.6.1/sysdeps/unix/sysv/linux/Versions +=================================================================== +--- glibc-2.6.1.orig/sysdeps/unix/sysv/linux/Versions ++++ glibc-2.6.1/sysdeps/unix/sysv/linux/Versions +@@ -129,6 +129,9 @@ + GLIBC_2.6 { + epoll_pwait; sync_file_range; sched_getcpu; + } ++ GLIBC_2.7 { ++ eventfd; eventfd_read; eventfd_write; signalfd; ++ } + GLIBC_PRIVATE { + # functions used in other libraries + __syscall_rt_sigqueueinfo; +Index: glibc-2.6.1/Versions.def +=================================================================== +--- glibc-2.6.1.orig/Versions.def ++++ glibc-2.6.1/Versions.def +@@ -23,6 +23,7 @@ + GLIBC_2.4 + GLIBC_2.5 + GLIBC_2.6 ++ GLIBC_2.7 + %ifdef USE_IN_LIBIO + HURD_CTHREADS_0.3 + %endif diff --git a/recipes/glibc/glibc_2.6.1.bb b/recipes/glibc/glibc_2.6.1.bb index ab343ea0a6..7f6a0d3caf 100644 --- a/recipes/glibc/glibc_2.6.1.bb +++ b/recipes/glibc/glibc_2.6.1.bb @@ -1,5 +1,5 @@ require glibc.inc -PR = "r15" +PR = "r16" PACKAGES_DYNAMIC = "libc6*" RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev" @@ -59,6 +59,7 @@ SRC_URI = "\ file://glibc-arm-no-asm-page.patch;patch=1 \ file://armv4t-interworking.patch;patch=1 \ file://march-i686.patch;patch=1;pnum=0 \ + file://glibc-2.6.1-backport-eventfd.patch;patch=1 \ " # Build fails on sh3 and sh4 without additional patches |