about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2019-03-17 09:50:36 -0400
committerZack Weinberg <zackw@panix.com>2020-01-08 13:04:43 -0500
commit89cbc039a98f6bfc7e27c98a7e3799cf190c11f1 (patch)
tree9fe3176363b01537b7b119c7bd9fdbde552a25dc /sysdeps
parent5ad1fcd032064772025675690dea8e6335592c18 (diff)
downloadglibc-89cbc039a98f6bfc7e27c98a7e3799cf190c11f1.tar.gz
glibc-89cbc039a98f6bfc7e27c98a7e3799cf190c11f1.tar.xz
glibc-89cbc039a98f6bfc7e27c98a7e3799cf190c11f1.zip
Swap sys/poll.h with poll.h.
Similarly to (sys/)syslog.h, poll.h is the header standardized by
POSIX, but we had all of its contents in sys/, for historical reasons.
This patch exchanges the contents of the two headers, and adds
multiple-include guards to all of poll.h’s bits headers.

	* io/poll.h: Exchange contents with...
	* io/sys/poll.h: ...this file.  Adjust guard macros.

	* include/poll.h: Exchange contents with...
	* include/sys/poll.h: ...this file.  Adjust guard macros.

	* bits/poll.h, io/bits/poll2.h
	* sysdeps/unix/sysv/linux/bits/poll.h
	* sysdeps/unix/sysv/linux/m68k/bits/poll.h
	* sysdeps/unix/sysv/linux/mips/bits/poll.h
	* sysdeps/unix/sysv/linux/sparc/bits/poll.h:
        Allow inclusion by poll.h, not sys/poll.h.  Add multiple-
        include guards where not already present.

	* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
        Update.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/bits/poll.h9
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/poll.h9
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/poll.h9
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/poll.h9
4 files changed, 28 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/bits/poll.h b/sysdeps/unix/sysv/linux/bits/poll.h
index 40ca6ebba7..3cf2e56ae9 100644
--- a/sysdeps/unix/sysv/linux/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/bits/poll.h
@@ -15,8 +15,11 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_POLL_H
-# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#ifndef _BITS_POLL_H
+#define _BITS_POLL_H 1
+
+#ifndef _POLL_H
+# error "Never use <bits/poll.h> directly; include <poll.h> instead."
 #endif
 
 /* Event types that can be polled for.  These bits may be set in `events'
@@ -47,3 +50,5 @@
 #define POLLERR		0x008		/* Error condition.  */
 #define POLLHUP		0x010		/* Hung up.  */
 #define POLLNVAL	0x020		/* Invalid polling request.  */
+
+#endif /* bits/poll.h */
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/poll.h b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
index 8384efbbad..42873d11f7 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
@@ -15,8 +15,11 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_POLL_H
-# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#ifndef _BITS_POLL_H
+#define _BITS_POLL_H 1
+
+#ifndef _POLL_H
+# error "Never use <bits/poll.h> directly; include <poll.h> instead."
 #endif
 
 /* Event types that can be polled for.  These bits may be set in `events'
@@ -47,3 +50,5 @@
 #define POLLERR		0x008		/* Error condition.  */
 #define POLLHUP		0x010		/* Hung up.  */
 #define POLLNVAL	0x020		/* Invalid polling request.  */
+
+#endif /* bits/poll.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/poll.h b/sysdeps/unix/sysv/linux/mips/bits/poll.h
index 8384efbbad..42873d11f7 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/poll.h
@@ -15,8 +15,11 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_POLL_H
-# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#ifndef _BITS_POLL_H
+#define _BITS_POLL_H 1
+
+#ifndef _POLL_H
+# error "Never use <bits/poll.h> directly; include <poll.h> instead."
 #endif
 
 /* Event types that can be polled for.  These bits may be set in `events'
@@ -47,3 +50,5 @@
 #define POLLERR		0x008		/* Error condition.  */
 #define POLLHUP		0x010		/* Hung up.  */
 #define POLLNVAL	0x020		/* Invalid polling request.  */
+
+#endif /* bits/poll.h */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/poll.h b/sysdeps/unix/sysv/linux/sparc/bits/poll.h
index f83374dd2a..6b10f07b02 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/poll.h
@@ -15,8 +15,11 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_POLL_H
-# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#ifndef _BITS_POLL_H
+#define _BITS_POLL_H 1
+
+#ifndef _POLL_H
+# error "Never use <bits/poll.h> directly; include <poll.h> instead."
 #endif
 
 /* Event types that can be polled for.  These bits may be set in `events'
@@ -47,3 +50,5 @@
 #define POLLERR		0x008		/* Error condition.  */
 #define POLLHUP		0x010		/* Hung up.  */
 #define POLLNVAL	0x020		/* Invalid polling request.  */
+
+#endif /* bits/poll.h */