[oe-commits] Michael 'Mickey' Lauer : glibc 2.5: backport eventfd(2) feature from glibc 2.9
git version control
git at git.openembedded.org
Sat May 30 19:05:39 UTC 2009
Module: openembedded.git
Branch: fso/milestone5.5
Commit: e93c7836db5c6a2114a6eac543a20e363093ea35
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=e93c7836db5c6a2114a6eac543a20e363093ea35
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date: Sat May 30 21:11:46 2009 +0200
glibc 2.5: backport eventfd(2) feature from glibc 2.9
---
.../glibc/glibc-2.5/glibc25-backport-eventfd.patch | 200 ++++++++++++++++++++
recipes/glibc/glibc_2.5.bb | 3 +-
2 files changed, 202 insertions(+), 1 deletions(-)
diff --git a/recipes/glibc/glibc-2.5/glibc25-backport-eventfd.patch b/recipes/glibc/glibc-2.5/glibc25-backport-eventfd.patch
new file mode 100644
index 0000000..b26e4a3
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/glibc25-backport-eventfd.patch
@@ -0,0 +1,200 @@
+Signed-off-by: Michael 'Mickey' Lauer <mlauer at vanille-media.de>
+
+Index: glibc-2.5/sysdeps/unix/sysv/linux/Makefile
+===================================================================
+--- glibc-2.5.orig/sysdeps/unix/sysv/linux/Makefile
++++ glibc-2.5/sysdeps/unix/sysv/linux/Makefile
+@@ -13,7 +13,7 @@
+
+ ifeq ($(subdir),misc)
+ sysdep_routines += sysctl clone llseek umount umount2 readahead \
+- setfsuid setfsgid makedev
++ setfsuid setfsgid makedev eventfd eventfd_read eventfd_write
+
+ CFLAGS-gethostid.c = -fexceptions
+
+@@ -24,7 +24,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.5/sysdeps/unix/sysv/linux/sys/eventfd.h
+===================================================================
+--- /dev/null
++++ glibc-2.5/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.5/sysdeps/unix/sysv/linux/eventfd.c
+===================================================================
+--- /dev/null
++++ glibc-2.5/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.5/sysdeps/unix/sysv/linux/eventfd_read.c
+===================================================================
+--- /dev/null
++++ glibc-2.5/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.5/sysdeps/unix/sysv/linux/eventfd_write.c
+===================================================================
+--- /dev/null
++++ glibc-2.5/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;
++}
diff --git a/recipes/glibc/glibc_2.5.bb b/recipes/glibc/glibc_2.5.bb
index 6e22959..cfae66a 100644
--- a/recipes/glibc/glibc_2.5.bb
+++ b/recipes/glibc/glibc_2.5.bb
@@ -1,5 +1,5 @@
require glibc.inc
-PR = "r18"
+PR = "r19"
ARM_INSTRUCTION_SET = "arm"
@@ -49,6 +49,7 @@ SRC_URI = "\
file://zecke-sane-readelf.patch;patch=1 \
file://ldd-unbash.patch;patch=1 \
file://glibc-2.6.1-use-short-for-fnstsw.patch;patch=1 \
+ file://glibc25-backport-eventfd.patch;patch=1 \
file://generic-bits_select.h \
file://generic-bits_types.h \
file://generic-bits_typesizes.h \
More information about the Openembedded-commits
mailing list