[git commit branch/0.9.33] epoll.h: sync with glibc

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Tue May 15 07:13:43 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=6869ad3f4e9ae97208da0d5b59a368b60513a583
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/0.9.33

Since glibc has split out arch-specific stuff to bits/epoll.h, we can
pull that sanity back into our tree and drop the arch ifdefs.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libc/sysdeps/linux/alpha/bits/epoll.h  |   29 ++++++++++++++++++
 libc/sysdeps/linux/common/bits/epoll.h |   29 ++++++++++++++++++
 libc/sysdeps/linux/common/sys/epoll.h  |   50 +++++++------------------------
 libc/sysdeps/linux/mips/bits/epoll.h   |   29 ++++++++++++++++++
 libc/sysdeps/linux/sparc/bits/epoll.h  |   29 ++++++++++++++++++
 libc/sysdeps/linux/x86_64/bits/epoll.h |   31 +++++++++++++++++++
 6 files changed, 159 insertions(+), 38 deletions(-)

diff --git a/libc/sysdeps/linux/alpha/bits/epoll.h b/libc/sysdeps/linux/alpha/bits/epoll.h
new file mode 100644
index 0000000..7f9f374
--- /dev/null
+++ b/libc/sysdeps/linux/alpha/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-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_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC  = 010000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 000000004
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/libc/sysdeps/linux/common/bits/epoll.h b/libc/sysdeps/linux/common/bits/epoll.h
new file mode 100644
index 0000000..0a49b97
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-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_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 02000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 00004000
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/libc/sysdeps/linux/common/sys/epoll.h b/libc/sysdeps/linux/common/sys/epoll.h
index a04bd70..a55ebad 100644
--- a/libc/sysdeps/linux/common/sys/epoll.h
+++ b/libc/sysdeps/linux/common/sys/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-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
@@ -12,9 +12,8 @@
    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.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef	_SYS_EPOLL_H
 #define	_SYS_EPOLL_H	1
@@ -30,33 +29,12 @@
 typedef __sigset_t sigset_t;
 #endif
 
+/* Get the platform-dependent flags.  */
+#include <bits/epoll.h>
 
-/* Flags to be passed to epoll_create1.  */
-
-enum
-  {
-#if defined __alpha__
-    EPOLL_CLOEXEC = 010000000,
-# define EPOLL_CLOEXEC EPOLL_CLOEXEC
-    EPOLL_NONBLOCK = 04
-# define EPOLL_NONBLOCK EPOLL_NONBLOCK
-#else
-# if defined __sparc__
-    EPOLL_CLOEXEC = 020000000,
-# else
-    EPOLL_CLOEXEC = 02000000,
-# endif
-# define EPOLL_CLOEXEC EPOLL_CLOEXEC
-# if defined __mips__
-    EPOLL_NONBLOCK = 0200
-# elif defined __sparc__
-    EPOLL_NONBLOCK = 040000
-# else
-    EPOLL_NONBLOCK = 04000
-# endif
-#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+#ifndef __EPOLL_PACKED
+# define __EPOLL_PACKED
 #endif
-  };
 
 
 enum EPOLL_EVENTS
@@ -83,9 +61,9 @@ enum EPOLL_EVENTS
 #define EPOLLHUP EPOLLHUP
     EPOLLRDHUP = 0x2000,
 #define EPOLLRDHUP EPOLLRDHUP
-    EPOLLONESHOT = (1 << 30),
+    EPOLLONESHOT = 1u << 30,
 #define EPOLLONESHOT EPOLLONESHOT
-    EPOLLET = (1 << 31)
+    EPOLLET = 1u << 31
 #define EPOLLET EPOLLET
   };
 
@@ -108,11 +86,7 @@ struct epoll_event
 {
   uint32_t events;	/* Epoll events */
   epoll_data_t data;	/* User data variable */
-}
-#if defined __x86_64__
-__attribute__((packed))
-#endif
-;
+} __EPOLL_PACKED;
 
 
 __BEGIN_DECLS
@@ -123,7 +97,7 @@ __BEGIN_DECLS
    returned by epoll_create() should be closed with close().  */
 extern int epoll_create (int __size) __THROW;
 
-/* Same as epoll_create but with a FLAGS parameter.  The unused SIZE
+/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
    parameter has been dropped.  */
 extern int epoll_create1 (int __flags) __THROW;
 
@@ -159,7 +133,7 @@ extern int epoll_wait (int __epfd, struct epoll_event *__events,
    __THROW.  */
 extern int epoll_pwait (int __epfd, struct epoll_event *__events,
 			int __maxevents, int __timeout,
-			__const __sigset_t *__ss);
+			const __sigset_t *__ss);
 
 __END_DECLS
 
diff --git a/libc/sysdeps/linux/mips/bits/epoll.h b/libc/sysdeps/linux/mips/bits/epoll.h
new file mode 100644
index 0000000..4c6eb3b
--- /dev/null
+++ b/libc/sysdeps/linux/mips/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-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_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 02000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 00000200
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/libc/sysdeps/linux/sparc/bits/epoll.h b/libc/sysdeps/linux/sparc/bits/epoll.h
new file mode 100644
index 0000000..5324020
--- /dev/null
+++ b/libc/sysdeps/linux/sparc/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-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_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 0x400000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 0x004000
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/libc/sysdeps/linux/x86_64/bits/epoll.h b/libc/sysdeps/linux/x86_64/bits/epoll.h
new file mode 100644
index 0000000..be1f5a6
--- /dev/null
+++ b/libc/sysdeps/linux/x86_64/bits/epoll.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 2002-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_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 02000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 00004000
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
+
+#define __EPOLL_PACKED __attribute__ ((__packed__))


More information about the uClibc-cvs mailing list