about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/bits/dirent.h4
-rw-r--r--sysdeps/unix/sysv/bits/stat.h11
-rw-r--r--sysdeps/unix/sysv/bits/utmp.h15
-rw-r--r--sysdeps/unix/sysv/bits/utsname.h22
-rw-r--r--sysdeps/unix/sysv/irix4/bits/confname.h4
-rw-r--r--sysdeps/unix/sysv/irix4/bits/stat.h11
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/ioctls.h11
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/ipc.h19
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/stat.h11
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/termios.h7
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/time.h39
-rw-r--r--sysdeps/unix/sysv/linux/bits/dirent.h7
-rw-r--r--sysdeps/unix/sysv/linux/bits/in.h7
-rw-r--r--sysdeps/unix/sysv/linux/bits/ioctl-types.h12
-rw-r--r--sysdeps/unix/sysv/linux/bits/ioctls.h13
-rw-r--r--sysdeps/unix/sysv/linux/bits/ipc.h20
-rw-r--r--sysdeps/unix/sysv/linux/bits/msq.h34
-rw-r--r--sysdeps/unix/sysv/linux/bits/poll.h3
-rw-r--r--sysdeps/unix/sysv/linux/bits/resource.h7
-rw-r--r--sysdeps/unix/sysv/linux/bits/sched.h22
-rw-r--r--sysdeps/unix/sysv/linux/bits/sem.h18
-rw-r--r--sysdeps/unix/sysv/linux/bits/shm.h78
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigcontext.h4
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h9
-rw-r--r--sysdeps/unix/sysv/linux/bits/stat.h11
-rw-r--r--sysdeps/unix/sysv/linux/bits/statfs.h11
-rw-r--r--sysdeps/unix/sysv/linux/bits/termios.h12
-rw-r--r--sysdeps/unix/sysv/linux/bits/time.h44
-rw-r--r--sysdeps/unix/sysv/linux/bits/uio.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/utsname.h6
-rw-r--r--sysdeps/unix/sysv/linux/bits/waitflags.h2
-rw-r--r--sysdeps/unix/sysv/linux/i386/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/kernel_termios.h3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/poll.h3
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/endian.h12
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h11
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ipc.h28
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/poll.h3
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/shm.h78
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigaction.h6
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/socket.h11
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/stat.h11
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/statfs.h11
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/termios.h136
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/time.h38
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/termios.h9
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/ioctls.h11
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/poll.h3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sigaction.h6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/termios.h17
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h8
-rw-r--r--sysdeps/unix/sysv/linux/stdio_lim.h.in33
-rw-r--r--sysdeps/unix/sysv/linux/sys/mman.h3
-rw-r--r--sysdeps/unix/sysv/minix/bits/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/sco3.2.4/bits/confname.h4
-rw-r--r--sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/sysv4/bits/sigaction.h4
-rw-r--r--sysdeps/unix/sysv/sysv4/bits/utsname.h22
-rw-r--r--sysdeps/unix/sysv/sysv4/bits/waitflags.h6
-rw-r--r--sysdeps/unix/sysv/sysv4/i386/bits/stat.h58
-rw-r--r--sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h22
-rw-r--r--sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h35
71 files changed, 566 insertions, 550 deletions
diff --git a/sysdeps/unix/sysv/bits/dirent.h b/sysdeps/unix/sysv/bits/dirent.h
index d10417d507..ca4b050296 100644
--- a/sysdeps/unix/sysv/bits/dirent.h
+++ b/sysdeps/unix/sysv/bits/dirent.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+
 struct dirent
   {
     unsigned short int d_fileno;
diff --git a/sysdeps/unix/sysv/bits/stat.h b/sysdeps/unix/sysv/bits/stat.h
index 56f4544594..8334feaa2e 100644
--- a/sysdeps/unix/sysv/bits/stat.h
+++ b/sysdeps/unix/sysv/bits/stat.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/stat.h> instead.
- */
-
-#ifndef	_BITS_STAT_H
-#define	_BITS_STAT_H	1
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 struct stat
   {
@@ -61,5 +58,3 @@ struct stat
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
-
-#endif	/* bits/stat.h */
diff --git a/sysdeps/unix/sysv/bits/utmp.h b/sysdeps/unix/sysv/bits/utmp.h
index 1bb1a55873..9304013d32 100644
--- a/sysdeps/unix/sysv/bits/utmp.h
+++ b/sysdeps/unix/sysv/bits/utmp.h
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _UTMP_H
-#error "Never use <bits/utmp.h> directly; include <utmp.h> instead."
+# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
 #endif
 
 
@@ -28,7 +28,6 @@
 #define _PATH_WTMP      "/var/adm/wtmp"
 #define _PATH_LASTLOG   "/var/adm/lastlog"
 
-__BEGIN_DECLS
 
 struct utmp
   {
@@ -36,14 +35,14 @@ struct utmp
     char ut_user[8];
     char ut_id[4];
     char ut_line[12];
-    short ut_pid;
-    short ut_type;
+    short int ut_pid;
+    short int ut_type;
     struct exit_status
       {
-	short e_termination;
-	short e_exit;
+	short int e_termination;
+	short int e_exit;
       } ut_exit;
-    time_t ut_time;
+    __time_t ut_time;
   };
 
 
@@ -53,5 +52,3 @@ struct utmp
 #define _HAVE_UT_ID	1
 #define _HAVE_UT_TV	1
 #define _HAVE_UT_HOST	1
-
-__END_DECLS
diff --git a/sysdeps/unix/sysv/bits/utsname.h b/sysdeps/unix/sysv/bits/utsname.h
index 31473cf4ea..fb11e4f029 100644
--- a/sysdeps/unix/sysv/bits/utsname.h
+++ b/sysdeps/unix/sysv/bits/utsname.h
@@ -1 +1,23 @@
+/* Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
 #define _UTSNAME_LENGTH 9
diff --git a/sysdeps/unix/sysv/irix4/bits/confname.h b/sysdeps/unix/sysv/irix4/bits/confname.h
index c185f22adf..89fca07fe5 100644
--- a/sysdeps/unix/sysv/irix4/bits/confname.h
+++ b/sysdeps/unix/sysv/irix4/bits/confname.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _UNISTD_H
+# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
+#endif
+
 /* Values for the NAME argument to `pathconf' and `fpathconf'.  */
 enum
   {
diff --git a/sysdeps/unix/sysv/irix4/bits/stat.h b/sysdeps/unix/sysv/irix4/bits/stat.h
index 0dab45cfa0..633f2618ec 100644
--- a/sysdeps/unix/sysv/irix4/bits/stat.h
+++ b/sysdeps/unix/sysv/irix4/bits/stat.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/stat.h> instead.
- */
-
-#ifndef	_BITS_STAT_H
-#define	_BITS_STAT_H	1
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 struct stat
   {
@@ -61,5 +58,3 @@ struct stat
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
-
-#endif	/* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h b/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h
index 8a14f99f43..dcbf9f4402 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/ioctl.h> instead.
- */
-
-#ifndef _BITS_IOCTLS_H
-#define _BITS_IOCTLS_H 1
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
 
 /* Use the definitions from the kernel header files.  */
 #include <asm/ioctls.h>
@@ -39,5 +36,3 @@
 #define TCSETSF	_IOW ('t', 22, struct __kernel_termios)
 
 #include <linux/sockios.h>
-
-#endif /* bits/ioctls.h  */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
index 57830daae1..ec116f6114 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,10 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SYS_IPC_BUF_H
-
-#define _SYS_IPC_BUF_H	1
-#include <features.h>
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
 
 #include <sys/types.h>
 
@@ -35,9 +33,6 @@
 #define IPC_STAT	2		/* Get `ipc_perm' options.  */
 #define IPC_INFO	3		/* See ipcs.  */
 
-
-__BEGIN_DECLS
-
 /* Special key values.  */
 #define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
 
@@ -63,10 +58,14 @@ struct ipc_kludge
     long int msgtyp;
   };
 
+__BEGIN_DECLS
+
 /* The actual system call: all functions are multiplexed by this.  */
 extern int __ipc __P ((int __call, int __first, int __second, int __third,
 		       void *__ptr));
 
+__END_DECLS
+
 /* The codes for the functions to use the multiplexer `__ipc'.  */
 #define IPCOP_semop	 1
 #define IPCOP_semget	 2
@@ -79,7 +78,3 @@ extern int __ipc __P ((int __call, int __first, int __second, int __third,
 #define IPCOP_shmdt	22
 #define IPCOP_shmget	23
 #define IPCOP_shmctl	24
-
-__END_DECLS
-
-#endif /* _SYS_IPC_BUF_H */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/mman.h b/sysdeps/unix/sysv/linux/alpha/bits/mman.h
index 1bef0cb525..081a00441e 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/mman.h
@@ -1,4 +1,4 @@
-/* Definitions for POSIX memory map inerface.  Linux/Alpha version.
+/* Definitions for POSIX memory map interface.  Linux/Alpha version.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MMAN_H
-# error "Never include this file directly.  Use <sys/mman.h> instead"
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
 #endif
 
 /* The following definitions basically come from the kernel headers.
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
index f28b6f256c..274531f270 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
index de8752ea8b..319ff96c51 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/stat.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/stat.h> instead.
- */
-
-#ifndef	_BITS_STAT_H
-#define	_BITS_STAT_H	1
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 /* Versions of the `struct stat' data structure.  */
 #define _STAT_VER_KERNEL	0
@@ -112,5 +109,3 @@ struct stat64
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
-
-#endif	/* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
index d0932c1cd7..0d57c489d9 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
@@ -17,8 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _TERMBITS_H
-#define _TERMBITS_H 1
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
 
 typedef unsigned char	cc_t;
 typedef unsigned int	speed_t;
@@ -189,5 +190,3 @@ struct termios
 
 #define _IOT_termios /* Hurd ioctl type field.  */ \
   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
-
-#endif /* _TERMBITS_H */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/time.h b/sysdeps/unix/sysv/linux/alpha/bits/time.h
index 7475b68f5b..d32f4d30e9 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/time.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/time.h
@@ -21,23 +21,9 @@
  * Never include this file directly; use <time.h> instead.
  */
 
-#ifdef __need_timeval
-# undef __need_timeval
-# ifndef _STRUCT_TIMEVAL
-#  define _STRUCT_TIMEVAL	1
-/* A time value that is accurate to the nearest
-   microsecond but also has a range of years.  */
-struct timeval
-  {
-    int tv_sec;			/* Seconds.  */
-    int tv_usec;		/* Microseconds.  */
-  };
-# endif	/* struct timeval */
-#endif	/* need timeval */
-
-
-#ifndef _BITS_TIME_H
-#define _BITS_TIME_H	1
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+#  define _BITS_TIME_H	1
 
 /* ISO/IEC 9899:1990 7.12.1: <time.h>
    The macro `CLOCKS_PER_SEC' is the number per second of the value
@@ -45,10 +31,23 @@ struct timeval
 /* CAE XSH, Issue 4, Version 2: <time.h>
    The value of CLOCKS_PER_SEC is required to be 1 million on all
    XSI-conformant systems. */
-# define CLOCKS_PER_SEC  1000000
+#  define CLOCKS_PER_SEC  1000000
 
 /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
    presents the real value for clock ticks per second for the system.  */
-# define CLK_TCK 1024
+#  define CLK_TCK 1024
 
-#endif	/* bits/time.h */
+# endif	/* bits/time.h */
+#endif /* !__need_timeval */
+
+
+#ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL	1
+/* A time value that is accurate to the nearest
+   microsecond but also has a range of years.  */
+struct timeval
+  {
+    int tv_sec;			/* Seconds.  */
+    int tv_usec;		/* Microseconds.  */
+  };
+#endif	/* struct timeval */
diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h
index 1f8ff1e3d0..30e0203289 100644
--- a/sysdeps/unix/sysv/linux/bits/dirent.h
+++ b/sysdeps/unix/sysv/linux/bits/dirent.h
@@ -16,8 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _BITS_DIRENT_H
-#define _BITS_DIRENT_H	1
+#ifndef _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
 
 struct dirent
   {
@@ -50,5 +51,3 @@ struct dirent64
 #define _DIRENT_HAVE_D_RECLEN
 #define _DIRENT_HAVE_D_OFF
 #define _DIRENT_HAVE_D_TYPE
-
-#endif /* bits/dirent.h */
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
index 0dd94bef96..1d3817f68d 100644
--- a/sysdeps/unix/sysv/linux/bits/in.h
+++ b/sysdeps/unix/sysv/linux/bits/in.h
@@ -18,8 +18,9 @@
 
 /* Linux version.  */
 
-#ifndef _NETINET_INBITS_H
-#define _NETINET_INBITS_H 1
+#ifndef _NETINET_IN_H
+# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
+#endif
 
 /* Options for use with `getsockopt' and `setsockopt' at the IP level.
    The first word in the comment at the right is the data type used;
@@ -71,5 +72,3 @@ struct ip_mreq
 #define IPV6_MULTICAST_LOOP	19
 #define IPV6_ADD_MEMBERSHIP	20
 #define IPV6_DROP_MEMBERSHIP	21
-
-#endif	/* netinet/inbits.h */
diff --git a/sysdeps/unix/sysv/linux/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/bits/ioctl-types.h
index af988a3c9d..4413dacdb4 100644
--- a/sysdeps/unix/sysv/linux/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/bits/ioctl-types.h
@@ -17,12 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/ioctl.h> instead.
- */
-
-#ifndef _BITS_IOCTL_TYPES_H
-#define _BITS_IOCTL_TYPES_H 1
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
 
 /* Get definition of constants for use with `ioctl'.  */
 #include <asm/ioctls.h>
@@ -69,6 +66,3 @@ struct termio
 #define N_PPP		3
 #define N_STRIP		4
 #define N_AX25		5
-
-
-#endif /* bits/ioctl-types.h */
diff --git a/sysdeps/unix/sysv/linux/bits/ioctls.h b/sysdeps/unix/sysv/linux/bits/ioctls.h
index 265c857f92..a89724cd71 100644
--- a/sysdeps/unix/sysv/linux/bits/ioctls.h
+++ b/sysdeps/unix/sysv/linux/bits/ioctls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 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
@@ -16,15 +16,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/ioctl.h> instead.
- */
-
-#ifndef _BITS_IOCTLS_H
-#define _BITS_IOCTLS_H 1
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
 
 /* Use the definitions from the kernel header files.  */
 #include <asm/ioctls.h>
 #include <linux/sockios.h>
-
-#endif /* bits/ioctls.h  */
diff --git a/sysdeps/unix/sysv/linux/bits/ipc.h b/sysdeps/unix/sysv/linux/bits/ipc.h
index c01a81a83f..8b5db4add6 100644
--- a/sysdeps/unix/sysv/linux/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/bits/ipc.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,10 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SYS_IPC_BUF_H
-
-#define _SYS_IPC_BUF_H	1
-#include <features.h>
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
 
 #include <sys/types.h>
 
@@ -35,9 +33,6 @@
 #define IPC_STAT	2		/* Get `ipc_perm' options.  */
 #define IPC_INFO	3		/* See ipcs.  */
 
-
-__BEGIN_DECLS
-
 /* Special key values.  */
 #define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
 
@@ -63,10 +58,15 @@ struct ipc_kludge
     long int msgtyp;
   };
 
+
+__BEGIN_DECLS
+
 /* The actual system call: all functions are multiplexed by this.  */
 extern int __ipc __P ((int __call, int __first, int __second, int __third,
 		       void *__ptr));
 
+__END_DECLS
+
 /* The codes for the functions to use the multiplexer `__ipc'.  */
 #define IPCOP_semop	 1
 #define IPCOP_semget	 2
@@ -79,7 +79,3 @@ extern int __ipc __P ((int __call, int __first, int __second, int __third,
 #define IPCOP_shmdt	22
 #define IPCOP_shmget	23
 #define IPCOP_shmctl	24
-
-__END_DECLS
-
-#endif /* bits/ipc_buf.h */
diff --git a/sysdeps/unix/sysv/linux/bits/msq.h b/sysdeps/unix/sysv/linux/bits/msq.h
index 59559a31c3..9d0b9a9afa 100644
--- a/sysdeps/unix/sysv/linux/bits/msq.h
+++ b/sysdeps/unix/sysv/linux/bits/msq.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,10 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SYS_MSQ_BUF_H
-
-#define _SYS_MSQ_BUF_H	1
-#include <features.h>
+#ifndef _SYS_MSG_H
+#error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
 
 #include <sys/types.h>
 
@@ -29,8 +27,6 @@
 #define MSG_EXCEPT	020000	/* recv any msg except of specified type */
 
 
-__BEGIN_DECLS
-
 /* Structure of record for one message inside the kernel.
    The type `struct __msg' is opaque.  */
 struct msqid_ds
@@ -60,19 +56,15 @@ struct msqid_ds
 
 /* buffer for msgctl calls IPC_INFO, MSG_INFO */
 struct msginfo
-{
-  int msgpool;
-  int msgmap;
-  int msgmax;
-  int msgmnb;
-  int msgmni;
-  int msgssz;
-  int msgtql;
-  ushort  msgseg;
-};
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    ushort  msgseg;
+  };
 
 #endif /* __USE_MISC */
-
-__END_DECLS
-
-#endif /* bits/msq_buf.h */
diff --git a/sysdeps/unix/sysv/linux/bits/poll.h b/sysdeps/unix/sysv/linux/bits/poll.h
index c6b1d2324a..4aec021fed 100644
--- a/sysdeps/unix/sysv/linux/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/bits/poll.h
@@ -16,6 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
 
 /* Event types that can be polled for.  These bits may be set in `events'
    to indicate the interesting event types; they will appear in `revents'
diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h
index 9ee6ea5b27..f825cba929 100644
--- a/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/bits/resource.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
 #include <asm/resource.h>
 #include <bits/types.h>
 
@@ -148,7 +152,8 @@ enum __rusage_who
 #define RUSAGE_BOTH RUSAGE_BOTH
 };
 
-#include <sys/time.h>		/* For `struct timeval'.  */
+#define __need_timeval
+#include <bits/time.h>		/* For `struct timeval'.  */
 
 /* Structure which says how much of each resource has been used.  */
 struct rusage
diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h
index 521bbb7177..0ac5409172 100644
--- a/sysdeps/unix/sysv/linux/bits/sched.h
+++ b/sysdeps/unix/sysv/linux/bits/sched.h
@@ -19,12 +19,10 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SCHED_H
-#error "Never use <bits/sched.h> directly; include <sched.h> instead."
+# error "Never include <bits/sched.h> directly; use <sched.h> instead."
 #endif
 
 
-#include <features.h>
-
 /* Scheduling algorithms.  */
 #define SCHED_OTHER	0
 #define SCHED_FIFO	1
@@ -36,15 +34,19 @@ struct sched_param
     int sched_priority;
   };
 
+#ifdef __USE_MISC
 /* Cloning flags.  */
-#define	CSIGNAL	      0x000000ff  /* Signal mask to be sent at exit.  */
-#define	CLONE_VM      0x00000100  /* Set if VM shared between processes.  */
-#define	CLONE_FS      0x00000200  /* Set if fs info shared between processes.*/
-#define CLONE_FILES   0x00000400  /* Set if open files shared between processes*/
-#define CLONE_SIGHAND 0x00000800  /* Set if signal handlers shared.  */
-#define CLONE_PID     0x00001000  /* Set if pid shared.  */
+# define CSIGNAL       0x000000ff /* Signal mask to be sent at exit.  */
+# define CLONE_VM      0x00000100 /* Set if VM shared between processes.  */
+# define CLONE_FS      0x00000200 /* Set if fs info shared between processes.*/
+# define CLONE_FILES   0x00000400 /* Set if open files shared between processes*/
+# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared.  */
+# define CLONE_PID     0x00001000 /* Set if pid shared.  */
+#endif
 
 
+__BEGIN_DECLS
+
 /* Clone current process.  */
 extern int __clone __P ((int (*__fn) (void *__arg), void *__child_stack,
 			 int __flags, void *__arg));
@@ -52,3 +54,5 @@ extern int __clone __P ((int (*__fn) (void *__arg), void *__child_stack,
 extern int clone __P ((int (*__fn) (void *__arg), void *__child_stack,
 		       int __flags, void *__arg));
 #endif
+
+__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h
index 87951efea1..f3bbd89a12 100644
--- a/sysdeps/unix/sysv/linux/bits/sem.h
+++ b/sysdeps/unix/sysv/linux/bits/sem.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,10 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SYS_SEM_BUF_H
-
-#define _SYS_SEM_BUF_H	1
-#include <features.h>
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
 
 #include <sys/types.h>
 
@@ -37,8 +35,6 @@
 #define SETALL		17		/* set all semval's */
 
 
-__BEGIN_DECLS
-
 /* Data structure describing a set of semaphores.  */
 struct semid_ds
 {
@@ -64,8 +60,8 @@ union semun
 #ifdef __USE_MISC
 
 /* ipcs ctl cmds */
-#define SEM_STAT 18
-#define SEM_INFO 19
+# define SEM_STAT 18
+# define SEM_INFO 19
 
 struct  seminfo
 {
@@ -82,7 +78,3 @@ struct  seminfo
 };
 
 #endif /* __USE_MISC */
-
-__END_DECLS
-
-#endif /* bits/sem_buf.h */
diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h
index 6db01dd4a2..6f5f840909 100644
--- a/sysdeps/unix/sysv/linux/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/bits/shm.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,10 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SYS_SHM_BUF_H
-
-#define _SYS_SHM_BUF_H	1
-#include <features.h>
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
 
 #include <sys/types.h>
 
@@ -38,55 +36,49 @@
 #define SHM_UNLOCK	12		/* unlock segment (root only) */
 
 
-__BEGIN_DECLS
-
 /* Data structure describing a set of semaphores.  */
 struct shmid_ds
-{
-  struct ipc_perm shm_perm;		/* operation permission struct */
-  int shm_segsz;			/* size of segment in bytes */
-  __time_t shm_atime;			/* time of last shmat() */
-  __time_t shm_dtime;			/* time of last shmdt() */
-  __time_t shm_ctime;			/* time of last change by shmctl() */
-  int shm_cpid;				/* pid of creator */
-  int shm_lpid;				/* pid of last shmop */
-  unsigned short int shm_nattch;	/* number of current attaches */
-  unsigned short int __shm_npages;	/* size of segment (pages) */
-  unsigned long int *__shm_pages;	/* array of ptrs to frames -> SHMMAX */
-  struct vm_area_struct *__attaches;	/* descriptors for attaches */
-};
+  {
+    struct ipc_perm shm_perm;		/* operation permission struct */
+    int shm_segsz;			/* size of segment in bytes */
+    __time_t shm_atime;			/* time of last shmat() */
+    __time_t shm_dtime;			/* time of last shmdt() */
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    int shm_cpid;			/* pid of creator */
+    int shm_lpid;			/* pid of last shmop */
+    unsigned short int shm_nattch;	/* number of current attaches */
+    unsigned short int __shm_npages;	/* size of segment (pages) */
+    unsigned long int *__shm_pages;	/* array of ptrs to frames -> SHMMAX */
+    struct vm_area_struct *__attaches;	/* descriptors for attaches */
+  };
 
 #ifdef __USE_MISC
 
 /* ipcs ctl commands */
-#define SHM_STAT 	13
-#define SHM_INFO 	14
+# define SHM_STAT 	13
+# define SHM_INFO 	14
 
 /* shm_mode upper byte flags */
-#define	SHM_DEST	01000	/* segment will be destroyed on last detach */
-#define SHM_LOCKED      02000   /* segment will not be swapped */
+# define SHM_DEST	01000	/* segment will be destroyed on last detach */
+# define SHM_LOCKED	02000   /* segment will not be swapped */
 
 struct	shminfo
-{
-  int shmmax;
-  int shmmin;
-  int shmmni;
-  int shmseg;
-  int shmall;
-};
+  {
+    int shmmax;
+    int shmmin;
+    int shmmni;
+    int shmseg;
+    int shmall;
+  };
 
 struct shm_info
-{
-  int   used_ids;
-  ulong shm_tot;	/* total allocated shm */
-  ulong shm_rss;	/* total resident shm */
-  ulong shm_swp;	/* total swapped shm */
-  ulong swap_attempts;
-  ulong swap_successes;
-};
+  {
+    int   used_ids;
+    ulong shm_tot;	/* total allocated shm */
+    ulong shm_rss;	/* total resident shm */
+    ulong shm_swp;	/* total swapped shm */
+    ulong swap_attempts;
+    ulong swap_successes;
+  };
 
 #endif /* __USE_MISC */
-
-__END_DECLS
-
-#endif /* bits/shm_buf.h */
diff --git a/sysdeps/unix/sysv/linux/bits/sigaction.h b/sysdeps/unix/sysv/linux/bits/sigaction.h
index 247b53499e..1806bb2e92 100644
--- a/sysdeps/unix/sysv/linux/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/bits/sigaction.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
diff --git a/sysdeps/unix/sysv/linux/bits/sigcontext.h b/sysdeps/unix/sysv/linux/bits/sigcontext.h
index fb8bc5fc57..08960b6824 100644
--- a/sysdeps/unix/sysv/linux/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 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
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SIGNAL_H
-#error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
 #endif
 
 
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 8f859d2e3e..f48f2d1403 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -18,20 +18,15 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_SOCKET_H
-#error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
 #endif
 
-
-#include <features.h>
-
 #define	__need_size_t
 #define __need_NULL
 #include <stddef.h>
 
 #include <sys/types.h>
 
-__BEGIN_DECLS
-
 /* Type for length arguments in socket calls.  */
 typedef unsigned int socklen_t;
 
@@ -216,5 +211,3 @@ struct linger
     int l_onoff;		/* Nonzero to linger on close.  */
     int l_linger;		/* Time to linger.  */
   };
-
-__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h
index 1b98448ff4..18432fd09e 100644
--- a/sysdeps/unix/sysv/linux/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/bits/stat.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/stat.h> instead.
- */
-
-#ifndef	_BITS_STAT_H
-#define	_BITS_STAT_H	1
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 /* Versions of the `struct stat' data structure.  */
 #define _STAT_VER_LINUX_OLD	1
@@ -126,5 +123,3 @@ struct stat64
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
-
-#endif	/* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/bits/statfs.h b/sysdeps/unix/sysv/linux/bits/statfs.h
index c79c80e84c..a56ed79e7c 100644
--- a/sysdeps/unix/sysv/linux/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/bits/statfs.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/statfs.h> instead.
- */
-
-#ifndef _BITS_STATFS_H
-#define _BITS_STATFS_H
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
 
 #include <bits/types.h>  /* for __fsid_t and __fsblkcnt_t*/
 
@@ -62,5 +59,3 @@ struct statfs64
     int f_spare[6];
   };
 #endif
-
-#endif	/* bits/statfs.h */
diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h
index dd42012374..926c3f32f4 100644
--- a/sysdeps/unix/sysv/linux/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/bits/termios.h
@@ -17,13 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <termios.h> instead.
- */
-
-
-#ifndef _BITS_TERMIOS_H
-#define _BITS_TERMIOS_H	1
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
 
 typedef unsigned char	cc_t;
 typedef unsigned int	speed_t;
@@ -185,5 +181,3 @@ struct termios
 
 #define _IOT_termios /* Hurd ioctl type field.  */ \
   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
-
-#endif /* bits/termios.h */
diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h
index 509cb2ce32..3c1b27a1bb 100644
--- a/sysdeps/unix/sysv/linux/bits/time.h
+++ b/sysdeps/unix/sysv/linux/bits/time.h
@@ -21,23 +21,9 @@
  * Never include this file directly; use <time.h> instead.
  */
 
-#ifdef __need_timeval
-# undef __need_timeval
-# ifndef _STRUCT_TIMEVAL
-#  define _STRUCT_TIMEVAL	1
-/* A time value that is accurate to the nearest
-   microsecond but also has a range of years.  */
-struct timeval
-  {
-    time_t tv_sec;		/* Seconds.  */
-    time_t tv_usec;		/* Microseconds.  */
-  };
-# endif	/* struct timeval */
-#endif	/* need timeval */
-
-
-#ifndef _BITS_TIME_H
-#define _BITS_TIME_H	1
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+#  define _BITS_TIME_H	1
 
 /* ISO/IEC 9899:1990 7.12.1: <time.h>
    The macro `CLOCKS_PER_SEC' is the number per second of the value
@@ -45,12 +31,26 @@ struct timeval
 /* CAE XSH, Issue 4, Version 2: <time.h>
    The value of CLOCKS_PER_SEC is required to be 1 million on all
    XSI-conformant systems. */
-# define CLOCKS_PER_SEC  1000000
+#  define CLOCKS_PER_SEC  1000000
 
-# ifndef __STRICT_ANSI__
+#  ifndef __STRICT_ANSI__
 /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
    presents the real value for clock ticks per second for the system.  */
-#  define CLK_TCK 100
-# endif
+#   define CLK_TCK 100
+#  endif
 
-#endif	/* bits/time.h */
+# endif	/* bits/time.h */
+#endif
+
+#ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL	1
+# include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+   microsecond but also has a range of years.  */
+struct timeval
+  {
+    __time_t tv_sec;		/* Seconds.  */
+    __time_t tv_usec;		/* Microseconds.  */
+  };
+#endif	/* struct timeval */
diff --git a/sysdeps/unix/sysv/linux/bits/uio.h b/sysdeps/unix/sysv/linux/bits/uio.h
index 3f1dc01c73..38ac17baa9 100644
--- a/sysdeps/unix/sysv/linux/bits/uio.h
+++ b/sysdeps/unix/sysv/linux/bits/uio.h
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_UIO_H
-#error "Never use <bits/uio.h> directly; include <sys/uio.h> instead."
+# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
 #endif
 
 
diff --git a/sysdeps/unix/sysv/linux/bits/utsname.h b/sysdeps/unix/sysv/linux/bits/utsname.h
index 64e2ab5bbc..8f4bf16f5a 100644
--- a/sysdeps/unix/sysv/linux/bits/utsname.h
+++ b/sysdeps/unix/sysv/linux/bits/utsname.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997 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
@@ -16,6 +16,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SYS_UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
 /* Length of the entries in `struct utsname' is 65.  */
 #define _UTSNAME_LENGTH 65
 
diff --git a/sysdeps/unix/sysv/linux/bits/waitflags.h b/sysdeps/unix/sysv/linux/bits/waitflags.h
index ba3528b709..e5945051ed 100644
--- a/sysdeps/unix/sysv/linux/bits/waitflags.h
+++ b/sysdeps/unix/sysv/linux/bits/waitflags.h
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_WAIT_H
-#error "Never use <bits/waitflags.h> directly; include <sys/wait.h> instead."
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
 #endif
 
 
diff --git a/sysdeps/unix/sysv/linux/i386/bits/mman.h b/sysdeps/unix/sysv/linux/i386/bits/mman.h
index e70b220f9f..8738e98c30 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/mman.h
@@ -1,4 +1,4 @@
-/* Definitions for POSIX memory map inerface.  Linux/i386 version.
+/* Definitions for POSIX memory map interface.  Linux/i386 version.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MMAN_H
-# error "Never include this file directly.  Use <sys/mman.h> instead"
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
 #endif
 
 /* The following definitions basically come from the kernel headers.
diff --git a/sysdeps/unix/sysv/linux/kernel_termios.h b/sysdeps/unix/sysv/linux/kernel_termios.h
index 78c6f4aa2f..09504cc97e 100644
--- a/sysdeps/unix/sysv/linux/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/kernel_termios.h
@@ -20,9 +20,6 @@
 #define _KERNEL_TERMIOS_H 1
 /* The following corresponds to the values from the Linux 2.1.20 kernel.  */
 
-/* We need the definition of tcflag_t, cc_t, and speed_t.  */
-#include <bits/termios.h>
-
 #define __KERNEL_NCCS 19
 
 struct __kernel_termios
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/sysdeps/unix/sysv/linux/m68k/bits/mman.h
index d6c29d2176..bca1dae960 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/mman.h
@@ -1,4 +1,4 @@
-/* Definitions for POSIX memory map inerface.  Linux/m68k version.
+/* Definitions for POSIX memory map interface.  Linux/m68k version.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MMAN_H
-# error "Never include this file directly.  Use <sys/mman.h> instead"
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
 #endif
 
 /* The following definitions basically come from the kernel headers.
diff --git a/sysdeps/unix/sysv/linux/m68k/bits/poll.h b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
index 8fea43924a..2d4e6f6f01 100644
--- a/sysdeps/unix/sysv/linux/m68k/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
@@ -16,6 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
 
 /* Event types that can be polled for.  These bits may be set in `events'
    to indicate the interesting event types; they will appear in `revents'
diff --git a/sysdeps/unix/sysv/linux/mips/bits/endian.h b/sysdeps/unix/sysv/linux/mips/bits/endian.h
index 9f60758f36..0a3d2fabe3 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/endian.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/endian.h
@@ -3,10 +3,14 @@
    want to be able to share the installed headerfiles between both,
    so we define __BYTE_ORDER based on GCC's predefines.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #ifdef __MIPSEB__
-#define __BYTE_ORDER __BIG_ENDIAN
+# define __BYTE_ORDER __BIG_ENDIAN
 #else
-#ifdef __MIPSEL__
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
+# ifdef __MIPSEL__
+#  define __BYTE_ORDER __LITTLE_ENDIAN
+# endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
index 486022e6d9..4f5c2b0d3e 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
@@ -17,12 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/ioctl.h> instead.
- */
-
-#ifndef _BITS_IOCTL_TYPES_H
-#define _BITS_IOCTL_TYPES_H 1
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
 
 /* Get definition of constants for use with `ioctl'.  */
 #include <asm/ioctls.h>
@@ -67,5 +64,3 @@ struct termio
 #define N_PPP		3
 #define N_STRIP		4
 #define N_AX25		5
-
-#endif /* bits/ioctl-types.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/ipc.h b/sysdeps/unix/sysv/linux/mips/bits/ipc.h
index c5a3cd0049..2841e6a5e2 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/ipc.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,10 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SYS_IPC_BUF_H
-
-#define _SYS_IPC_BUF_H	1
-#include <features.h>
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
 
 #include <sys/types.h>
 
@@ -36,8 +34,6 @@
 #define IPC_INFO	3		/* See ipcs.  */
 
 
-__BEGIN_DECLS
-
 /* Special key values.  */
 #define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
 
@@ -46,11 +42,11 @@ __BEGIN_DECLS
 struct ipc_perm
   {
     __key_t __key;			/* Key.  */
-    long uid;				/* Owner's user ID.  */
-    long gid;				/* Owner's group ID.  */
-    long cuid;				/* Creator's user ID.  */
-    long cgid;				/* Creator's group ID.  */
-    unsigned long mode;			/* Read/write permission.  */
+    long int uid;			/* Owner's user ID.  */
+    long int gid;			/* Owner's group ID.  */
+    long int cuid;			/* Creator's user ID.  */
+    long int cgid;			/* Creator's group ID.  */
+    unsigned long int mode;		/* Read/write permission.  */
     unsigned short int __seq;		/* Sequence number.  */
   };
 
@@ -63,10 +59,14 @@ struct ipc_kludge
     long int msgtyp;
   };
 
+__BEGIN_DECLS
+
 /* The actual system call: all functions are multiplexed by this.  */
 extern int __ipc __P ((int __call, int __first, int __second, int __third,
 		       void *__ptr));
 
+__END_DECLS
+
 /* The codes for the functions to use the multiplexer `__ipc'.  */
 #define IPCOP_semop	 1
 #define IPCOP_semget	 2
@@ -79,7 +79,3 @@ extern int __ipc __P ((int __call, int __first, int __second, int __third,
 #define IPCOP_shmdt	22
 #define IPCOP_shmget	23
 #define IPCOP_shmctl	24
-
-__END_DECLS
-
-#endif /* bits/ipc_buf.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/mman.h b/sysdeps/unix/sysv/linux/mips/bits/mman.h
index 15a343ff76..be460ab6c6 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/mman.h
@@ -1,4 +1,4 @@
-/* Definitions for POSIX memory map inerface.  Linux/PowerPC version.
+/* Definitions for POSIX memory map interface.  Linux/PowerPC version.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MMAN_H
-# error "Never include this file directly.  Use <sys/mman.h> instead"
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
 #endif
 
 /* The following definitions basically come from the kernel headers.
diff --git a/sysdeps/unix/sysv/linux/mips/bits/poll.h b/sysdeps/unix/sysv/linux/mips/bits/poll.h
index c1c9a6b392..9b7826af6c 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/poll.h
@@ -16,6 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
 
 /* Event types that can be polled for.  These bits may be set in `events'
    to indicate the interesting event types; they will appear in `revents'
diff --git a/sysdeps/unix/sysv/linux/mips/bits/shm.h b/sysdeps/unix/sysv/linux/mips/bits/shm.h
index 9d4b20bb53..20e75e009b 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/shm.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,10 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SYS_SHM_BUF_H
-
-#define _SYS_SHM_BUF_H	1
-#include <features.h>
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
 
 #include <sys/types.h>
 
@@ -38,55 +36,49 @@
 #define SHM_UNLOCK	12		/* unlock segment (root only) */
 
 
-__BEGIN_DECLS
-
 /* Data structure describing a set of semaphores.  */
 struct shmid_ds
-{
-  struct ipc_perm shm_perm;		/* operation permission struct */
-  int shm_segsz;			/* size of segment in bytes */
-  __time_t shm_atime;			/* time of last shmat() */
-  __time_t shm_dtime;			/* time of last shmdt() */
-  __time_t shm_ctime;			/* time of last change by shmctl() */
-  long shm_cpid;			/* pid of creator */
-  long shm_lpid;			/* pid of last shmop */
-  unsigned short int shm_nattch;	/* number of current attaches */
-  unsigned short int __shm_npages;	/* size of segment (pages) */
-  unsigned long int *__shm_pages;	/* array of ptrs to frames -> SHMMAX */
-  struct vm_area_struct *__attaches;	/* descriptors for attaches */
-};
+  {
+    struct ipc_perm shm_perm;		/* operation permission struct */
+    int shm_segsz;			/* size of segment in bytes */
+    __time_t shm_atime;			/* time of last shmat() */
+    __time_t shm_dtime;			/* time of last shmdt() */
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    long int shm_cpid;			/* pid of creator */
+    long int shm_lpid;			/* pid of last shmop */
+    unsigned short int shm_nattch;	/* number of current attaches */
+    unsigned short int __shm_npages;	/* size of segment (pages) */
+    unsigned long int *__shm_pages;	/* array of ptrs to frames -> SHMMAX */
+    struct vm_area_struct *__attaches;	/* descriptors for attaches */
+  };
 
 #ifdef __USE_MISC
 
 /* ipcs ctl commands */
-#define SHM_STAT 	13
-#define SHM_INFO 	14
+# define SHM_STAT 	13
+# define SHM_INFO 	14
 
 /* shm_mode upper byte flags */
-#define	SHM_DEST	01000	/* segment will be destroyed on last detach */
-#define SHM_LOCKED      02000   /* segment will not be swapped */
+# define SHM_DEST	01000	/* segment will be destroyed on last detach */
+# define SHM_LOCKED	02000   /* segment will not be swapped */
 
 struct	shminfo
-{
-  int shmmax;
-  int shmmin;
-  int shmmni;
-  int shmseg;
-  int shmall;
-};
+  {
+    int shmmax;
+    int shmmin;
+    int shmmni;
+    int shmseg;
+    int shmall;
+  };
 
 struct shm_info
-{
-  int   used_ids;
-  ulong shm_tot;	/* total allocated shm */
-  ulong shm_rss;	/* total resident shm */
-  ulong shm_swp;	/* total swapped shm */
-  ulong swap_attempts;
-  ulong swap_successes;
-};
+  {
+    int   used_ids;
+    ulong shm_tot;	/* total allocated shm */
+    ulong shm_rss;	/* total resident shm */
+    ulong shm_swp;	/* total swapped shm */
+    ulong swap_attempts;
+    ulong swap_successes;
+  };
 
 #endif /* __USE_MISC */
-
-__END_DECLS
-
-#endif /* bits/shm_buf.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
index d6f70f2a2e..71ca8846eb 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
@@ -33,7 +37,7 @@ struct sigaction
     /* Restore handler.  */
     void (*sa_restorer) __P ((void));
 
-#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2)
+#if _MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2
     int sa_resv[1];
 #endif
   };
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index 02f1d22a6c..f56f6269db 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -17,19 +17,14 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SYS_SOCKET_H
-#error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#ifndef _SYS_STAT_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
 #endif
 
-
-#include <features.h>
-
 #define	__need_size_t
 #define __need_NULL
 #include <stddef.h>
 
-__BEGIN_DECLS
-
 /* Type for length arguments in socket calls.  */
 typedef unsigned int socklen_t;
 
@@ -173,5 +168,3 @@ struct linger
     int l_onoff;		/* Nonzero to linger on close.  */
     int l_linger;		/* Time to linger.  */
   };
-
-__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h
index f27a75eb9a..cd586d4433 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/stat.h> instead.
- */
-
-#ifndef _BITS_STAT_H
-#define _BITS_STAT_H	1
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 /* Versions of the `struct stat' data structure.  */
 #define _STAT_VER_LINUX_OLD	1
@@ -140,5 +137,3 @@ struct stat64
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
-
-#endif	/* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/statfs.h b/sysdeps/unix/sysv/linux/mips/bits/statfs.h
index 2727b27257..36d9996a69 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/statfs.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/statfs.h> instead.
- */
-
-#ifndef _BITS_STATFS_H
-#define _BITS_STATFS_H
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
 
 #include <bits/types.h>  /* for __fsid_t and __fsblkcnt_t*/
 
@@ -70,5 +67,3 @@ struct statfs64
     long int f_spare[6];
   };
 #endif
-
-#endif	/* bits/statfs.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h
index c8a24694d9..de21ee1775 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h
@@ -17,20 +17,16 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <termios.h> instead.
- */
-
-
-#ifndef _BITS_TERMIOS_H
-#define _BITS_TERMIOS_H 1
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
 
 typedef unsigned char	cc_t;
 typedef unsigned int	speed_t;
 typedef unsigned int	tcflag_t;
 
 
-#if defined __USE_BSD
+#ifdef __USE_BSD
 
 struct sgttyb
   {
@@ -83,10 +79,10 @@ struct termios
 #define VKILL		 3		/* Kill-line character [ICANON].  */
 #define VMIN		 4		/* Minimum number of bytes read at once [!ICANON].  */
 #define VTIME		 5		/* Time-out value (tenths of a second) [!ICANON].  */
-#if defined (__USE_BSD)
-#define VEOL2		 6		/* Second EOL character [ICANON].  */
+#ifdef __USE_BSD
+# define VEOL2		 6		/* Second EOL character [ICANON].  */
 /* The next two are guesses ... */
-#define VSWTC		 7		/* ??? */
+# define VSWTC		 7		/* ??? */
 #endif
 #define VSWTCH		VSWTC
 #define VSTART		 8		/* Start (X-ON) character [IXON, IXOFF].  */
@@ -96,17 +92,17 @@ struct termios
 /*
  * VDSUSP is not supported
  */
-#if defined (__USE_BSD)
+#if defined __USE_BSD
 #define VDSUSP		11		/* Delayed suspend character [ISIG].  */
 #endif
 #endif
-#if defined (__USE_BSD)
-#define VREPRINT	12		/* Reprint-line character [ICANON].  */
+#ifdef __USE_BSD
+# define VREPRINT	12		/* Reprint-line character [ICANON].  */
 #endif
-#if defined (__USE_BSD)
-#define VDISCARD	13		/* Discard character [IEXTEN].  */
-#define VWERASE		14		/* Word-erase character [ICANON].  */
-#define VLNEXT		15		/* Literal-next character [IEXTEN].  */
+#ifdef __USE_BSD
+# define VDISCARD	13		/* Discard character [IEXTEN].  */
+# define VWERASE	14		/* Word-erase character [ICANON].  */
+# define VLNEXT		15		/* Literal-next character [IEXTEN].  */
 #endif
 #define VEOF		16		/* End-of-file character [ICANON].  */
 #define VEOL		17		/* End-of-line character [ICANON].  */
@@ -121,51 +117,51 @@ struct termios
 #define INLCR	0000100		/* Map NL to CR on input.  */
 #define IGNCR	0000200		/* Ignore CR.  */
 #define ICRNL	0000400		/* Map CR to NL on input.  */
-#if defined (__USE_BSD)
-#define IUCLC	0001000		/* Map upper case to lower case on input.  */
+#ifdef __USE_BSD
+# define IUCLC	0001000		/* Map upper case to lower case on input.  */
 #endif
 #define IXON	0002000		/* Enable start/stop output control.  */
-#if defined (__USE_BSD)
-#define IXANY	0004000		/* Any character will restart after stop.  */
+#ifdef __USE_BSD
+# define IXANY	0004000		/* Any character will restart after stop.  */
 #endif
 #define IXOFF	0010000		/* Enable start/stop input control.  */
-#if defined (__USE_BSD)
-#define IMAXBEL	0020000		/* Ring bell when input queue is full.  */
+#ifdef __USE_BSD
+# define IMAXBEL 0020000	/* Ring bell when input queue is full.  */
 #endif
 
 /* c_oflag bits */
 #define OPOST	0000001		/* Perform output processing.  */
-#if defined (__USE_BSD)
-#define OLCUC	0000002		/* Map lower case to upper case on output.  */
-#define ONLCR	0000004		/* Map NL to CR-NL on output.  */
-#define OCRNL	0000010
-#define ONOCR	0000020
-#define ONLRET	0000040
-#define OFILL	0000100
-#define OFDEL	0000200
-#define NLDLY	0000400
-#define   NL0	0000000
-#define   NL1	0000400
-#define CRDLY	0003000
-#define   CR0	0000000
-#define   CR1	0001000
-#define   CR2	0002000
-#define   CR3	0003000
-#define TABDLY	0014000
-#define   TAB0	0000000
-#define   TAB1	0004000
-#define   TAB2	0010000
-#define   TAB3	0014000
-#define   XTABS	0014000
-#define BSDLY	0020000
-#define   BS0	0000000
-#define   BS1	0020000
-#define VTDLY	0040000
-#define   VT0	0000000
-#define   VT1	0040000
-#define FFDLY	0100000
-#define   FF0	0000000
-#define   FF1	0100000
+#ifdef __USE_BSD
+# define OLCUC	0000002		/* Map lower case to upper case on output.  */
+# define ONLCR	0000004		/* Map NL to CR-NL on output.  */
+# define OCRNL	0000010
+# define ONOCR	0000020
+# define ONLRET	0000040
+# define OFILL	0000100
+# define OFDEL	0000200
+# define NLDLY	0000400
+# define   NL0	0000000
+# define   NL1	0000400
+# define CRDLY	0003000
+# define   CR0	0000000
+# define   CR1	0001000
+# define   CR2	0002000
+# define   CR3	0003000
+# define TABDLY	0014000
+# define   TAB0	0000000
+# define   TAB1	0004000
+# define   TAB2	0010000
+# define   TAB3	0014000
+# define  XTABS	0014000
+# define BSDLY	0020000
+# define   BS0	0000000
+# define   BS1	0020000
+# define VTDLY	0040000
+# define   VT0	0000000
+# define   VT1	0040000
+# define FFDLY	0100000
+# define   FF0	0000000
+# define   FF1	0100000
 /*
 #define PAGEOUT ???
 #define WRAP    ???
@@ -203,14 +199,14 @@ struct termios
 #define PARODD	0001000		/* Odd parity instead of even.  */
 #define HUPCL	0002000		/* Hang up on last close.  */
 #define CLOCAL	0004000		/* Ignore modem status lines.  */
-#if defined (__USE_BSD)
-#define CBAUDEX 0010000
-#define  B57600  0010001
-#define  B115200 0010002
-#define  B230400 0010003
-#define  B460800 0010004
-#define CIBAUD	  002003600000	/* input baud rate (not used) */
-#define CRTSCTS	  020000000000		/* flow control */
+#ifdef __USE_BSD
+# define CBAUDEX  0010000
+# define  B57600  0010001
+# define  B115200 0010002
+# define  B230400 0010003
+# define  B460800 0010004
+# define CIBAUD	  002003600000	/* input baud rate (not used) */
+# define CRTSCTS  020000000000		/* flow control */
 #endif
 
 /* c_lflag bits */
@@ -223,14 +219,14 @@ struct termios
 #define ECHONL	0000100		/* Echo NL even if ECHO is off.  */
 #define NOFLSH	0000200		/* Disable flush after interrupt.  */
 #define IEXTEN	0000400		/* Enable DISCARD and LNEXT.  */
-#if defined (__USE_BSD)
-#define ECHOCTL	0001000		/* Echo control characters as ^X.  */
-#define ECHOPRT	0002000		/* Hardcopy visual erase.  */
-#define ECHOKE	0004000		/* Visual erase for KILL.  */
+#ifdef __USE_BSD
+# define ECHOCTL 0001000	/* Echo control characters as ^X.  */
+# define ECHOPRT 0002000	/* Hardcopy visual erase.  */
+# define ECHOKE	 0004000	/* Visual erase for KILL.  */
 #endif
 #define FLUSHO	0020000
-#if defined (__USE_BSD)
-#define PENDIN	0040000		/* Retype pending input (state).  */
+#ifdef __USE_BSD
+# define PENDIN	0040000		/* Retype pending input (state).  */
 #endif
 #define TOSTOP	0100000		/* Send SIGTTOU for background output.  */
 #define ITOSTOP	TOSTOP
@@ -256,5 +252,3 @@ struct termios
 
 #define _IOT_termios /* Hurd ioctl type field.  */ \
   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
-
-#endif /* bits/termios.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/time.h b/sysdeps/unix/sysv/linux/mips/bits/time.h
index 5fcef0fb8c..a7b268d0f8 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/time.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/time.h
@@ -21,23 +21,9 @@
  * Never include this file directly; use <time.h> instead.
  */
 
-#ifdef __need_timeval
-# undef __need_timeval
-# ifndef _STRUCT_TIMEVAL
-#  define _STRUCT_TIMEVAL	1
-/* A time value that is accurate to the nearest
-   microsecond but also has a range of years.  */
-struct timeval
-  {
-    long tv_sec;			/* Seconds.  */
-    long tv_usec;		/* Microseconds.  */
-  };
-# endif	/* struct timeval */
-#endif	/* need timeval */
-
-
-#ifndef _BITS_TIME_H
-#define _BITS_TIME_H	1
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+#  define _BITS_TIME_H	1
 
 /* ISO/IEC 9899:1990 7.12.1: <time.h>
    The macro `CLOCKS_PER_SEC' is the number per second of the value
@@ -45,10 +31,22 @@ struct timeval
 /* CAE XSH, Issue 4, Version 2: <time.h>
    The value of CLOCKS_PER_SEC is required to be 1 million on all
    XSI-conformant systems. */
-# define CLOCKS_PER_SEC  1000000
+#  define CLOCKS_PER_SEC  1000000
 
 /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
    presents the real value for clock ticks per second for the system.  */
-# define CLK_TCK 100		/* XXX not correct for all systems.  */
+#  define CLK_TCK 100		/* XXX not correct for all systems.  */
 
-#endif  /* bits/time.h */
+# endif  /* bits/time.h */
+#endif
+
+#ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL	1
+/* A time value that is accurate to the nearest
+   microsecond but also has a range of years.  */
+struct timeval
+  {
+    long int tv_sec;		/* Seconds.  */
+    long int tv_usec;		/* Microseconds.  */
+  };
+#endif	/* struct timeval */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
index 9e2695652e..87b8265afd 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
@@ -1 +1,5 @@
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
 #include <termios.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
index 6d240c4b7a..d863f0955b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
@@ -1,4 +1,4 @@
-/* Definitions for POSIX memory map inerface.  Linux/PowerPC version.
+/* Definitions for POSIX memory map interface.  Linux/PowerPC version.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MMAN_H
-# error "Never include this file directly.  Use <sys/mman.h> instead"
+# error "Never use <bits/mman.h> directly; iclude <sys/mman.h> instead."
 #endif
 
 /* The following definitions basically come from the kernel headers.
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
index 4c6073bfc2..d1a40be33c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
@@ -16,8 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _TERMBITS_H
-#define _TERMBITS_H	1
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
 
 typedef unsigned char	cc_t;
 typedef unsigned int	speed_t;
@@ -73,7 +74,7 @@ struct termios {
 #define ICRNL	0000400
 #define IXON	0001000
 #define IXOFF	0002000
-#if !defined(KERNEL) || defined(__USE_BSD)
+#if !defined KERNEL || defined __USE_BSD
   /* POSIX.1 doesn't want these... */
 # define IXANY		0004000
 # define IUCLC		0010000
@@ -276,5 +277,3 @@ struct termio {
 #define N_SLIP		1
 #define N_MOUSE		2
 #define N_PPP		3
-
-#endif /* _TERMBITS_H */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h b/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h
index b33493ee46..1a8d5f6f81 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/ioctls.h
@@ -16,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/ioctl.h> instead.
- */
-
-#ifndef _BITS_IOCTLS_H
-#define _BITS_IOCTLS_H 1
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
 
 /* Use the definitions from the kernel header files.  */
 #include <asm/ioctls.h>
@@ -39,5 +36,3 @@
 #define TCSETSF	_IOW ('T', 11, char[36])
 
 #include <linux/sockios.h>
-
-#endif /* bits/ioctls.h  */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/poll.h b/sysdeps/unix/sysv/linux/sparc/bits/poll.h
index 8fea43924a..2d4e6f6f01 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/poll.h
@@ -16,6 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
 
 /* Event types that can be polled for.  These bits may be set in `events'
    to indicate the interesting event types; they will appear in `revents'
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
index 13471995b9..1858ef4857 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
@@ -30,7 +34,7 @@ struct sigaction
     unsigned long sa_flags;
 
     /* Not used by Linux/Sparc yet.  */
-    void (*sa_restorer)(void);
+    void (*sa_restorer) __P ((void));
   };
 
 
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h
index 54ac773b70..7047e47a02 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h
@@ -17,8 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _SPARC_TERMBITS_H
-#define _SPARC_TERMBITS_H	1
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
 
 typedef unsigned char cc_t;
 typedef unsigned int speed_t;
@@ -34,7 +35,7 @@ struct termios
     cc_t c_line;		/* line discipline */
     cc_t c_cc[NCCS];		/* control characters */
 #ifdef __KERNEL__
-#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
+# define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
     cc_t _x_cc[2];		/* We need them to hold vmin/vtime */
 #endif
   };
@@ -64,11 +65,11 @@ struct termios
  * shared with eof/eol
  */
 #ifdef __KERNEL__
-#define VMIN     16
-#define VTIME    17
+# define VMIN     16
+# define VTIME    17
 #else
-#define VMIN     VEOF
-#define VTIME    VEOL
+# define VMIN     VEOF
+# define VTIME    VEOL
 #endif
 
 /* c_iflag bits */
@@ -213,5 +214,3 @@ struct termios
 #define	TCSANOW		0
 #define	TCSADRAIN	1
 #define	TCSAFLUSH	2
-
-#endif /* !(_SPARC_TERMBITS_H) */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h
index 3e7f2900fa..bc70a58e24 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h
@@ -1,4 +1,4 @@
-/* Definitions for POSIX memory map inerface.  Linux/SPARC version.
+/* Definitions for POSIX memory map interface.  Linux/SPARC version.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MMAN_H
-# error "Never include this file directly.  Use <sys/mman.h> instead"
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
 #endif
 
 /* The following definitions basically come from the kernel headers.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h
index 3e7f2900fa..bc70a58e24 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h
@@ -1,4 +1,4 @@
-/* Definitions for POSIX memory map inerface.  Linux/SPARC version.
+/* Definitions for POSIX memory map interface.  Linux/SPARC version.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MMAN_H
-# error "Never include this file directly.  Use <sys/mman.h> instead"
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
 #endif
 
 /* The following definitions basically come from the kernel headers.
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h
index ab850e5301..b200b718d2 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h
@@ -16,11 +16,11 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _JMP_BUF_H 
-#define _JMP_BUF_H 1
+
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
 
 #include <ucontext.h>
 
 typedef ucontext_t __jmp_buf[1];
-
-#endif /* jmp_buf.h */
diff --git a/sysdeps/unix/sysv/linux/stdio_lim.h.in b/sysdeps/unix/sysv/linux/stdio_lim.h.in
index 9d6a957028..7fa98f7733 100644
--- a/sysdeps/unix/sysv/linux/stdio_lim.h.in
+++ b/sysdeps/unix/sysv/linux/stdio_lim.h.in
@@ -1,8 +1,33 @@
+/* Stdio limits for Linux.
+   Copyright (C) 1994, 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _STDIO_H
+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+#endif
+
 #define L_tmpnam 19
 #define TMP_MAX 238328
+
 #ifdef __USE_POSIX
-#define L_ctermid 9
-#define L_cuserid 9
+# define L_ctermid 9
+# define L_cuserid 9
 #endif
-#define FOPEN_MAX DEFAULT_FOPEN_MAX
-#define FILENAME_MAX DEFAULT_FILENAME_MAX
+
+#define FOPEN_MAX	DEFAULT_FOPEN_MAX
+#define FILENAME_MAX	DEFAULT_FILENAME_MAX
diff --git a/sysdeps/unix/sysv/linux/sys/mman.h b/sysdeps/unix/sysv/linux/sys/mman.h
index ea326e2cd9..e2434f135f 100644
--- a/sysdeps/unix/sysv/linux/sys/mman.h
+++ b/sysdeps/unix/sysv/linux/sys/mman.h
@@ -18,10 +18,9 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef	_SYS_MMAN_H
-
 #define	_SYS_MMAN_H	1
-#include <features.h>
 
+#include <features.h>
 #include <bits/types.h>
 #define __need_size_t
 #include <stddef.h>
diff --git a/sysdeps/unix/sysv/minix/bits/sigaction.h b/sysdeps/unix/sysv/minix/bits/sigaction.h
index 732befc630..96f14d17af 100644
--- a/sysdeps/unix/sysv/minix/bits/sigaction.h
+++ b/sysdeps/unix/sysv/minix/bits/sigaction.h
@@ -16,6 +16,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
diff --git a/sysdeps/unix/sysv/sco3.2.4/bits/confname.h b/sysdeps/unix/sysv/sco3.2.4/bits/confname.h
index 3af9377ded..3c549dd4b3 100644
--- a/sysdeps/unix/sysv/sco3.2.4/bits/confname.h
+++ b/sysdeps/unix/sysv/sco3.2.4/bits/confname.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _UNISTD_H
+# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
+#endif
+
 /* Values for the NAME argument to `pathconf' and `fpathconf'.  */
 #define _PC_LINK_MAX		0
 #define _PC_MAX_CANON		1
diff --git a/sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h b/sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h
index f66877da0b..eaa52bee2f 100644
--- a/sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h
+++ b/sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
diff --git a/sysdeps/unix/sysv/sysv4/bits/sigaction.h b/sysdeps/unix/sysv/sysv4/bits/sigaction.h
index ce3ab5e60c..07d5554921 100644
--- a/sysdeps/unix/sysv/sysv4/bits/sigaction.h
+++ b/sysdeps/unix/sysv/sysv4/bits/sigaction.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
diff --git a/sysdeps/unix/sysv/sysv4/bits/utsname.h b/sysdeps/unix/sysv/sysv4/bits/utsname.h
index 9dcc618068..bf2c0a8da5 100644
--- a/sysdeps/unix/sysv/sysv4/bits/utsname.h
+++ b/sysdeps/unix/sysv/sysv4/bits/utsname.h
@@ -1 +1,23 @@
+/* Copyright (C) 1995, 1996, 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
 #define _UTSNAME_LENGTH 257
diff --git a/sysdeps/unix/sysv/sysv4/bits/waitflags.h b/sysdeps/unix/sysv/sysv4/bits/waitflags.h
index 29ff566342..e99dc00511 100644
--- a/sysdeps/unix/sysv/sysv4/bits/waitflags.h
+++ b/sysdeps/unix/sysv/sysv4/bits/waitflags.h
@@ -19,7 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_WAIT_H
-#error "Never use <bits/waitflags.h> directly; include <sys/wait.h> instead."
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
 #endif
 
 
@@ -28,7 +28,7 @@
 #define	WUNTRACED	4	/* Report status of stopped children.  */
 
 #ifdef __USE_SVID
-#define WEXITED		1	/* Look for children that have exited.  */
-#define WTRAPPED	2	/* Look for processes that stopped
+# define WEXITED	1	/* Look for children that have exited.  */
+# define WTRAPPED	2	/* Look for processes that stopped
 				   while tracing.  */
 #endif
diff --git a/sysdeps/unix/sysv/sysv4/i386/bits/stat.h b/sysdeps/unix/sysv/sysv4/i386/bits/stat.h
index f3f4473032..104ad2f247 100644
--- a/sysdeps/unix/sysv/sysv4/i386/bits/stat.h
+++ b/sysdeps/unix/sysv/sysv4/i386/bits/stat.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Brendan Kehoe (brendan@zen.org).
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/stat.h> instead.
- */
-
-#ifndef	_BITS_STAT_H
-#define	_BITS_STAT_H	1
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 #include <bits/types.h>
 
@@ -34,37 +30,37 @@
 /* Structure describing file characteristics.  */
 struct stat
   {
-    unsigned long st_dev;	/* Device.  */
-    long st_filler1[3];
-    unsigned long st_ino;		/* File serial number.		*/
-    unsigned long st_mode;	/* File mode.  */
-    unsigned long st_nlink;	/* Link count.  */
-    long st_uid;		/* User ID of the file's owner.	*/
-    long st_gid;		/* Group ID of the file's group.*/
-    unsigned long st_rdev;	/* Device number, if device.  */
-    long st_filler2[2];
-
-    long st_size;		/* Size of file, in bytes.  */
+    unsigned long itn st_dev;	/* Device.  */
+    long int st_filler1[3];
+    unsigned long int st_ino;	/* File serial number.		*/
+    unsigned long int st_mode;	/* File mode.  */
+    unsigned long int st_nlink;	/* Link count.  */
+    long int st_uid;		/* User ID of the file's owner.	*/
+    long int st_gid;		/* Group ID of the file's group.*/
+    unsigned long int st_rdev;	/* Device number, if device.  */
+    long int st_filler2[2];
+
+    long int st_size;		/* Size of file, in bytes.  */
     /* SVR4 added this extra long to allow for expansion of off_t.  */
-    long st_filler3;
+    long int st_filler3;
 
-    long st_atime;		/* Time of last access.  */
-    unsigned long st_atime_usec;
-    long st_mtime;		/* Time of last modification.  */
-    unsigned long st_mtime_usec;
-    long st_ctime;		/* Time of last status change.  */
-    unsigned long st_ctime_usec;
+    long int st_atime;		/* Time of last access.  */
+    unsigned long int st_atime_usec;
+    long int st_mtime;		/* Time of last modification.  */
+    unsigned long int st_mtime_usec;
+    long int st_ctime;		/* Time of last status change.  */
+    unsigned long int st_ctime_usec;
 
-    long st_blksize;		/* Optimal block size for I/O.  */
+    long int st_blksize;	/* Optimal block size for I/O.  */
 #define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
 
     __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
     char st_fstype[16];		/* The type of this filesystem.  */
     int st_aclcnt;
-    unsigned long st_level;
-    unsigned long st_flags;
-    unsigned long st_cmwlevel;
-    long st_filler4[4];
+    unsigned long int st_level;
+    unsigned long int st_flags;
+    unsigned long int st_cmwlevel;
+    long int st_filler4[4];
   };
 
 /* Encoding of the file mode.  */
@@ -90,5 +86,3 @@ struct stat
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
-
-#endif	/* bits/stat.h */
diff --git a/sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h b/sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h
index 82ab37fd93..c6048a9277 100644
--- a/sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h
+++ b/sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Brendan Kehoe (brendan@zen.org).
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -17,12 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/*
- * Never include this file directly; use <sys/stat.h> instead.
- */
-
-#ifndef	_BITS_STAT_H
-#define	_BITS_STAT_H	1
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 #include <bits/types.h>
 
@@ -30,7 +26,7 @@
 struct stat
   {
     unsigned long int st_dev;
-    long st_filler1[3];
+    long int st_filler1[3];
     __ino_t st_ino;		/* File serial number.		*/
     unsigned long int st_mode;	/* File mode.  */
     /* This is unsigned long instead of __nlink_t, since SVR4 has
@@ -39,11 +35,11 @@ struct stat
     __uid_t st_uid;		/* User ID of the file's owner.	*/
     __gid_t st_gid;		/* Group ID of the file's group.*/
     unsigned long int st_rdev;	/* Device number, if device.  */
-    long st_filler2[2];
+    long int st_filler2[2];
 
     __off_t st_size;		/* Size of file, in bytes.  */
     /* SVR4 added this extra long to allow for expansion of off_t.  */
-    long st_filler3;
+    long int st_filler3;
 
     __time_t st_atime;		/* Time of last access.  */
     unsigned long int st_atime_usec;
@@ -55,9 +51,9 @@ struct stat
     __blkcnt_t st_blksize;	/* Optimal block size for I/O.  */
 #define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
 
-    long st_blocks;		/* Number of 512-byte blocks allocated.  */
+    long int st_blocks;		/* Number of 512-byte blocks allocated.  */
     char st_fstype[16];
-    long st_filler4[8];
+    long int st_filler4[8];
   };
 
 /* Encoding of the file mode.  */
@@ -83,5 +79,3 @@ struct stat
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
-
-#endif	/* bits/stat.h */
diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h b/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h
index 7402704864..29d2d87b26 100644
--- a/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h
@@ -1 +1,34 @@
-#include <sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h>
+/* Structure describing state saved while handling a signal.  Sparc version.
+   Copyright (C) 1992, 1994, 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SIGNAL_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+struct sigcontext
+  {
+    int sc_onstack;
+    __sigset_t sc_mask;
+
+#define	SPARC_MAXREGWINDOW 31	/* Maximum usable register windows.  */
+    int sc_sp, sc_pc, sc_npc, sc_psr, sc_g1, sc_o0;
+    int sc_wbcnt;		/* Number of outstanding windows.  */
+    __ptr_t sc_spbuf[SPARC_MAXREGWINDOW]; /* SP's for each window.  */
+    int sc_wbuf[SPARC_MAXREGWINDOW][16]; /* Saved register windows.  */
+  };