[PATCH 1/1] eventfd.h: Use new "bits/" scheme for arch-specific flags
Hiroaki KAWAI
kawai at stratosphere.co.jp
Thu Apr 18 02:00:23 UTC 2013
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.
Signed-off-by: Hiroaki KAWAI <kawai at 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 100755 libc/sysdeps/linux/alpha/bits/eventfd.h
create mode 100755 libc/sysdeps/linux/common/bits/eventfd.h
mode change 100644 => 100755 libc/sysdeps/linux/common/sys/eventfd.h
create mode 100755 libc/sysdeps/linux/mips/bits/eventfd.h
create mode 100755 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 100755
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 100755
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
old mode 100644
new mode 100755
index 311f803..a57dbc9
--- 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 100755
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 100755
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
More information about the uClibc
mailing list