As in timerfd.h, eventfd.h needs arch-specific definition files. alpha, mips and sparc needs separate file, all the other arch will use common definition.
This problem is already fixed in glibc. Signed-off-by: Hiroaki KAWAI <ka...@stratosphere.co.jp> --- libc/sysdeps/linux/alpha/bits/eventfd.h | 32 ++++++++++++++++++++++++++++++ libc/sysdeps/linux/common/bits/eventfd.h | 32 ++++++++++++++++++++++++++++++ libc/sysdeps/linux/common/sys/eventfd.h | 14 +----------- libc/sysdeps/linux/mips/bits/eventfd.h | 32 ++++++++++++++++++++++++++++++ libc/sysdeps/linux/sparc/bits/eventfd.h | 32 ++++++++++++++++++++++++++++++ 5 files changed, 130 insertions(+), 12 deletions(-) create mode 100644 libc/sysdeps/linux/alpha/bits/eventfd.h create mode 100644 libc/sysdeps/linux/common/bits/eventfd.h create mode 100644 libc/sysdeps/linux/mips/bits/eventfd.h create mode 100644 libc/sysdeps/linux/sparc/bits/eventfd.h diff --git a/libc/sysdeps/linux/alpha/bits/eventfd.h b/libc/sysdeps/linux/alpha/bits/eventfd.h new file mode 100644 index 0000000..999f925 --- /dev/null +++ b/libc/sysdeps/linux/alpha/bits/eventfd.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2008-2012 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, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EVENTFD_H +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." +#endif + +/* Flags for `eventfd'. */ +enum + { + EFD_SEMAPHORE = 1, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 010000000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 000000004 +#define EFD_NONBLOCK EFD_NONBLOCK + }; + diff --git a/libc/sysdeps/linux/common/bits/eventfd.h b/libc/sysdeps/linux/common/bits/eventfd.h new file mode 100644 index 0000000..5f034bb --- /dev/null +++ b/libc/sysdeps/linux/common/bits/eventfd.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2008-2012 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, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EVENTFD_H +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." +#endif + +/* Flags for `eventfd'. */ +enum + { + EFD_SEMAPHORE = 1, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 02000000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 04000 +#define EFD_NONBLOCK EFD_NONBLOCK + }; + diff --git a/libc/sysdeps/linux/common/sys/eventfd.h b/libc/sysdeps/linux/common/sys/eventfd.h index 311f803..a57dbc9 100644 --- a/libc/sysdeps/linux/common/sys/eventfd.h +++ b/libc/sysdeps/linux/common/sys/eventfd.h @@ -21,22 +21,12 @@ #include <stdint.h> +/* Get the platform-dependent flags. */ +#include <bits/eventfd.h> /* Type for event counter. */ typedef uint64_t eventfd_t; -/* Flags for signalfd. */ -enum - { - EFD_SEMAPHORE = 1, -#define EFD_SEMAPHORE EFD_SEMAPHORE - 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 diff --git a/libc/sysdeps/linux/mips/bits/eventfd.h b/libc/sysdeps/linux/mips/bits/eventfd.h new file mode 100644 index 0000000..eaf08e8 --- /dev/null +++ b/libc/sysdeps/linux/mips/bits/eventfd.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2008-2012 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, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EVENTFD_H +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." +#endif + +/* Flags for `eventfd'. */ +enum + { + EFD_SEMAPHORE = 1, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 02000000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 00000200 +#define EFD_NONBLOCK EFD_NONBLOCK + }; + diff --git a/libc/sysdeps/linux/sparc/bits/eventfd.h b/libc/sysdeps/linux/sparc/bits/eventfd.h new file mode 100644 index 0000000..9434b76 --- /dev/null +++ b/libc/sysdeps/linux/sparc/bits/eventfd.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2008-2012 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, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EVENTFD_H +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." +#endif + +/* Flags for `eventfd'. */ +enum + { + EFD_SEMAPHORE = 1, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 0x400000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 0x004000 +#define EFD_NONBLOCK EFD_NONBLOCK + }; + -- 1.7.9 _______________________________________________ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc