This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[glibc/zack/no-nested-includes] Don't include sys/types.h 6/n: sys/epoll.h


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8ba85a77a5b70086599850969f3e6256907eaca3

commit 8ba85a77a5b70086599850969f3e6256907eaca3
Author: Zack Weinberg <zackw@panix.com>
Date:   Sun May 26 12:06:13 2019 -0400

    Don't include sys/types.h 6/n: sys/epoll.h
    
    I thought I was going to need to change all of the arch-specific
    bits/epoll.h headers as well, but it turned out not to be necessary.
    I still took the opportunity to give them all multiple inclusion
    guards.
    
    	* sysdeps/unix/sysv/linux/sys/epoll.h: Donâ??t include stdint.h
    	or sys/types.h.  Do include features.h and bits/types.h.
    	(union epoll_data, struct epoll_event): Use __uint32_t and
    	__uint64_t for field types.
    
    	* sysdeps/unix/sysv/linux/alpha/bits/epoll.h
    	* sysdeps/unix/sysv/linux/bits/epoll.h
    	* sysdeps/unix/sysv/linux/hppa/bits/epoll.h
    	* sysdeps/unix/sysv/linux/mips/bits/epoll.h
    	* sysdeps/unix/sysv/linux/sparc/bits/epoll.h
    	* sysdeps/unix/sysv/linux/x86/bits/epoll.h:
    	Add multiple inclusion guard.
    	* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
    	Update.

Diff:
---
 scripts/check-obsolete-constructs.py       |  1 -
 sysdeps/unix/sysv/linux/alpha/bits/epoll.h |  5 +++++
 sysdeps/unix/sysv/linux/bits/epoll.h       |  5 +++++
 sysdeps/unix/sysv/linux/hppa/bits/epoll.h  |  5 +++++
 sysdeps/unix/sysv/linux/mips/bits/epoll.h  |  5 +++++
 sysdeps/unix/sysv/linux/sparc/bits/epoll.h |  5 +++++
 sysdeps/unix/sysv/linux/sys/epoll.h        | 10 +++++-----
 sysdeps/unix/sysv/linux/x86/bits/epoll.h   |  5 +++++
 8 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py
index 4472c80..f9121ab 100755
--- a/scripts/check-obsolete-constructs.py
+++ b/scripts/check-obsolete-constructs.py
@@ -594,7 +594,6 @@ HEADER_ALLOWED_INCLUDES = {
     "sys/bitypes.h":               [ "sys/types.h" ],
     "sys/dir.h":                   [ "dirent.h" ],
     "sys/elf.h":                   [ "sys/procfs.h" ],
-    "sys/epoll.h":                 [ "stdint.h", "sys/types.h" ],
     "sys/errno.h":                 [ "errno.h" ],
     "sys/eventfd.h":               [ "stdint.h" ],
     "sys/fanotify.h":              [ "stdint.h" ],
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/epoll.h b/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
index 3bf1853..41dd9c5 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/epoll.h
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef	_SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC  = 010000000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/bits/epoll.h b/sysdeps/unix/sysv/linux/bits/epoll.h
index eaba990..a00f3d9 100644
--- a/sysdeps/unix/sysv/linux/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/bits/epoll.h
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef	_SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC = 02000000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/epoll.h b/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
index 156bda0..7772214 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/epoll.h
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef	_SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC = 010000000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/epoll.h b/sysdeps/unix/sysv/linux/mips/bits/epoll.h
index eaba990..a00f3d9 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/epoll.h
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef	_SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC = 02000000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/epoll.h b/sysdeps/unix/sysv/linux/sparc/bits/epoll.h
index 29e0052..2ddfe7b 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/epoll.h
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef	_SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -25,3 +28,5 @@ enum
     EPOLL_CLOEXEC = 0x400000
 #define EPOLL_CLOEXEC EPOLL_CLOEXEC
   };
+
+#endif /* bits/epoll.h */
diff --git a/sysdeps/unix/sysv/linux/sys/epoll.h b/sysdeps/unix/sysv/linux/sys/epoll.h
index 51ec53d..3a16323 100644
--- a/sysdeps/unix/sysv/linux/sys/epoll.h
+++ b/sysdeps/unix/sysv/linux/sys/epoll.h
@@ -18,9 +18,9 @@
 #ifndef	_SYS_EPOLL_H
 #define	_SYS_EPOLL_H	1
 
-#include <stdint.h>
-#include <sys/types.h>
+#include <features.h>
 
+#include <bits/types.h>
 #include <bits/types/sigset_t.h>
 
 /* Get the platform-dependent flags.  */
@@ -76,13 +76,13 @@ typedef union epoll_data
 {
   void *ptr;
   int fd;
-  uint32_t u32;
-  uint64_t u64;
+  __uint32_t u32;
+  __uint64_t u64;
 } epoll_data_t;
 
 struct epoll_event
 {
-  uint32_t events;	/* Epoll events */
+  __uint32_t events;	/* Epoll events */
   epoll_data_t data;	/* User data variable */
 } __EPOLL_PACKED;
 
diff --git a/sysdeps/unix/sysv/linux/x86/bits/epoll.h b/sysdeps/unix/sysv/linux/x86/bits/epoll.h
index 162874a..c8c8737 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/epoll.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/epoll.h
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_EPOLL_H
+#define _BITS_EPOLL_H 1
+
 #ifndef	_SYS_EPOLL_H
 # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
 #endif
@@ -27,3 +30,5 @@ enum
   };
 
 #define __EPOLL_PACKED __attribute__ ((__packed__))
+
+#endif /* bits/epoll.h */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]