summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-11-26 04:23:08 +0000
committerUlrich Drepper <drepper@redhat.com>1997-11-26 04:23:08 +0000
commitf4017d205738b913f1002433cde5d4b4e93fbd81 (patch)
tree078a2f6aab0f3faf7355b41e12d8a06be81663a2 /sysdeps
parente34b0f2902588bbbfaf55829692e32c3c7134b74 (diff)
downloadglibc-f4017d205738b913f1002433cde5d4b4e93fbd81.tar.gz
glibc-f4017d205738b913f1002433cde5d4b4e93fbd81.tar.xz
glibc-f4017d205738b913f1002433cde5d4b4e93fbd81.zip
1997-11-26 04:28  Ulrich Drepper  <drepper@cygnus.com>

	* eld/dl-profile.c (_dl_start_profile): Avoid FP calculation when
	computing s_scale.  Patch by a sun <asun@zoology.washington.edu>.

	* iconv/gconv_close.c: Correct freeing of descriptor data.
	* iconv/gconv_simple.c: Return correct error values for illegal or
	incomplete characters.

	* Makefile (iconvdata/%): Special goal to simplify iconvdata
	development.
	* iconvdata/Makefile: New file.
	* iconvdata/configure: Likewise.
	* iconvdata/extra-module.mk: Likewise.
	* iconvdata/gconv-modules: Likewise.
	* iconvdata/iso6937.c: Likewise.
	* iconvdata/iso8859-1.c: Likewise.
	* iconvdata/iso8859-10.c: Likewise.
	* iconvdata/iso8859-10.h: Likewise.
	* iconvdata/iso8859-2.c: Likewise.
	* iconvdata/iso8859-2.h: Likewise.
	* iconvdata/iso8859-3.c: Likewise.
	* iconvdata/iso8859-3.h: Likewise.
	* iconvdata/iso8859-4.c: Likewise.
	* iconvdata/iso8859-4.h: Likewise.
	* iconvdata/iso8859-5.c: Likewise.
	* iconvdata/iso8859-5.h: Likewise.
	* iconvdata/iso8859-6.c: Likewise.
	* iconvdata/iso8859-6.h: Likewise.
	* iconvdata/iso8859-7.c: Likewise.
	* iconvdata/iso8859-7.h: Likewise.
	* iconvdata/iso8859-8.c: Likewise.
	* iconvdata/iso8859-8.h: Likewise.
	* iconvdata/iso8859-9.c: Likewise.
	* iconvdata/iso8859-9.h: Likewise.
	* iconvdata/iso8859-generic.c: Likewise.
	* iconvdata/t61.c: Likewise.

	* string/Makefile (routines): Add strcasestr.
	* string/string.h: Add prototype for strcasestr.
	* sysdeps/generic/strcasestr.c: New file.
	* wcsmbs/mbrtowc.c: Simplify special case a bit.
	* wcsmbs/wcrtomb.c: Likewise.
	* wcsmbs/mbsnrtowcs.c: Correctly handle incomplete characters.
	* wcsmbs/wcsnrtombs.c: Likewise.
	* wcsmbs/mbsrtowcs.c: Make sure SRC argument is correct when
	partial character is read.
	* wcsmbs/wcsrtombs.c: Likewise.
	* wcsmbs/wmemrtombs.c: Likewise.
	* wcsmbs/wmemrtowcs.c: Likewise.

	* io/ftw.h: Include <sys/stat.h> instead of <bits/stat.h>.
	* login/pty.h: Include <sys/ioctl.h> instead og <bits/ioctl-types.h>.
	* sysdeps/i386/__longjmp.S: Define _SETJMP_H.
	* sysdeps/i386/elf/setjmp.S: Likewise.
	* sysdeps/unix/sysv/linux/kernel_termios.h: Do include
	<bits/termios.h>.

	* sysdeps/posix/mk-stdiolim.c: Output file with comment.
	* sysdeps/unix/sysv/linux/stdio_lim.h.in: Add comment.

	* sysdeps/unix/sysv/linux/sys/mman.h: Pretty print.
	* sysvipc/sys/ipc.h: Likewise.
	* sysvipc/sys/msg.h: Likewise.
	* sysvipc/sys/sem.h: Likewise.
	* sysvipc/sys/shm.h: Likewise.

	* sysdeps/alpha/bits/endian.h: Issue error message if the header is
	used directly.
	* sysdeps/alpha/bits/setjmp.h: Likewise.
	* sysdeps/alpha/fpu/bits/fenv.h: Likewise.
	* sysdeps/arm/bits/endian.h: Likewise.
	* sysdeps/arm/bits/setjmp.h: Likewise.
	* sysdeps/generic/bits/byteswap.h: Likewise.
	* sysdeps/generic/bits/confname.h: Likewise.
	* sysdeps/generic/bits/dirent.h: Likewise.
	* sysdeps/generic/bits/dlfcn.h: Likewise.
	* sysdeps/generic/bits/endian.h: Likewise.
	* sysdeps/generic/bits/fenv.h: Likewise.
	* sysdeps/generic/bits/huge_val.h: Likewise.
	* sysdeps/generic/bits/in.h: Likewise.
	* sysdeps/generic/bits/ioctl-types.h: Likewise.
	* sysdeps/generic/bits/ioctls.h: Likewise.
	* sysdeps/generic/bits/ipc.h: Likewise.
	* sysdeps/generic/bits/msq.h: Likewise.
	* sysdeps/generic/bits/poll.h: Likewise.
	* sysdeps/generic/bits/resource.h: Likewise.
	* sysdeps/generic/bits/sched.h: Likewise.
	* sysdeps/generic/bits/sem.h: Likewise.
	* sysdeps/generic/bits/setjmp.h: Likewise.
	* sysdeps/generic/bits/shm.h: Likewise.
	* sysdeps/generic/bits/sigaction.h: Likewise.
	* sysdeps/generic/bits/sigcontext.h: Likewise.
	* sysdeps/generic/bits/socket.h: Likewise.
	* sysdeps/generic/bits/stat.h: Likewise.
	* sysdeps/generic/bits/statfs.h: Likewise.
	* sysdeps/generic/bits/stdio_lim.h: Likewise.
	* sysdeps/generic/bits/termios.h: Likewise.
	* sysdeps/generic/bits/time.h: Likewise.
	* sysdeps/generic/bits/uio.h: Likewise.
	* sysdeps/generic/bits/utmp.h: Likewise.
	* sysdeps/generic/bits/utmpx.h: Likewise.
	* sysdeps/generic/bits/utsname.h: Likewise.
	* sysdeps/generic/bits/waitflags.h: Likewise.
	* sysdeps/generic/bits/waitstatus.h: Likewise.
	* sysdeps/gnu/bits/utmp.h: Likewise.
	* sysdeps/gnu/bits/utmpx.h: Likewise.
	* sysdeps/i386/bits/byteswap.h: Likewise.
	* sysdeps/i386/bits/endian.h: Likewise.
	* sysdeps/i386/bits/huge_val.h: Likewise.
	* sysdeps/i386/bits/setjmp.h: Likewise.
	* sysdeps/i386/fpu/bits/fenv.h: Likewise.
	* sysdeps/ieee754/bits/huge_val.h: Likewise.
	* sysdeps/m68k/bits/byteswap.h: Likewise.
	* sysdeps/m68k/bits/endian.h: Likewise.
	* sysdeps/m68k/bits/setjmp.h: Likewise.
	* sysdeps/m68k/fpu/bits/fenv.h: Likewise.
	* sysdeps/mach/hurd/alpha/bits/sigcontext.h: Likewise.
	* sysdeps/mach/hurd/bits/ioctls.h: Likewise.
	* sysdeps/mach/hurd/bits/stat.h: Likewise.
	* sysdeps/mach/hurd/hppa/bits/sigcontext.h: Likewise.
	* sysdeps/mach/hurd/i386/bits/sigcontext.h: Likewise.
	* sysdeps/mach/hurd/mips/bits/sigcontext.h: Likewise.
	* sysdeps/mips/bits/dlfcn.h: Likewise.
	* sysdeps/mips/bits/endian.h: Likewise.
	* sysdeps/mips/bits/setjmp.h: Likewise.
	* sysdeps/mips/dec/bits/endian.h: Likewise.
	* sysdeps/mips/mips64/bits/setjmp.h: Likewise.
	* sysdeps/mips/mipsel/bits/endian.h: Likewise.
	* sysdeps/mips/p40/bits/endian.h: Likewise.
	* sysdeps/powerpc/bits/endian.h: Likewise.
	* sysdeps/powerpc/bits/fenv.h: Likewise.
	* sysdeps/powerpc/bits/setjmp.h: Likewise.
	* sysdeps/sparc/sparc32/bits/endian.h: Likewise.
	* sysdeps/sparc/sparc32/bits/setjmp.h: Likewise.
	* sysdeps/sparc/sparc32/fpu/bits/fenv.h: Likewise.
	* sysdeps/sparc/sparc64/bits/endian.h: Likewise.
	* sysdeps/sparc/sparc64/fpu/bits/fenv.h: Likewise.
	* sysdeps/unix/bsd/bits/dirent.h: Likewise.
	* sysdeps/unix/bsd/bits/stat.h: Likewise.
	* sysdeps/unix/bsd/bits/waitflags.h: Likewise.
	* sysdeps/unix/bsd/bsd4.4/bits/dirent.h: Likewise.
	* sysdeps/unix/bsd/osf/alpha/bits/stat.h: Likewise.
	* sysdeps/unix/bsd/osf/bits/sigaction.h: Likewise.
	* sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h: Likewise.
	* sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h: Likewise.
	* sysdeps/unix/bsd/sun/sunos4/bits/resource.h: Likewise.
	* sysdeps/unix/bsd/sun/sunos4/bits/termios.h: Likewise.
	* sysdeps/unix/bsd/sun/sunos4/bits/utsname.h: Likewise.
	* sysdeps/unix/bsd/ultrix4/bits/utsname.h: Likewise.
	* sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h: Likewise.
	* sysdeps/unix/common/bits/dirent.h: Likewise.
	* sysdeps/unix/sysv/bits/dirent.h: Likewise.
	* sysdeps/unix/sysv/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/bits/utmp.h: Likewise.
	* sysdeps/unix/sysv/bits/utsname.h: Likewise.
	* sysdeps/unix/sysv/irix4/bits/confname.h: Likewise.
	* sysdeps/unix/sysv/irix4/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/ioctls.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/ipc.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/time.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/dirent.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/in.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/ioctl-types.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/ioctls.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/ipc.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/msq.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/poll.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/resource.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sched.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sem.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sigcontext.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/socket.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/statfs.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/termios.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/time.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/uio.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/utsname.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/waitflags.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/bits/poll.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/endian.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/ipc.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/poll.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/statfs.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/time.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/ioctls.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/poll.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h: Likewise.
	* sysdeps/unix/sysv/minix/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/sco3.2.4/bits/confname.h: Likewise.
	* sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/sysv4/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/sysv4/bits/utsname.h: Likewise.
	* sysdeps/unix/sysv/sysv4/bits/waitflags.h: Likewise.
	* sysdeps/unix/sysv/sysv4/i386/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h: Likewise.
	* sysdeps/vax/bits/huge_val.h: Likewise.
	* sysdeps/vax/bits/setjmp.h: Likewise.
	* sysdeps/wordsize-32/bits/elfclass.h: Likewise.
	* sysdeps/wordsize-64/bits/elfclass.h: Likewise.

1997-11-25  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* libio/stdio.h: Correct comment of sys_nerr/sys_errlist

1997-11-25  Paul Eggert  <eggert@shade.twinsun.com>

	* strftime.c (strftime):
	No longer any need to undef or declare if emacs is defined.
	(my_strftime): When checking a -1 returned by mktime, don't blow up
	if localtime_r returns NULL.

1997-11-24  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* README.template: Fix spelling.

1997-11-25  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* configure.in: Enhance --enable-add-ons description a wee bit.

1997-11-24  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* glibcbug.in: Add more information of build environment and flags.

1997-11-23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/posix/getcwd.c: Recognize EOF from readdir and translate
	it into ENOENT.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/bits/endian.h4
-rw-r--r--sysdeps/alpha/bits/setjmp.h40
-rw-r--r--sysdeps/alpha/fpu/bits/fenv.h17
-rw-r--r--sysdeps/arm/bits/endian.h4
-rw-r--r--sysdeps/arm/bits/setjmp.h10
-rw-r--r--sysdeps/generic/bits/byteswap.h7
-rw-r--r--sysdeps/generic/bits/confname.h4
-rw-r--r--sysdeps/generic/bits/dirent.h6
-rw-r--r--sysdeps/generic/bits/dlfcn.h7
-rw-r--r--sysdeps/generic/bits/endian.h4
-rw-r--r--sysdeps/generic/bits/fenv.h2
-rw-r--r--sysdeps/generic/bits/huge_val.h4
-rw-r--r--sysdeps/generic/bits/in.h15
-rw-r--r--sysdeps/generic/bits/ioctl-types.h25
-rw-r--r--sysdeps/generic/bits/ioctls.h4
-rw-r--r--sysdeps/generic/bits/ipc.h30
-rw-r--r--sysdeps/generic/bits/msq.h6
-rw-r--r--sysdeps/generic/bits/poll.h3
-rw-r--r--sysdeps/generic/bits/resource.h7
-rw-r--r--sysdeps/generic/bits/sched.h4
-rw-r--r--sysdeps/generic/bits/sem.h9
-rw-r--r--sysdeps/generic/bits/setjmp.h4
-rw-r--r--sysdeps/generic/bits/shm.h29
-rw-r--r--sysdeps/generic/bits/sigaction.h4
-rw-r--r--sysdeps/generic/bits/sigcontext.h4
-rw-r--r--sysdeps/generic/bits/socket.h9
-rw-r--r--sysdeps/generic/bits/stat.h36
-rw-r--r--sysdeps/generic/bits/statfs.h12
-rw-r--r--sysdeps/generic/bits/stdio_lim.h18
-rw-r--r--sysdeps/generic/bits/termios.h78
-rw-r--r--sysdeps/generic/bits/time.h18
-rw-r--r--sysdeps/generic/bits/uio.h2
-rw-r--r--sysdeps/generic/bits/utmp.h8
-rw-r--r--sysdeps/generic/bits/utmpx.h14
-rw-r--r--sysdeps/generic/bits/utsname.h22
-rw-r--r--sysdeps/generic/bits/waitflags.h2
-rw-r--r--sysdeps/generic/bits/waitstatus.h34
-rw-r--r--sysdeps/generic/strcasestr.c129
-rw-r--r--sysdeps/gnu/bits/utmp.h46
-rw-r--r--sysdeps/gnu/bits/utmpx.h23
-rw-r--r--sysdeps/i386/__longjmp.S1
-rw-r--r--sysdeps/i386/bits/byteswap.h7
-rw-r--r--sysdeps/i386/bits/endian.h4
-rw-r--r--sysdeps/i386/bits/huge_val.h36
-rw-r--r--sysdeps/i386/bits/setjmp.h18
-rw-r--r--sysdeps/i386/elf/setjmp.S1
-rw-r--r--sysdeps/i386/fpu/bits/fenv.h5
-rw-r--r--sysdeps/ieee754/bits/huge_val.h54
-rw-r--r--sysdeps/m68k/bits/byteswap.h13
-rw-r--r--sysdeps/m68k/bits/endian.h4
-rw-r--r--sysdeps/m68k/bits/setjmp.h10
-rw-r--r--sysdeps/m68k/fpu/bits/fenv.h2
-rw-r--r--sysdeps/mach/hurd/alpha/bits/sigcontext.h4
-rw-r--r--sysdeps/mach/hurd/bits/ioctls.h56
-rw-r--r--sysdeps/mach/hurd/bits/stat.h12
-rw-r--r--sysdeps/mach/hurd/hppa/bits/sigcontext.h4
-rw-r--r--sysdeps/mach/hurd/i386/bits/sigcontext.h4
-rw-r--r--sysdeps/mach/hurd/mips/bits/sigcontext.h4
-rw-r--r--sysdeps/mips/bits/dlfcn.h14
-rw-r--r--sysdeps/mips/bits/endian.h4
-rw-r--r--sysdeps/mips/bits/setjmp.h5
-rw-r--r--sysdeps/mips/dec/bits/endian.h4
-rw-r--r--sysdeps/mips/mips64/bits/setjmp.h5
-rw-r--r--sysdeps/mips/mipsel/bits/endian.h4
-rw-r--r--sysdeps/mips/p40/bits/endian.h4
-rw-r--r--sysdeps/posix/getcwd.c12
-rw-r--r--sysdeps/posix/mk-stdiolim.c26
-rw-r--r--sysdeps/powerpc/bits/endian.h4
-rw-r--r--sysdeps/powerpc/bits/fenv.h20
-rw-r--r--sysdeps/powerpc/bits/setjmp.h18
-rw-r--r--sysdeps/sparc/sparc32/bits/endian.h4
-rw-r--r--sysdeps/sparc/sparc32/bits/setjmp.h12
-rw-r--r--sysdeps/sparc/sparc32/fpu/bits/fenv.h6
-rw-r--r--sysdeps/sparc/sparc64/bits/endian.h8
-rw-r--r--sysdeps/sparc/sparc64/fpu/bits/fenv.h6
-rw-r--r--sysdeps/unix/bsd/bits/dirent.h4
-rw-r--r--sysdeps/unix/bsd/bits/stat.h12
-rw-r--r--sysdeps/unix/bsd/bits/waitflags.h4
-rw-r--r--sysdeps/unix/bsd/bsd4.4/bits/dirent.h4
-rw-r--r--sysdeps/unix/bsd/osf/alpha/bits/stat.h12
-rw-r--r--sysdeps/unix/bsd/osf/bits/sigaction.h4
-rw-r--r--sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h4
-rw-r--r--sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h4
-rw-r--r--sysdeps/unix/bsd/sun/sunos4/bits/resource.h7
-rw-r--r--sysdeps/unix/bsd/sun/sunos4/bits/termios.h112
-rw-r--r--sysdeps/unix/bsd/sun/sunos4/bits/utsname.h22
-rw-r--r--sysdeps/unix/bsd/ultrix4/bits/utsname.h22
-rw-r--r--sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h5
-rw-r--r--sysdeps/unix/common/bits/dirent.h6
-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
-rw-r--r--sysdeps/vax/bits/huge_val.h4
-rw-r--r--sysdeps/vax/bits/setjmp.h4
-rw-r--r--sysdeps/wordsize-32/bits/elfclass.h4
-rw-r--r--sysdeps/wordsize-64/bits/elfclass.h4
164 files changed, 1389 insertions, 1064 deletions
diff --git a/sysdeps/alpha/bits/endian.h b/sysdeps/alpha/bits/endian.h
index e873d2123c..8a16e14e24 100644
--- a/sysdeps/alpha/bits/endian.h
+++ b/sysdeps/alpha/bits/endian.h
@@ -1,3 +1,7 @@
 /* Alpha is little-endian.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysdeps/alpha/bits/setjmp.h b/sysdeps/alpha/bits/setjmp.h
index 9aa30463d6..de37019218 100644
--- a/sysdeps/alpha/bits/setjmp.h
+++ b/sysdeps/alpha/bits/setjmp.h
@@ -17,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
 /* The previous bits/setjmp.h had __jmp_buf defined as a structure.
    We use an array of 'long int' instead, to make writing the
    assembler easier. Naturally, user code should not depend on
@@ -48,24 +52,24 @@
  * registers.
  */
 
-#if defined(__USE_MISC) || defined(__ASSEMBLY__)
-#define JB_S0  0
-#define JB_S1  1
-#define JB_S2  2
-#define JB_S3  3
-#define JB_S4  4
-#define JB_S5  5
-#define JB_PC  6
-#define JB_FP  7
-#define JB_SP  8
-#define JB_F2  9
-#define JB_F3  10
-#define JB_F4  11
-#define JB_F5  12
-#define JB_F6  13
-#define JB_F7  14
-#define JB_F8  15
-#define JB_F9  16
+#if defined __USE_MISC || defined __ASSEMBLY__
+# define JB_S0  0
+# define JB_S1  1
+# define JB_S2  2
+# define JB_S3  3
+# define JB_S4  4
+# define JB_S5  5
+# define JB_PC  6
+# define JB_FP  7
+# define JB_SP  8
+# define JB_F2  9
+# define JB_F3  10
+# define JB_F4  11
+# define JB_F5  12
+# define JB_F6  13
+# define JB_F7  14
+# define JB_F8  15
+# define JB_F9  16
 #endif
 
 #ifndef __ASSEMBLY__
diff --git a/sysdeps/alpha/fpu/bits/fenv.h b/sysdeps/alpha/fpu/bits/fenv.h
index 7cb0e3e543..4482f0a2dd 100644
--- a/sysdeps/alpha/fpu/bits/fenv.h
+++ b/sysdeps/alpha/fpu/bits/fenv.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Richard Henderson <rth@tamu.edu>, 1997
 
    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
@@ -18,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _FENV_H
-#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
 #endif
 
 
@@ -51,20 +50,20 @@ enum
 
     FE_INVALID =	1UL << 17,
 #define FE_INVALID	FE_INVALID
-    
+
     FE_ALL_EXCEPT =
 	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
-#define FE_ALL_EXCEPT	FE_ALL_EXCEPT 
+#define FE_ALL_EXCEPT	FE_ALL_EXCEPT
   };
 
 
-/* Alpha chips support all four defined rouding modes. 
+/* Alpha chips support all four defined rouding modes.
 
    Note that code must be compiled to use dynamic rounding (/d) instructions
    to see these changes.  For gcc this is -mfp-rounding-mode=d; for DEC cc
-   this is -fprm d.  The default for both is static rounding to nearest. 
+   this is -fprm d.  The default for both is static rounding to nearest.
 
-   These are shifted down 58 bits from the hardware fpcr because the 
+   These are shifted down 58 bits from the hardware fpcr because the
    functions are declared to take integers.  */
 
 enum
@@ -100,5 +99,5 @@ typedef unsigned long fenv_t;
 #endif
 
 /* The system calls to talk to the kernel's FP code.  */
-extern unsigned long __ieee_get_fp_control(void);
-extern void __ieee_set_fp_control(unsigned long);
+extern unsigned long int __ieee_get_fp_control __P ((void));
+extern void __ieee_set_fp_control __P ((unsigned long int __value));
diff --git a/sysdeps/arm/bits/endian.h b/sysdeps/arm/bits/endian.h
index 32f8489df2..ad3b5393bc 100644
--- a/sysdeps/arm/bits/endian.h
+++ b/sysdeps/arm/bits/endian.h
@@ -1,3 +1,7 @@
 /* ARM is little-endian.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysdeps/arm/bits/setjmp.h b/sysdeps/arm/bits/setjmp.h
index 93b0f5f916..5cf9cd75c7 100644
--- a/sysdeps/arm/bits/setjmp.h
+++ b/sysdeps/arm/bits/setjmp.h
@@ -1,10 +1,14 @@
 /* Define the machine-dependent type `jmp_buf'.  ARM version. */
 
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
 #ifndef _ASM
 /* Jump buffer contains v1-v6, sl, fp, sp, pc and (f4-f7) if we do FP. */
-#if __ARM_USES_FP
+# if __ARM_USES_FP
 typedef int __jmp_buf[22];
-#else
+# else
 typedef int __jmp_buf[10];
-#endif
+# endif
 #endif
diff --git a/sysdeps/generic/bits/byteswap.h b/sysdeps/generic/bits/byteswap.h
index 9404cc452e..04a5efe9f0 100644
--- a/sysdeps/generic/bits/byteswap.h
+++ b/sysdeps/generic/bits/byteswap.h
@@ -17,8 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H	1
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
 
 /* Swap bytes in 16 bit value.  */
 #define __bswap_16(x) \
@@ -39,5 +40,3 @@
 	__r.__l[1] = __bswap_32 (__v.__l[0]);				      \
 	__r.__ll; })
 #endif
-
-#endif /* bits/byteswap.h */
diff --git a/sysdeps/generic/bits/confname.h b/sysdeps/generic/bits/confname.h
index 40228e11ed..4653887468 100644
--- a/sysdeps/generic/bits/confname.h
+++ b/sysdeps/generic/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/generic/bits/dirent.h b/sysdeps/generic/bits/dirent.h
index 2f7dca78aa..366cdf8ce2 100644
--- a/sysdeps/generic/bits/dirent.h
+++ b/sysdeps/generic/bits/dirent.h
@@ -1,5 +1,5 @@
 /* Directory entry structure `struct dirent'.  Stub version.
-   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,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
   {
     char d_name[1];		/* Variable length.  */
diff --git a/sysdeps/generic/bits/dlfcn.h b/sysdeps/generic/bits/dlfcn.h
index 79604fe8ff..7c33694018 100644
--- a/sysdeps/generic/bits/dlfcn.h
+++ b/sysdeps/generic/bits/dlfcn.h
@@ -17,8 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef	_BITS_DLFCN_H
-#define	_BITS_DLFCN_H 1
+#ifndef _DLFCN_H
+# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
+#endif
 
 /* The MODE argument to `dlopen' contains one of the following: */
 #define RTLD_LAZY	0x001	/* Lazy function call binding.  */
@@ -29,5 +30,3 @@
    the symbols of the loaded object and its dependencies are made
    visible as if the object were linked directly into the program.  */
 #define RTLD_GLOBAL	0x100
-
-#endif	/* bits/dlfcn.h */
diff --git a/sysdeps/generic/bits/endian.h b/sysdeps/generic/bits/endian.h
index 597f079a0f..45afd4ae47 100644
--- a/sysdeps/generic/bits/endian.h
+++ b/sysdeps/generic/bits/endian.h
@@ -6,4 +6,8 @@
    So if cross-compiling to a machine with a different byte order,
    the bits/endian.h file for that machine must exist.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #error Machine byte order unknown.
diff --git a/sysdeps/generic/bits/fenv.h b/sysdeps/generic/bits/fenv.h
index f45deb07c1..c42540fa61 100644
--- a/sysdeps/generic/bits/fenv.h
+++ b/sysdeps/generic/bits/fenv.h
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _FENV_H
-#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
 #endif
 
 
diff --git a/sysdeps/generic/bits/huge_val.h b/sysdeps/generic/bits/huge_val.h
index 8f137d1734..0c30c86f33 100644
--- a/sysdeps/generic/bits/huge_val.h
+++ b/sysdeps/generic/bits/huge_val.h
@@ -1,6 +1,6 @@
 /* Stub `HUGE_VAL' constant.
    Used by <stdlib.h> and <math.h> functions for overflow.
-   Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1992, 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
@@ -19,7 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _MATH_H
-#error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
 #endif
 
 
diff --git a/sysdeps/generic/bits/in.h b/sysdeps/generic/bits/in.h
index 7241bd24c3..83d7ae6b10 100644
--- a/sysdeps/generic/bits/in.h
+++ b/sysdeps/generic/bits/in.h
@@ -18,8 +18,9 @@
 
 /* Generic 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
 
 /* Link numbers.  */
 #define	IMPLINK_IP		155
@@ -55,10 +56,10 @@ struct ip_opts
 
 /* Structure used for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */
 struct ip_mreq
-{
-  struct in_addr imr_multiaddr;	/* IP multicast address of group */
-  struct in_addr imr_interface;	/* local IP address of interface */
-};
+  {
+    struct in_addr imr_multiaddr;	/* IP multicast address of group */
+    struct in_addr imr_interface;	/* local IP address of interface */
+  };
 
 /* IPV6 socket options.  */
 #define IPV6_ADDRFORM		1
@@ -80,5 +81,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/generic/bits/ioctl-types.h b/sysdeps/generic/bits/ioctl-types.h
index 1d5c8a002f..26283a0f10 100644
--- a/sysdeps/generic/bits/ioctl-types.h
+++ b/sysdeps/generic/bits/ioctl-types.h
@@ -1,5 +1,5 @@
 /* Structure types for pre-termios terminal ioctls.  Generic Unix version.
-   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,15 +17,11 @@
    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
 
-#if	defined(TIOCGETC) || defined(TIOCSETC)
+#if defined TIOCGETC || defined TIOCSETC
 /* Type of ARG for TIOCGETC and TIOCSETC requests.  */
 struct tchars
 {
@@ -41,7 +37,7 @@ struct tchars
   _IOT (_IOTS (char), 6, 0, 0, 0, 0)
 #endif
 
-#if	defined(TIOCGLTC) || defined(TIOCSLTC)
+#if defined TIOCGLTC || defined TIOCSLTC
 /* Type of ARG for TIOCGLTC and TIOCSLTC requests.  */
 struct ltchars
 {
@@ -70,7 +66,7 @@ struct sgttyb
 #define	_IOT_sgttyb	/* Hurd ioctl type field.  */ \
   _IOT (_IOTS (char), 6, _IOTS (short int), 1, 0, 0)
 
-#if	defined(TIOCGWINSZ) || defined(TIOCSWINSZ)
+#if defined TIOCGWINSZ || defined TIOCSWINSZ
 /* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests.  */
 struct winsize
 {
@@ -86,13 +82,13 @@ struct winsize
   _IOT (_IOTS (unsigned short int), 4, 0, 0, 0, 0)
 #endif
 
-#if	defined (TIOCGSIZE) || defined (TIOCSSIZE)
+#if defined TIOCGSIZE || defined TIOCSSIZE
 /* The BSD-style ioctl constructor macros use `sizeof', which can't be used
    in a preprocessor conditional.  Since the commands are always unique
    regardless of the size bits, we can safely define away `sizeof' for the
    purpose of the conditional.  */
 #  define sizeof(type) 0
-#  if defined (TIOCGWINSZ) && TIOCGSIZE == TIOCGWINSZ
+#  if defined TIOCGWINSZ && TIOCGSIZE == TIOCGWINSZ
 /* Many systems that have TIOCGWINSZ define TIOCGSIZE for source
    compatibility with Sun; they define `struct ttysize' to have identical
    layout as `struct winsize' and #define TIOCGSIZE to be TIOCGWINSZ
@@ -116,6 +112,3 @@ struct ttysize
 #  endif
 #  undef sizeof			/* See above.  */
 #endif
-
-
-#endif /* bits/ioctl-types.h */
diff --git a/sysdeps/generic/bits/ioctls.h b/sysdeps/generic/bits/ioctls.h
index 3b6178bfae..d3ecad9515 100644
--- a/sysdeps/generic/bits/ioctls.h
+++ b/sysdeps/generic/bits/ioctls.h
@@ -1 +1,5 @@
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
 /* This space intentionally left blank.  */
diff --git a/sysdeps/generic/bits/ipc.h b/sysdeps/generic/bits/ipc.h
index a5ecbd90b7..58f419be1d 100644
--- a/sysdeps/generic/bits/ipc.h
+++ b/sysdeps/generic/bits/ipc.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.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -17,10 +17,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>
 
@@ -34,23 +33,16 @@
 #define IPC_SET		1		/* set `ipc_perm' options */
 #define IPC_STAT	2		/* get `ipc_perm' options */
 
-
-__BEGIN_DECLS
-
 /* Special key values.  */
 #define IPC_PRIVATE	((key_t) 0)	/* private key */
 
 
 /* Data structure used to pass permission information to IPC operations.  */
 struct ipc_perm
-{
-  __uid_t uid;				/* owner's user ID */
-  __gid_t gid;				/* owner's group ID */
-  __uid_t cuid;				/* creator's user ID */
-  __gid_t cgid;				/* creator's group ID */
-  __mode_t mode;			/* read/write permission */
-};
-
-__END_DECLS
-
-#endif /* _SYS_IPC_BUF_H */
+  {
+    __uid_t uid;			/* owner's user ID */
+    __gid_t gid;			/* owner's group ID */
+    __uid_t cuid;			/* creator's user ID */
+    __gid_t cgid;			/* creator's group ID */
+    __mode_t mode;			/* read/write permission */
+  };
diff --git a/sysdeps/generic/bits/msq.h b/sysdeps/generic/bits/msq.h
index 37daa9bf8c..a263869a0e 100644
--- a/sysdeps/generic/bits/msq.h
+++ b/sysdeps/generic/bits/msq.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1995, 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
@@ -21,14 +20,11 @@
 #error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
-
-#include <features.h>
 #include <sys/types.h>
 
 /* Define options for message queue functions.  */
 #define MSG_NOERROR	010000	/* no error if message is too big */
 
-__BEGIN_DECLS
 
 /* Structure of record for one message inside the kernel.
    The type `struct __msg' is opaque.  */
@@ -43,5 +39,3 @@ struct msqid_ds
   __pid_t msg_lspid;		/* pid of last msgsnd() */
   __pid_t msg_lrpid;		/* pid of last msgrcv() */
 };
-
-__END_DECLS
diff --git a/sysdeps/generic/bits/poll.h b/sysdeps/generic/bits/poll.h
index 55ec70e363..68f611a428 100644
--- a/sysdeps/generic/bits/poll.h
+++ b/sysdeps/generic/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/generic/bits/resource.h b/sysdeps/generic/bits/resource.h
index 46cf9a7af5..d0ebeb56c8 100644
--- a/sysdeps/generic/bits/resource.h
+++ b/sysdeps/generic/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
+
 /* These are the values for 4.4 BSD and GNU.  Earlier BSD systems have a
    subset of these kinds of resource limit.  In systems where `getrlimit'
    and `setrlimit' are not system calls, these are the values used by the C
@@ -107,7 +111,8 @@ enum __rusage_who
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
   };
 
-#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/generic/bits/sched.h b/sysdeps/generic/bits/sched.h
index bb5da5676f..0c246c8f9a 100644
--- a/sysdeps/generic/bits/sched.h
+++ b/sysdeps/generic/bits/sched.h
@@ -1,6 +1,6 @@
 /* Definitions of constants and data structure for POSIX 1003.1b-1993
    scheduling interface.
-   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
@@ -19,7 +19,7 @@
    Suite 330, 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
 
 
diff --git a/sysdeps/generic/bits/sem.h b/sysdeps/generic/bits/sem.h
index 1d3e41bd56..8b9f97c62a 100644
--- a/sysdeps/generic/bits/sem.h
+++ b/sysdeps/generic/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
@@ -18,11 +17,9 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_SEM_H
-#error "Never use <bits/sem.h> directly; include <sys/sem.h> instead."
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
 #endif
 
-
-#include <features.h>
 #include <sys/types.h>
 
 /* Flags for `semop'.  */
@@ -38,8 +35,6 @@
 #define SETALL		17		/* set all semval's */
 
 
-__BEGIN_DECLS
-
 /* Data structure describing a set of semaphores.  */
 struct semid_ds
 {
@@ -57,5 +52,3 @@ union semun
   unsigned short int *array;		/* array for GETALL & SETALL */
   struct seminfo *__buf;		/* buffer for IPC_INFO */
  };
-
-__END_DECLS
diff --git a/sysdeps/generic/bits/setjmp.h b/sysdeps/generic/bits/setjmp.h
index 6620e5ab15..9150d8d764 100644
--- a/sysdeps/generic/bits/setjmp.h
+++ b/sysdeps/generic/bits/setjmp.h
@@ -1,3 +1,7 @@
 /* Define the machine-dependent type `jmp_buf'.  Stub version.  */
 
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
 typedef int __jmp_buf[1];
diff --git a/sysdeps/generic/bits/shm.h b/sysdeps/generic/bits/shm.h
index b41d0c1e86..8c97999626 100644
--- a/sysdeps/generic/bits/shm.h
+++ b/sysdeps/generic/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
@@ -18,11 +17,9 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_SHM_H
-#error "Never use <bits/shm.h> directly; include <sys/shm.h> instead."
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
 #endif
 
-
-#include <features.h>
 #include <sys/types.h>
 
 /* Flags for `shmat'.  */
@@ -35,19 +32,15 @@
 #define SHM_UNLOCK	12		/* unlock segment (root only) */
 
 
-__BEGIN_DECLS
-
 /* Data structure describing a set of semaphores.  */
 struct shmid_ds
-{
-  struct ipc_perm sem_perm;		/* operation permission struct */
-  int shm_segsz;			/* size of segment in bytes */
-  __time_t sem_atime;			/* time of last shmat() */
-  __time_t sem_dtime;			/* time of last shmdt() */
-  __time_t sem_ctime;			/* time of last change by shmctl() */
-  __pid_t shm_cpid;			/* pid of creator */
-  __pid_t shm_lpid;			/* pid of last shmop */
-  unsigned short int shm_nattch;	/* number of current attaches */
-};
-
-__END_DECLS
+  {
+    struct ipc_perm sem_perm;		/* operation permission struct */
+    int shm_segsz;			/* size of segment in bytes */
+    __time_t sem_atime;			/* time of last shmat() */
+    __time_t sem_dtime;			/* time of last shmdt() */
+    __time_t sem_ctime;			/* time of last change by shmctl() */
+    __pid_t shm_cpid;			/* pid of creator */
+    __pid_t shm_lpid;			/* pid of last shmop */
+    unsigned short int shm_nattch;	/* number of current attaches */
+  };
diff --git a/sysdeps/generic/bits/sigaction.h b/sysdeps/generic/bits/sigaction.h
index e89479bd1c..4499517b1a 100644
--- a/sysdeps/generic/bits/sigaction.h
+++ b/sysdeps/generic/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
+
 /* These definitions match those used by the 4.4 BSD kernel.
    If the operating system has a `sigaction' system call that correctly
    implements the POSIX.1 behavior, there should be a system-dependent
diff --git a/sysdeps/generic/bits/sigcontext.h b/sysdeps/generic/bits/sigcontext.h
index 46e4df8c64..576fd30c37 100644
--- a/sysdeps/generic/bits/sigcontext.h
+++ b/sysdeps/generic/bits/sigcontext.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 use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
 /* State of this thread when the signal was taken.  */
 struct sigcontext
   {
diff --git a/sysdeps/generic/bits/socket.h b/sysdeps/generic/bits/socket.h
index af42dfac78..a2858b8de8 100644
--- a/sysdeps/generic/bits/socket.h
+++ b/sysdeps/generic/bits/socket.h
@@ -18,17 +18,12 @@
    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
 #include <stddef.h>
 
-__BEGIN_DECLS
-
 /* Type for length arguments in socket calls.  */
 typedef unsigned int socklen_t;
 
@@ -201,5 +196,3 @@ struct linger
     int l_onoff;		/* Nonzero to linger on close.  */
     int l_linger;		/* Time to linger.  */
   };
-
-__END_DECLS
diff --git a/sysdeps/generic/bits/stat.h b/sysdeps/generic/bits/stat.h
index 3648fed738..a0edf2be52 100644
--- a/sysdeps/generic/bits/stat.h
+++ b/sysdeps/generic/bits/stat.h
@@ -16,16 +16,13 @@
    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 _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 /* This structure needs to be defined in accordance with the
    implementation of __stat, __fstat, and __lstat.  */
 
-#ifndef	_BITS_STAT_H
-#define	_BITS_STAT_H	1
-
 #include <bits/types.h>
 
 /* Structure describing file characteristics.  */
@@ -73,20 +70,17 @@ struct stat
 #ifdef __USE_LARGEFILE64
 struct stat64
   {
-    __dev_t st_dev;			/* Device.  */
-
-    __ino64_t st_ino;			/* File serial number.	*/
-    __mode_t st_mode;			/* File mode.  */
-    __nlink_t st_nlink;			/* Link count.  */
-    __uid_t st_uid;			/* User ID of the file's owner.	*/
-    __gid_t st_gid;			/* Group ID of the file's group.*/
-    __off64_t st_size;			/* Size of file, in bytes.  */
-
-    __time_t st_atime;			/* Time of last access.  */
-    __time_t st_mtime;			/* Time of last modification.  */
-    __time_t st_ctime;			/* Time of last status change.  */
-  };
-#endif
+    __dev_t st_dev;		/* Device.  */
 
+    __ino64_t st_ino;		/* File serial number.	*/
+    __mode_t st_mode;		/* File mode.  */
+    __nlink_t st_nlink;		/* Link count.  */
+    __uid_t st_uid;		/* User ID of the file's owner.	*/
+    __gid_t st_gid;		/* Group ID of the file's group.*/
+    __off64_t st_size;		/* Size of file, in bytes.  */
 
-#endif /* bits/stat.h */
+    __time_t st_atime;		/* Time of last access.  */
+    __time_t st_mtime;		/* Time of last modification.  */
+    __time_t st_ctime;		/* Time of last status change.  */
+  };
+#endif
diff --git a/sysdeps/generic/bits/statfs.h b/sysdeps/generic/bits/statfs.h
index 9fa3388801..a92cf52315 100644
--- a/sysdeps/generic/bits/statfs.h
+++ b/sysdeps/generic/bits/statfs.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/statfs.h> instead.
- */
-
-#ifndef	_BITS_STATFS_H
-#define	_BITS_STATFS_H	1
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
 
 #include <bits/types.h>
 
@@ -47,6 +44,3 @@ struct statfs
     unsigned int f_namelen;
     unsigned int f_spare[6];
   };
-
-
-#endif /* bits/statfs.h */
diff --git a/sysdeps/generic/bits/stdio_lim.h b/sysdeps/generic/bits/stdio_lim.h
index ef873777c9..d9b8fbc749 100644
--- a/sysdeps/generic/bits/stdio_lim.h
+++ b/sysdeps/generic/bits/stdio_lim.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+/* Stdio limits for non-POSIX systems.
+   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
@@ -16,22 +17,17 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* <bits/stdio_lim.h>: stdio limits for non-POSIX systems.
- * Never include this file directly; use <stdio.h> instead.
- */
-
-#ifndef _BITS_STDIO_LIM_H
-#define _BITS_STDIO_LIM_H
+#ifndef _STDIO_H
+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+#endif
 
 #define	L_tmpnam	1
 #define	TMP_MAX		0
 
 #ifdef __USE_POSIX
-#define	L_ctermid	1
-#define	L_cuserid	1
+# define L_ctermid	1
+# define L_cuserid	1
 #endif
 
 #define	FOPEN_MAX	16
 #define	FILENAME_MAX	14
-
-#endif
diff --git a/sysdeps/generic/bits/termios.h b/sysdeps/generic/bits/termios.h
index 9a6aed2bba..da059cbf06 100644
--- a/sysdeps/generic/bits/termios.h
+++ b/sysdeps/generic/bits/termios.h
@@ -1,5 +1,5 @@
 /* termios type and macro definitions.  4.4 BSD/generic GNU version.
-   Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 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,31 +17,35 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
 /* These macros are also defined in some <bits/ioctls.h> files (with
    numerically identical values), but this serves to shut up cpp's
    complaining. */
 #ifdef __USE_BSD
 
-#ifdef MDMBUF
-#undef MDMBUF
-#endif
-#ifdef FLUSHO
-#undef FLUSHO
-#endif
-#ifdef PENDIN
-#undef PENDIN
-#endif
+# ifdef MDMBUF
+#  undef MDMBUF
+# endif
+# ifdef FLUSHO
+#  undef FLUSHO
+# endif
+# ifdef PENDIN
+#  undef PENDIN
+# endif
 
 #endif /* __USE_BSD */
 
 #ifdef ECHO
-#undef ECHO
+# undef ECHO
 #endif
 #ifdef TOSTOP
-#undef TOSTOP
+# undef TOSTOP
 #endif
 #ifdef NOFLSH
-#undef NOFLSH
+# undef NOFLSH
 #endif
 
 
@@ -85,15 +89,15 @@ struct termios
   tcflag_t c_oflag;
 #define	OPOST	(1 << 0)	/* Perform output processing.  */
 #ifdef	__USE_BSD
-#define	ONLCR	(1 << 1)	/* Map NL to CR-NL on output.  */
-#define	OXTABS	(1 << 2)	/* Expand tabs to spaces.  */
-#define	ONOEOT	(1 << 8)	/* Discard EOT (^D) on output.  */
+# define ONLCR	(1 << 1)	/* Map NL to CR-NL on output.  */
+# define OXTABS	(1 << 2)	/* Expand tabs to spaces.  */
+# define ONOEOT	(1 << 8)	/* Discard EOT (^D) on output.  */
 #endif
 
   /* Control modes.  */
   tcflag_t c_cflag;
 #ifdef	__USE_BSD
-#define	CIGNORE	(1 << 0)	/* Ignore these control flags.  */
+# define CIGNORE	(1 << 0)	/* Ignore these control flags.  */
 #endif
 #define	CSIZE	(CS5|CS6|CS7|CS8)	/* Number of bits per byte (mask).  */
 #define	CS5	0		/* 5 bits per byte.  */
@@ -107,15 +111,15 @@ struct termios
 #define	HUPCL	(1 << 14)	/* Hang up on last close.  */
 #define	CLOCAL	(1 << 15)	/* Ignore modem status lines.  */
 #ifdef	__USE_BSD
-#define	CCTS_OFLOW	(1 << 16)	/* CTS flow control of output.  */
-#define	CRTS_IFLOW	(1 << 17)	/* RTS flow control of input.  */
-#define	MDMBUF		(1 << 20)	/* Carrier flow control of output.  */
+# define CCTS_OFLOW	(1 << 16)	/* CTS flow control of output.  */
+# define CRTS_IFLOW	(1 << 17)	/* RTS flow control of input.  */
+# define MDMBUF		(1 << 20)	/* Carrier flow control of output.  */
 #endif
 
   /* Local modes.  */
   tcflag_t c_lflag;
 #ifdef	__USE_BSD
-#define	ECHOKE	(1 << 0)	/* Visual erase for KILL.  */
+# define ECHOKE	(1 << 0)	/* Visual erase for KILL.  */
 #endif
 #define	_ECHOE	(1 << 1)	/* Visual erase for ERASE.  */
 #define	ECHOE	_ECHOE
@@ -126,15 +130,15 @@ struct termios
 #define	_ECHONL	(1 << 4)	/* Echo NL even if ECHO is off.  */
 #define	ECHONL	_ECHONL
 #ifdef	__USE_BSD
-#define	ECHOPRT	(1 << 5)	/* Hardcopy visual erase.  */
-#define	ECHOCTL	(1 << 6)	/* Echo control characters as ^X.  */
+# define ECHOPRT	(1 << 5)	/* Hardcopy visual erase.  */
+# define ECHOCTL	(1 << 6)	/* Echo control characters as ^X.  */
 #endif
 #define	_ISIG	(1 << 7)	/* Enable signals.  */
 #define	ISIG	_ISIG
 #define	_ICANON	(1 << 8)	/* Do erase and kill processing.  */
 #define	ICANON	_ICANON
 #ifdef	__USE_BSD
-#define	ALTWERASE (1 << 9)	/* Alternate WERASE algorithm.  */
+# define ALTWERASE (1 << 9)	/* Alternate WERASE algorithm.  */
 #endif
 #define	_IEXTEN	(1 << 10)	/* Enable DISCARD and LNEXT.  */
 #define	IEXTEN	_IEXTEN
@@ -142,9 +146,9 @@ struct termios
 #define	_TOSTOP	(1 << 22)	/* Send SIGTTOU for background output.  */
 #define	TOSTOP	_TOSTOP
 #ifdef	__USE_BSD
-#define	FLUSHO	(1 << 23)	/* Output being flushed (state).  */
-#define	NOKERNINFO (1 << 25)	/* Disable VSTATUS.  */
-#define	PENDIN	(1 << 29)	/* Retype pending input (state).  */
+# define FLUSHO	(1 << 23)	/* Output being flushed (state).  */
+# define NOKERNINFO (1 << 25)	/* Disable VSTATUS.  */
+# define PENDIN	(1 << 29)	/* Retype pending input (state).  */
 #endif
 #define	_NOFLSH	(1 << 31)	/* Disable flush after interrupt.  */
 #define	NOFLSH	_NOFLSH
@@ -153,32 +157,32 @@ struct termios
 #define	VEOF	0		/* End-of-file character [ICANON].  */
 #define	VEOL	1		/* End-of-line character [ICANON].  */
 #ifdef	__USE_BSD
-#define	VEOL2	2		/* Second EOL character [ICANON].  */
+# define VEOL2	2		/* Second EOL character [ICANON].  */
 #endif
 #define	VERASE	3		/* Erase character [ICANON].  */
 #ifdef	__USE_BSD
-#define	VWERASE	4		/* Word-erase character [ICANON].  */
+# define VWERASE	4		/* Word-erase character [ICANON].  */
 #endif
 #define	VKILL	5		/* Kill-line character [ICANON].  */
 #ifdef	__USE_BSD
-#define	VREPRINT 6		/* Reprint-line character [ICANON].  */
+# define VREPRINT 6		/* Reprint-line character [ICANON].  */
 #endif
 #define	VINTR	8		/* Interrupt character [ISIG].  */
 #define	VQUIT	9		/* Quit character [ISIG].  */
 #define	VSUSP	10		/* Suspend character [ISIG].  */
 #ifdef	__USE_BSD
-#define	VDSUSP	11		/* Delayed suspend character [ISIG].  */
+# define VDSUSP	11		/* Delayed suspend character [ISIG].  */
 #endif
 #define	VSTART	12		/* Start (X-ON) character [IXON, IXOFF].  */
 #define	VSTOP	13		/* Stop (X-OFF) character [IXON, IXOFF].  */
 #ifdef	__USE_BSD
-#define	VLNEXT	14		/* Literal-next character [IEXTEN].  */
-#define	VDISCARD 15		/* Discard character [IEXTEN].  */
+# define VLNEXT	14		/* Literal-next character [IEXTEN].  */
+# define VDISCARD 15		/* Discard character [IEXTEN].  */
 #endif
 #define	VMIN	16		/* Minimum number of bytes read at once [!ICANON].  */
 #define	VTIME	17		/* Time-out value (tenths of a second) [!ICANON].  */
 #ifdef	__USE_BSD
-#define	VSTATUS	18		/* Status character [ICANON].  */
+# define VSTATUS	18		/* Status character [ICANON].  */
 #endif
 #define	NCCS	20		/* Value duplicated in <hurd/tioctl.defs>.  */
   cc_t c_cc[NCCS];
@@ -202,8 +206,8 @@ struct termios
 #define	B19200	19200		/* 19200 baud.  */
 #define	B38400	38400		/* 38400 baud.  */
 #ifdef	__USE_BSD
-#define	EXTA	19200
-#define	EXTB	38400
+# define EXTA	19200
+# define EXTB	38400
 #endif
 };
 
@@ -215,7 +219,7 @@ struct termios
 #define	TCSADRAIN	1	/* Change when pending output is written.  */
 #define	TCSAFLUSH	2	/* Flush pending input before changing.  */
 #ifdef	__USE_BSD
-#define	TCSASOFT	0x10	/* Flag: Don't alter hardware state.  */
+# define TCSASOFT	0x10	/* Flag: Don't alter hardware state.  */
 #endif
 
 /* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
diff --git a/sysdeps/generic/bits/time.h b/sysdeps/generic/bits/time.h
index e41a991b44..cdbd39f91d 100644
--- a/sysdeps/generic/bits/time.h
+++ b/sysdeps/generic/bits/time.h
@@ -21,6 +21,16 @@
  * Never include this file directly; use <time.h> instead.
  */
 
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+#  define _BITS_TIME_H	1
+
+#  define CLOCKS_PER_SEC 60
+
+# endif	/* bits/time.h */
+#endif
+
+
 #ifdef __need_timeval
 # undef __need_timeval
 # ifndef _STRUCT_TIMEVAL
@@ -34,11 +44,3 @@ struct timeval
   };
 # endif	/* struct timeval */
 #endif	/* need timeval */
-
-
-#ifndef _BITS_TIME_H
-#define	_BITS_TIME_H	1
-
-#define CLOCKS_PER_SEC 60
-
-#endif	/* bits/time.h */
diff --git a/sysdeps/generic/bits/uio.h b/sysdeps/generic/bits/uio.h
index 1a12697008..56533c1c58 100644
--- a/sysdeps/generic/bits/uio.h
+++ b/sysdeps/generic/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/generic/bits/utmp.h b/sysdeps/generic/bits/utmp.h
index ccc318bfa1..62817d36d1 100644
--- a/sysdeps/generic/bits/utmp.h
+++ b/sysdeps/generic/bits/utmp.h
@@ -17,12 +17,9 @@
    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
 
-
-#include <features.h>
-
 #include <paths.h>
 #include <time.h>
 
@@ -31,7 +28,6 @@
 #define	UT_LINESIZE	8
 #define	UT_HOSTSIZE	16
 
-__BEGIN_DECLS
 
 struct lastlog
   {
@@ -51,5 +47,3 @@ struct utmp
 
 
 #define _HAVE_UT_HOST 1		/* We have the ut_host field.  */
-
-__END_DECLS
diff --git a/sysdeps/generic/bits/utmpx.h b/sysdeps/generic/bits/utmpx.h
index f85fce0052..e22660f6d6 100644
--- a/sysdeps/generic/bits/utmpx.h
+++ b/sysdeps/generic/bits/utmpx.h
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _UTMPX_H
-#error "Never use <bits/utmpx.h> directly; include <utmpx.h> instead."
+# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
 #endif
 
 
@@ -26,9 +26,9 @@
 #define	__UT_HOSTSIZE	16
 
 struct utmpx
-{
-  char ut_line[__UT_LINESIZE];
-  char ut_name[__UT_NAMESIZE];
-  char ut_host[__UT_HOSTSIZE];
-  long ut_time;
-};
+  {
+    char ut_line[__UT_LINESIZE];
+    char ut_name[__UT_NAMESIZE];
+    char ut_host[__UT_HOSTSIZE];
+    long int ut_time;
+  };
diff --git a/sysdeps/generic/bits/utsname.h b/sysdeps/generic/bits/utsname.h
index 5594bcc4da..ea3f163cef 100644
--- a/sysdeps/generic/bits/utsname.h
+++ b/sysdeps/generic/bits/utsname.h
@@ -1,3 +1,25 @@
+/* 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
+
 /* The size of the character arrays used to hold the information
    in a `struct utsname'.  Enlarge this as necessary.  */
 #define	_UTSNAME_LENGTH	1024
diff --git a/sysdeps/generic/bits/waitflags.h b/sysdeps/generic/bits/waitflags.h
index 127eb6ce4c..596df932b7 100644
--- a/sysdeps/generic/bits/waitflags.h
+++ b/sysdeps/generic/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/generic/bits/waitstatus.h b/sysdeps/generic/bits/waitstatus.h
index 8e97f2702c..1ec55107f9 100644
--- a/sysdeps/generic/bits/waitstatus.h
+++ b/sysdeps/generic/bits/waitstatus.h
@@ -18,7 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_WAIT_H
-#error "Never use <bits/waitstatus.h> directly; include <sys/wait.h> instead."
+# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
 #endif
 
 
@@ -39,11 +39,11 @@
 
 /* Nonzero if STATUS indicates termination by a signal.  */
 #ifdef	__GNUC__
-#define	__WIFSIGNALED(status)						      \
+# define __WIFSIGNALED(status) \
   (__extension__ ({ int __status = (status);				      \
 		    !__WIFSTOPPED(__status) && !__WIFEXITED(__status); }))
 #else	/* Not GCC.  */
-#define	__WIFSIGNALED(status)	(!__WIFSTOPPED(status) && !__WIFEXITED(status))
+# define __WIFSIGNALED(status)	(!__WIFSTOPPED(status) && !__WIFEXITED(status))
 #endif	/* GCC.  */
 
 /* Nonzero if STATUS indicates the child is stopped.  */
@@ -60,45 +60,45 @@
 
 #ifdef	__USE_BSD
 
-#include <endian.h>
+# include <endian.h>
 
 union wait
   {
     int w_status;
     struct
       {
-#if	__BYTE_ORDER == __LITTLE_ENDIAN
+# if	__BYTE_ORDER == __LITTLE_ENDIAN
 	unsigned int __w_termsig:7; /* Terminating signal.  */
 	unsigned int __w_coredump:1; /* Set if dumped core.  */
 	unsigned int __w_retcode:8; /* Return code if exited normally.  */
 	unsigned int:16;
-#endif				/* Little endian.  */
-#if	__BYTE_ORDER == __BIG_ENDIAN
+# endif				/* Little endian.  */
+# if	__BYTE_ORDER == __BIG_ENDIAN
 	unsigned int:16;
 	unsigned int __w_retcode:8;
 	unsigned int __w_coredump:1;
 	unsigned int __w_termsig:7;
-#endif				/* Big endian.  */
+# endif				/* Big endian.  */
       } __wait_terminated;
     struct
       {
-#if	__BYTE_ORDER == __LITTLE_ENDIAN
+# if	__BYTE_ORDER == __LITTLE_ENDIAN
 	unsigned int __w_stopval:8; /* W_STOPPED if stopped.  */
 	unsigned int __w_stopsig:8; /* Stopping signal.  */
 	unsigned int:16;
-#endif				/* Little endian.  */
-#if	__BYTE_ORDER == __BIG_ENDIAN
+# endif				/* Little endian.  */
+# if	__BYTE_ORDER == __BIG_ENDIAN
 	unsigned int:16;
 	unsigned int __w_stopsig:8; /* Stopping signal.  */
 	unsigned int __w_stopval:8; /* W_STOPPED if stopped.  */
-#endif				/* Big endian.  */
+# endif				/* Big endian.  */
       } __wait_stopped;
   };
 
-#define	w_termsig	__wait_terminated.__w_termsig
-#define	w_coredump	__wait_terminated.__w_coredump
-#define	w_retcode	__wait_terminated.__w_retcode
-#define	w_stopsig	__wait_stopped.__w_stopsig
-#define	w_stopval	__wait_stopped.__w_stopval
+# define w_termsig	__wait_terminated.__w_termsig
+# define w_coredump	__wait_terminated.__w_coredump
+# define w_retcode	__wait_terminated.__w_retcode
+# define w_stopsig	__wait_stopped.__w_stopsig
+# define w_stopval	__wait_stopped.__w_stopval
 
 #endif	/* Use BSD.  */
diff --git a/sysdeps/generic/strcasestr.c b/sysdeps/generic/strcasestr.c
new file mode 100644
index 0000000000..ec8727d268
--- /dev/null
+++ b/sysdeps/generic/strcasestr.c
@@ -0,0 +1,129 @@
+/* Return the offset of one string within another.
+   Copyright (C) 1994, 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.  */
+
+/*
+ * My personal strstr() implementation that beats most other algorithms.
+ * Until someone tells me otherwise, I assume that this is the
+ * fastest implementation of strstr() in C.
+ * I deliberately chose not to comment it.  You should have at least
+ * as much fun trying to understand it, as I had to write it :-).
+ *
+ * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de	*/
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+
+#if defined _LIBC || defined HAVE_STRING_H
+# include <string.h>
+#endif
+
+typedef unsigned chartype;
+
+#undef strstr
+
+char *
+__strcasestr (phaystack, pneedle)
+     const char *phaystack;
+     const char *pneedle;
+{
+  register const unsigned char *haystack, *needle;
+  register chartype b, c;
+
+  haystack = (const unsigned char *) phaystack;
+  needle = (const unsigned char *) pneedle;
+
+  b = tolower (*needle);
+  if (b != '\0')
+    {
+      haystack--;				/* possible ANSI violation */
+      do
+	{
+	  c = *++haystack;
+	  if (c == '\0')
+	    goto ret0;
+	}
+      while (tolower (c) != b);
+
+      c = tolower (*++needle);
+      if (c == '\0')
+	goto foundneedle;
+      ++needle;
+      goto jin;
+
+      for (;;)
+        {
+          register chartype a;
+	  register const unsigned char *rhaystack, *rneedle;
+
+	  do
+	    {
+	      a = *++haystack;
+	      if (a == '\0')
+		goto ret0;
+	      if (tolower (a) == b)
+		break;
+	      a = *++haystack;
+	      if (a == '\0')
+		goto ret0;
+shloop:	    }
+          while (tolower (a) != b);
+
+jin:	  a = *++haystack;
+	  if (a == '\0')
+	    goto ret0;
+
+	  if (tolower (a) != c)
+	    goto shloop;
+
+	  rhaystack = haystack-- + 1;
+	  rneedle = needle;
+	  a = tolower (*rneedle);
+
+	  if (tolower (*rhaystack) == a)
+	    do
+	      {
+		if (a == '\0')
+		  goto foundneedle;
+		++rhaystack;
+		a = tolower (*++needle);
+		if (tolower (*rhaystack) != a)
+		  break;
+		if (a == '\0')
+		  goto foundneedle;
+		++rhaystack;
+		a = tolower (*++needle);
+	      }
+	    while (tolower (*rhaystack) == a);
+
+	  needle = rneedle;		/* took the register-poor approach */
+
+	  if (a == '\0')
+	    break;
+        }
+    }
+foundneedle:
+  return (char*) haystack;
+ret0:
+  return 0;
+}
+
+weak_alias (__strcasestr, strcasestr)
diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h
index 163f6427ec..6a0beb61a9 100644
--- a/sysdeps/gnu/bits/utmp.h
+++ b/sysdeps/gnu/bits/utmp.h
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _UTMP_H
-#error "Never use <bits/utmp.h> directly; include <utmpx.h> instead."
+# error "Never include <bits/utmp.h> directly; use <utmpx.h> instead."
 #endif
 
 #include <paths.h>
@@ -33,38 +33,38 @@
 /* The structure describing an entry in the database of
    previous logins.  */
 struct lastlog
-{
-  time_t ll_time;
-  char ll_line[UT_LINESIZE];
-  char ll_host[UT_HOSTSIZE];
-};
+  {
+    __time_t ll_time;
+    char ll_line[UT_LINESIZE];
+    char ll_host[UT_HOSTSIZE];
+  };
 
 
 /* The structure describing the status of a terminated process.  This
    type is used in `struct utmp' below.  */
 struct exit_status
-{
-  short int e_termination;	/* Process termination status.  */
-  short int e_exit;		/* Process exit status.  */
-};
+  {
+    short int e_termination;	/* Process termination status.  */
+    short int e_exit;		/* Process exit status.  */
+  };
 
 
 /* The structure describing an entry in the user accounting database.  */
 struct utmp
-{
-  short int ut_type;		/* Type of login.  */
-  pid_t ut_pid;			/* Process ID of login process.  */
-  char ut_line[UT_LINESIZE];	/* Devicename.  */
-  char ut_id[4];		/* Inittab ID.  */
-  char ut_user[UT_NAMESIZE];	/* Username.  */
-  char ut_host[UT_HOSTSIZE];	/* Hostname for remote login.  */
-  struct exit_status ut_exit;	/* Exit status of a process marked
+  {
+    short int ut_type;		/* Type of login.  */
+    pid_t ut_pid;		/* Process ID of login process.  */
+    char ut_line[UT_LINESIZE];	/* Devicename.  */
+    char ut_id[4];		/* Inittab ID.  */
+    char ut_user[UT_NAMESIZE];	/* Username.  */
+    char ut_host[UT_HOSTSIZE];	/* Hostname for remote login.  */
+    struct exit_status ut_exit;	/* Exit status of a process marked
 				   as DEAD_PROCESS.  */
-  long ut_session;		/* Session ID, used for windowing.  */
-  struct timeval ut_tv;		/* Time entry was made.  */
-  int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
-  char pad[20];			/* Reserved for future use.  */
-};
+    long ut_session;		/* Session ID, used for windowing.  */
+    struct timeval ut_tv;	/* Time entry was made.  */
+    int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
+    char pad[20];		/* Reserved for future use.  */
+  };
 
 /* Backwards compatibility hacks.  */
 #define ut_name		ut_user
diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h
index 4f1a876d0a..4ecbb3a026 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/sysdeps/gnu/bits/utmpx.h
@@ -1,6 +1,5 @@
 /* Structures and defenitions for the user accounting database.  GNU version.
    Copyright (C) 1997 Free Software Foundation, Inc.
-   Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
 
    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
@@ -18,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _UTMPX_H
-#error "Never use <bits/utmpx.h> directly; include <utmpx.h> instead."
+# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
 #endif
 
 #include <bits/types.h>
@@ -29,14 +28,14 @@
 #define __UT_NAMESIZE	32
 #define __UT_HOSTSIZE	256
 
-   
+
 /* The structure describing the status of a terminated process.  This
    type is used in `struct utmpx' below.  */
 struct __exit_status
-{
-  short int e_termination;	/* Process termination status.  */
-  short int e_exit;		/* Process exit status.  */
-};
+  {
+    short int e_termination;	/* Process termination status.  */
+    short int e_exit;		/* Process exit status.  */
+  };
 
 
 /* The structure describing an entry in the user accounting database.  */
@@ -50,7 +49,7 @@ struct utmpx
   char ut_host[__UT_HOSTSIZE];	/* Hostname for remote login.  */
   struct __exit_status ut_exit;	/* Exit status of a process marked
 				   as DEAD_PROCESS.  */
-  long ut_session;		/* Session ID, used for windowing.  */
+  long int ut_session;		/* Session ID, used for windowing.  */
   struct timeval ut_tv;		/* Time entry was made.  */
   __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
   char pad[20];			/* Reserved for future use.  */
@@ -69,11 +68,3 @@ struct utmpx
 #define LOGIN_PROCESS	6	/* Session leader of a logged in user.  */
 #define USER_PROCESS	7	/* Normal process.  */
 #define DEAD_PROCESS	8	/* Terminated process.  */
-
-
-
-
-
-
-
-
diff --git a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S
index 0ec5d26a38..7e039deb8f 100644
--- a/sysdeps/i386/__longjmp.S
+++ b/sysdeps/i386/__longjmp.S
@@ -19,6 +19,7 @@
 
 #include <sysdep.h>
 #define _ASM
+#define _SETJMP_H
 #include <bits/setjmp.h>
 
 ENTRY (__longjmp)
diff --git a/sysdeps/i386/bits/byteswap.h b/sysdeps/i386/bits/byteswap.h
index 326962e621..bf55c890ba 100644
--- a/sysdeps/i386/bits/byteswap.h
+++ b/sysdeps/i386/bits/byteswap.h
@@ -17,8 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H	1
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
 
 /* Swap bytes in 16 bit value.  */
 #define __bswap_constant_16(x) \
@@ -88,5 +89,3 @@
 	__r.__l[1] = __bswap_32 (__v.__l[0]);				      \
 	__r.__ll; })
 #endif
-
-#endif /* bits/byteswap.h */
diff --git a/sysdeps/i386/bits/endian.h b/sysdeps/i386/bits/endian.h
index a5d6c5ea92..54bd9d14bb 100644
--- a/sysdeps/i386/bits/endian.h
+++ b/sysdeps/i386/bits/endian.h
@@ -1,3 +1,7 @@
 /* i386 is little-endian.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysdeps/i386/bits/huge_val.h b/sysdeps/i386/bits/huge_val.h
index 65a06d8f3c..23127b4031 100644
--- a/sysdeps/i386/bits/huge_val.h
+++ b/sysdeps/i386/bits/huge_val.h
@@ -19,12 +19,10 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _MATH_H
-#error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
 #endif
 
-
 #include <features.h>
-#include <sys/cdefs.h>
 
 /* IEEE positive infinity (-HUGE_VAL is negative infinity).  */
 
@@ -32,11 +30,11 @@
 
 #define __huge_val_t	union { unsigned char __c[8]; double __d; }
 #ifdef	__GNUC__
-#define	HUGE_VAL	(__extension__ \
+# define HUGE_VAL	(__extension__ \
 			 ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
 #else	/* Not GCC.  */
 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
-#define	HUGE_VAL	(__huge_val.__d)
+# define HUGE_VAL	(__huge_val.__d)
 #endif	/* GCC.  */
 
 
@@ -44,27 +42,27 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 
 #ifdef __USE_ISOC9X
 
-#define	__HUGE_VALF_bytes	{ 0, 0, 0x80, 0x7f }
+# define __HUGE_VALF_bytes	{ 0, 0, 0x80, 0x7f }
 
-#define __huge_valf_t	union { unsigned char __c[4]; float __f; }
-#ifdef	__GNUC__
-#define	HUGE_VALF	(__extension__ \
+# define __huge_valf_t	union { unsigned char __c[4]; float __f; }
+# ifdef	__GNUC__
+#  define HUGE_VALF	(__extension__ \
 			 ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f)
-#else	/* Not GCC.  */
+# else	/* Not GCC.  */
 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
-#define	HUGE_VALF	(__huge_valf.__f)
-#endif	/* GCC.  */
+#  define HUGE_VALF	(__huge_valf.__f)
+# endif	/* GCC.  */
 
 
-#define	__HUGE_VALL_bytes	{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
+# define __HUGE_VALL_bytes	{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
 
-#define __huge_vall_t	union { unsigned char __c[12]; long double __ld; }
-#ifdef	__GNUC__
-#define	HUGE_VALL	(__extension__ \
+# define __huge_vall_t	union { unsigned char __c[12]; long double __ld; }
+# ifdef	__GNUC__
+#  define HUGE_VALL	(__extension__ \
 			 ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
-#else	/* Not GCC.  */
+# else	/* Not GCC.  */
 static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
-#define	HUGE_VALL	(__huge_vall.__ld)
-#endif	/* GCC.  */
+#  define HUGE_VALL	(__huge_vall.__ld)
+# endif	/* GCC.  */
 
 #endif	/* __USE_ISOC9X.  */
diff --git a/sysdeps/i386/bits/setjmp.h b/sysdeps/i386/bits/setjmp.h
index 0c03073b36..5cb60a8c7d 100644
--- a/sysdeps/i386/bits/setjmp.h
+++ b/sysdeps/i386/bits/setjmp.h
@@ -1,12 +1,16 @@
 /* Define the machine-dependent type `jmp_buf'.  Intel 386 version.  */
 
-#if	defined (__USE_MISC) || defined (_ASM)
-#define	JB_BX	0
-#define	JB_SI	1
-#define	JB_DI	2
-#define	JB_BP	3
-#define	JB_SP	4
-#define	JB_PC	5
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+#if defined __USE_MISC || defined _ASM
+# define JB_BX	0
+# define JB_SI	1
+# define JB_DI	2
+# define JB_BP	3
+# define JB_SP	4
+# define JB_PC	5
 #endif
 
 #ifndef	_ASM
diff --git a/sysdeps/i386/elf/setjmp.S b/sysdeps/i386/elf/setjmp.S
index d73e84364f..bc4890c215 100644
--- a/sysdeps/i386/elf/setjmp.S
+++ b/sysdeps/i386/elf/setjmp.S
@@ -19,6 +19,7 @@
 
 #include <sysdep.h>
 #define _ASM
+#define _SETJMP_H
 #include <bits/setjmp.h>
 
 	/* We include the BSD entry points here as well but we make
diff --git a/sysdeps/i386/fpu/bits/fenv.h b/sysdeps/i386/fpu/bits/fenv.h
index 63f3e52958..4d06b01be3 100644
--- a/sysdeps/i386/fpu/bits/fenv.h
+++ b/sysdeps/i386/fpu/bits/fenv.h
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _FENV_H
-#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
 #endif
 
 
@@ -61,7 +61,8 @@ enum
 typedef unsigned short int fexcept_t;
 
 
-/* Type representing floating-point environment.  This function corresponds to the layout of the block written by the `fstenv'.  */
+/* Type representing floating-point environment.  This function corresponds
+   to the layout of the block written by the `fstenv'.  */
 typedef struct
   {
     unsigned short int control_word;
diff --git a/sysdeps/ieee754/bits/huge_val.h b/sysdeps/ieee754/bits/huge_val.h
index fe0144c734..f49d65661a 100644
--- a/sysdeps/ieee754/bits/huge_val.h
+++ b/sysdeps/ieee754/bits/huge_val.h
@@ -19,37 +19,35 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _MATH_H
-#error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
 #endif
 
-
 #include <features.h>
 
 /* IEEE positive infinity (-HUGE_VAL is negative infinity).  */
 
 #ifdef	__GNUC__
 
-#define HUGE_VAL                                                            \
-  (__extension__                                                            \
-   ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
+# define HUGE_VAL \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
     { __l: 0x7ff0000000000000ULL }).__d)
 
 #else /* not GCC */
 
-#include <sys/cdefs.h>
-#include <endian.h>
+# include <endian.h>
 
 typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
 
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define	__HUGE_VAL_bytes	{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define	__HUGE_VAL_bytes	{ 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
-#endif
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __HUGE_VAL_bytes	{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define __HUGE_VAL_bytes	{ 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+# endif
 
 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
-#define	HUGE_VAL	(__huge_val.__d)
+# define HUGE_VAL	(__huge_val.__d)
 
 #endif	/* GCC.  */
 
@@ -58,32 +56,32 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 
 #ifdef __USE_ISOC9X
 
-#ifdef __GNUC__
+# ifdef __GNUC__
 
-#define HUGE_VALF                                                           \
-  (__extension__                                                            \
-   ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })  \
+#  define HUGE_VALF \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
     { __l: 0x7f800000UL }).__d)
 
-#else /* not GCC */
+# else /* not GCC */
 
 typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
 
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define	__HUGE_VALF_bytes	{ 0x7f, 0x80, 0, 0 }
-#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define	__HUGE_VALF_bytes	{ 0, 0, 0x80, 0x7f }
-#endif
+#  if __BYTE_ORDER == __BIG_ENDIAN
+#   define __HUGE_VALF_bytes	{ 0x7f, 0x80, 0, 0 }
+#  endif
+#  if __BYTE_ORDER == __LITTLE_ENDIAN
+#   define __HUGE_VALF_bytes	{ 0, 0, 0x80, 0x7f }
+#  endif
 
 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
-#define	HUGE_VALF	(__huge_valf.__f)
+#  define HUGE_VALF	(__huge_valf.__f)
 
-#endif	/* GCC.  */
+# endif	/* GCC.  */
 
 
 /* Generally there is no separate `long double' format and it is the
    same as `double'.  */
-#define HUGE_VALL HUGE_VAL
+# define HUGE_VALL HUGE_VAL
 
 #endif /* __USE_ISOC9X.  */
diff --git a/sysdeps/m68k/bits/byteswap.h b/sysdeps/m68k/bits/byteswap.h
index 54ec0d1920..41bbe59782 100644
--- a/sysdeps/m68k/bits/byteswap.h
+++ b/sysdeps/m68k/bits/byteswap.h
@@ -17,8 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H	1
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
 
 /* Swap bytes in 16 bit value.  We don't provide an assembler version
    because GCC is smart enough to generate optimal assembler output, and
@@ -32,7 +33,7 @@
    (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
 
 #if defined __GNUC__ && __GNUC__ >= 2
-#define __bswap_32(x) \
+# define __bswap_32(x) \
   __extension__					\
   ({ unsigned int __v;				\
      if (__builtin_constant_p (x))		\
@@ -45,12 +46,12 @@
 			     : "0" (x));	\
      __v; })
 #else
-#define __bswap_32(x) __bswap_constant_32 (x)
+# define __bswap_32(x) __bswap_constant_32 (x)
 #endif
 
 #if defined __GNUC__ && __GNUC__ >= 2
 /* Swap bytes in 64 bit value.  */
-#define __bswap_64(x) \
+# define __bswap_64(x) \
   __extension__						\
   ({ union { unsigned long long int __ll;		\
 	     unsigned long int __l[2]; } __v, __r;	\
@@ -59,5 +60,3 @@
      __r.__l[1] = __bswap_32 (__v.__l[0]);		\
      __r.__ll; })
 #endif
-
-#endif /* bits/byteswap.h */
diff --git a/sysdeps/m68k/bits/endian.h b/sysdeps/m68k/bits/endian.h
index 6f985293f2..bf4ecb60a4 100644
--- a/sysdeps/m68k/bits/endian.h
+++ b/sysdeps/m68k/bits/endian.h
@@ -1,3 +1,7 @@
 /* m68k is big-endian.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __BIG_ENDIAN
diff --git a/sysdeps/m68k/bits/setjmp.h b/sysdeps/m68k/bits/setjmp.h
index 96240f0d8e..2991232915 100644
--- a/sysdeps/m68k/bits/setjmp.h
+++ b/sysdeps/m68k/bits/setjmp.h
@@ -1,5 +1,9 @@
 /* Define the machine-dependent type `jmp_buf'.  m68k version.  */
 
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
 typedef struct
   {
     /* There are eight 4-byte data registers, but D0 is not saved.  */
@@ -7,10 +11,10 @@ typedef struct
 
     /* There are six 4-byte address registers, plus the FP and SP.  */
     int *__aregs[6];
-    int * __fp;
-    int * __sp;
+    int *__fp;
+    int *__sp;
 
-#if defined(__HAVE_68881__) || defined(__HAVE_FPU__)
+#if defined __HAVE_68881__ || defined __HAVE_FPU__
     /* There are eight floating point registers which
        are saved in IEEE 96-bit extended format.  */
     char __fpregs[8 * (96 / 8)];
diff --git a/sysdeps/m68k/fpu/bits/fenv.h b/sysdeps/m68k/fpu/bits/fenv.h
index ce071b93ff..a11e0724f1 100644
--- a/sysdeps/m68k/fpu/bits/fenv.h
+++ b/sysdeps/m68k/fpu/bits/fenv.h
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _FENV_H
-#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
 #endif
 
 
diff --git a/sysdeps/mach/hurd/alpha/bits/sigcontext.h b/sysdeps/mach/hurd/alpha/bits/sigcontext.h
index 3b17a4ada8..a2c8163599 100644
--- a/sysdeps/mach/hurd/alpha/bits/sigcontext.h
+++ b/sysdeps/mach/hurd/alpha/bits/sigcontext.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 use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
 /* Signal handlers are actually called:
    void handler (int sig, int code, struct sigcontext *scp);  */
 
diff --git a/sysdeps/mach/hurd/bits/ioctls.h b/sysdeps/mach/hurd/bits/ioctls.h
index b04438bcca..a5dc446c67 100644
--- a/sysdeps/mach/hurd/bits/ioctls.h
+++ b/sysdeps/mach/hurd/bits/ioctls.h
@@ -16,32 +16,29 @@
    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
 
 /* These macros are also defined in <bits/termios.h> (with numerically
    identical values) but this serves to shut up cpp's complaining. */
 #ifdef MDMBUF
-#undef MDMBUF
+# undef MDMBUF
 #endif
 #ifdef ECHO
-#undef ECHO
+# undef ECHO
 #endif
 #ifdef TOSTOP
-#undef TOSTOP
+# undef TOSTOP
 #endif
 #ifdef FLUSHO
-#undef FLUSHO
+# undef FLUSHO
 #endif
 #ifdef PENDIN
-#undef PENDIN
+# undef PENDIN
 #endif
 #ifdef NOFLSH
-#undef NOFLSH
+# undef NOFLSH
 #endif
 
 /* Hurd ioctl request are made up of several fields:
@@ -331,23 +328,20 @@ enum __ioctl_datum { IOC_8, IOC_16, IOC_32, IOC_64 };
 
 /* From 4.4 <sys/ttydev.h>.   */
 #ifdef USE_OLD_TTY
-#define B0	0
-#define B50	1
-#define B75	2
-#define B110	3
-#define B134	4
-#define B150	5
-#define B200	6
-#define B300	7
-#define B600	8
-#define B1200	9
-#define	B1800	10
-#define B2400	11
-#define B4800	12
-#define B9600	13
-#define EXTA	14
-#define EXTB	15
+# define B0	0
+# define B50	1
+# define B75	2
+# define B110	3
+# define B134	4
+# define B150	5
+# define B200	6
+# define B300	7
+# define B600	8
+# define B1200	9
+# define B1800	10
+# define B2400	11
+# define B4800	12
+# define B9600	13
+# define EXTA	14
+# define EXTB	15
 #endif /* USE_OLD_TTY */
-
-
-#endif /* bits/ioctls.h */
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index 4679c589ee..df50a0901f 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/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
 
 #include <bits/types.h>
 
@@ -189,6 +186,3 @@ struct stat64
 #ifdef	__USE_BSD
 #define	CMASK		0022
 #endif
-
-
-#endif /* bits/stat.h */
diff --git a/sysdeps/mach/hurd/hppa/bits/sigcontext.h b/sysdeps/mach/hurd/hppa/bits/sigcontext.h
index f450125463..f0b4ff7a9b 100644
--- a/sysdeps/mach/hurd/hppa/bits/sigcontext.h
+++ b/sysdeps/mach/hurd/hppa/bits/sigcontext.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 use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
 /* Signal handlers are actually called:
    void handler (int sig, int code, struct sigcontext *scp);  */
 
diff --git a/sysdeps/mach/hurd/i386/bits/sigcontext.h b/sysdeps/mach/hurd/i386/bits/sigcontext.h
index 6539cf97d6..c5edb3119e 100644
--- a/sysdeps/mach/hurd/i386/bits/sigcontext.h
+++ b/sysdeps/mach/hurd/i386/bits/sigcontext.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 use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
 /* Signal handlers are actually called:
    void handler (int sig, int code, struct sigcontext *scp);  */
 
diff --git a/sysdeps/mach/hurd/mips/bits/sigcontext.h b/sysdeps/mach/hurd/mips/bits/sigcontext.h
index 64a57ab086..910618e32a 100644
--- a/sysdeps/mach/hurd/mips/bits/sigcontext.h
+++ b/sysdeps/mach/hurd/mips/bits/sigcontext.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 use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
 /* Signal handlers are actually called:
    void handler (int sig, int code, struct sigcontext *scp);  */
 
diff --git a/sysdeps/mips/bits/dlfcn.h b/sysdeps/mips/bits/dlfcn.h
index 636da5662d..c105537dfd 100644
--- a/sysdeps/mips/bits/dlfcn.h
+++ b/sysdeps/mips/bits/dlfcn.h
@@ -17,8 +17,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef	_BITS_DLFCN_H
-#define	_BITS_DLFCN_H 1
+#ifndef _DLFCN_H
+# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
+#endif
 
 /* The MODE argument to `dlopen' contains one of the following: */
 #define RTLD_LAZY	0x001	/* Lazy function call binding.  */
@@ -33,10 +34,9 @@
 __BEGIN_DECLS
 
 /* Some SGI specific calls that aren't implemented yet.  */
-extern void *sgidladd __P ((const char *, int));
-extern void *sgidlopen_version __P ((const char *, int, const char *, int));
-extern char *sgigetdsoversion __P ((const char *));
+extern void *sgidladd __P ((__const char *, int));
+extern void *sgidlopen_version __P ((__const char *, int, __const char *,
+				     int));
+extern char *sgigetdsoversion __P ((__const char *));
 
 __END_DECLS
-
-#endif	/* bits/dlfcn.h */
diff --git a/sysdeps/mips/bits/endian.h b/sysdeps/mips/bits/endian.h
index ba555cd76e..40321a2866 100644
--- a/sysdeps/mips/bits/endian.h
+++ b/sysdeps/mips/bits/endian.h
@@ -1,4 +1,8 @@
 /* The MIPS architecture has selectable endianness.
    This file is for a machine using big-endian mode.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __BIG_ENDIAN
diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h
index 7e570c6bff..ff3d75f821 100644
--- a/sysdeps/mips/bits/setjmp.h
+++ b/sysdeps/mips/bits/setjmp.h
@@ -1,6 +1,5 @@
 /* Define the machine-dependent type `jmp_buf'.  MIPS version.
    Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
-   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,6 +16,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
 typedef struct
   {
     /* Program counter.  */
diff --git a/sysdeps/mips/dec/bits/endian.h b/sysdeps/mips/dec/bits/endian.h
index 157bc44d06..0bdb378944 100644
--- a/sysdeps/mips/dec/bits/endian.h
+++ b/sysdeps/mips/dec/bits/endian.h
@@ -1,4 +1,8 @@
 /* The MIPS architecture has selectable endianness.
    The DECstation uses little-endian mode.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysdeps/mips/mips64/bits/setjmp.h b/sysdeps/mips/mips64/bits/setjmp.h
index b108540505..9f08f4e1af 100644
--- a/sysdeps/mips/mips64/bits/setjmp.h
+++ b/sysdeps/mips/mips64/bits/setjmp.h
@@ -1,7 +1,6 @@
 /* Define the machine-dependent type `jmp_buf'.  MIPS version.
    Copyright (C) 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
@@ -18,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
 typedef struct
   {
     /* Program counter.  */
diff --git a/sysdeps/mips/mipsel/bits/endian.h b/sysdeps/mips/mipsel/bits/endian.h
index 5da5965cb2..2241190a70 100644
--- a/sysdeps/mips/mipsel/bits/endian.h
+++ b/sysdeps/mips/mipsel/bits/endian.h
@@ -1,4 +1,8 @@
 /* The MIPS architecture has selectable endianness.
    This file is for a machine using little-endian mode.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysdeps/mips/p40/bits/endian.h b/sysdeps/mips/p40/bits/endian.h
index e4b0119433..f6cdde2cb3 100644
--- a/sysdeps/mips/p40/bits/endian.h
+++ b/sysdeps/mips/p40/bits/endian.h
@@ -1,4 +1,8 @@
 /* The MIPS has selectable endianness.
    The Japanese homebrew P40 architecture uses big-endian mode.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __BIG_ENDIAN
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index d40d8d6822..c7fda3eb2c 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -217,6 +217,7 @@ __getcwd (buf, size)
   char *path;
   register char *pathp;
   struct stat st;
+  int prev_errno = errno;
 
   if (size == 0)
     {
@@ -310,6 +311,9 @@ __getcwd (buf, size)
       dirstream = __opendir (dotp);
       if (dirstream == NULL)
 	goto lose;
+      /* Clear errno to distinguish EOF from error if readdir returns
+	 NULL.  */
+      __set_errno (0);
       while ((d = __readdir (dirstream)) != NULL)
 	{
 	  if (d->d_name[0] == '.' &&
@@ -343,6 +347,10 @@ __getcwd (buf, size)
 	{
 	  int save = errno;
 	  (void) __closedir (dirstream);
+	  if (save == 0)
+	    /* EOF on dirstream, which means that the current directory
+	       has been removed.  */
+	    save = ENOENT;
 	  __set_errno (save);
 	  goto lose;
 	}
@@ -393,6 +401,10 @@ __getcwd (buf, size)
     free ((__ptr_t) dotlist);
 
   memmove (path, pathp, path + size - pathp);
+
+  /* Restore errno on successful return.  */
+  __set_errno (prev_errno);
+
   return path;
 
  lose:
diff --git a/sysdeps/posix/mk-stdiolim.c b/sysdeps/posix/mk-stdiolim.c
index 7009c4ef10..c268b642de 100644
--- a/sysdeps/posix/mk-stdiolim.c
+++ b/sysdeps/posix/mk-stdiolim.c
@@ -21,6 +21,32 @@
 int
 main()
 {
+  /* Print copyright message.  */
+  printf ("\
+/* Stdio limits for POSIX systems.\n\
+   Copyright (C) 1994, 1997 Free Software Foundation, Inc.\n\
+   This file is part of the GNU C Library.\n\
+\n\
+   The GNU C Library is free software; you can redistribute it and/or\n\
+   modify it under the terms of the GNU Library General Public License as\n\
+   published by the Free Software Foundation; either version 2 of the\n\
+   License, or (at your option) any later version.\n\
+\n\
+   The GNU C Library is distributed in the hope that it will be useful,\n\
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n\
+   Library General Public License for more details.\n\
+\n\
+   You should have received a copy of the GNU Library General Publicn\n\
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,\n\
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n\
+   Boston, MA 02111-1307, USA.  */\n\
+\n\
+#ifndef _STDIO_H\n\
+# error \"Never include <bits/stdio_lim.h> directly; use <stdio.h> instead.\"\n\
+#endif\n\
+\n");
+
   /* These values correspond to the code in sysdeps/posix/tempname.c.
      Change the values here if you change that code.  */
   printf ("#define L_tmpnam %u\n", sizeof ("/usr/tmp/") + 9);
diff --git a/sysdeps/powerpc/bits/endian.h b/sysdeps/powerpc/bits/endian.h
index d3ff74f12f..9259da8039 100644
--- a/sysdeps/powerpc/bits/endian.h
+++ b/sysdeps/powerpc/bits/endian.h
@@ -18,6 +18,10 @@
 
 /* PowerPC can be little or big endian.  Hopefully gcc will know...  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN
 # if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
 #  error Please fix sysdeps/powerpc/bits/endian.h (compiling bi-endian?).
diff --git a/sysdeps/powerpc/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h
index 9bb6600324..14fbda8db0 100644
--- a/sysdeps/powerpc/bits/fenv.h
+++ b/sysdeps/powerpc/bits/fenv.h
@@ -52,44 +52,44 @@ enum
 
     /* Operation with SNaN. */
     FE_INVALID_SNAN = 1 << 31-7,
-#define FE_INVALID_SNAN	FE_INVALID_SNAN
+# define FE_INVALID_SNAN	FE_INVALID_SNAN
 
     /* Inf - Inf */
     FE_INVALID_ISI = 1 << 31-8,
-#define FE_INVALID_ISI	FE_INVALID_ISI
+# define FE_INVALID_ISI		FE_INVALID_ISI
 
     /* Inf / Inf */
     FE_INVALID_IDI = 1 << 31-9,
-#define FE_INVALID_IDI	FE_INVALID_IDI
+# define FE_INVALID_IDI		FE_INVALID_IDI
 
     /* 0 / 0 */
     FE_INVALID_ZDZ = 1 << 31-10,
-#define FE_INVALID_ZDZ	FE_INVALID_ZDZ
+# define FE_INVALID_ZDZ		FE_INVALID_ZDZ
 
     /* Inf * 0 */
     FE_INVALID_IMZ = 1 << 31-11,
-#define FE_INVALID_IMZ	FE_INVALID_IMZ
+# define FE_INVALID_IMZ		FE_INVALID_IMZ
 
     /* Comparison with NaN or SNaN.  */
     FE_INVALID_COMPARE = 1 << 31-12,
-#define FE_INVALID_COMPARE	FE_INVALID_COMPARE
+# define FE_INVALID_COMPARE	FE_INVALID_COMPARE
 
     /* Invalid operation flag for software (not set by hardware).  */
     /* Note that some chips don't have this implemented, presumably
        because no-one expected anyone to write software for them %-).  */
     FE_INVALID_SOFTWARE = 1 << 31-21,
-#define FE_INVALID_SOFTWARE	FE_INVALID_SOFTWARE
+# define FE_INVALID_SOFTWARE	FE_INVALID_SOFTWARE
 
     /* Square root of negative number (including -Inf).  */
     /* Note that some chips don't have this implemented.  */
     FE_INVALID_SQRT = 1 << 31-22,
-#define FE_INVALID_SQRT	FE_INVALID_SQRT
+# define FE_INVALID_SQRT	FE_INVALID_SQRT
 
     /* Conversion-to-integer of a NaN or a number too large or too small.  */
     FE_INVALID_INTEGER_CONVERSION = 1 << 31-23,
-#define FE_INVALID_INTEGER_CONVERSION	FE_INVALID_INTEGER_CONVERSION
+# define FE_INVALID_INTEGER_CONVERSION	FE_INVALID_INTEGER_CONVERSION
 
-#define FE_ALL_INVALID \
+# define FE_ALL_INVALID \
         (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \
 	 | FE_INVALID_IMZ | FE_INVALID_COMPARE | FE_INVALID_SOFTWARE \
 	 | FE_INVALID_SQRT | FE_INVALID_INTEGER_CONVERSION)
diff --git a/sysdeps/powerpc/bits/setjmp.h b/sysdeps/powerpc/bits/setjmp.h
index a9cab03fc6..7bb654c0bc 100644
--- a/sysdeps/powerpc/bits/setjmp.h
+++ b/sysdeps/powerpc/bits/setjmp.h
@@ -1,17 +1,21 @@
 /* Define the machine-dependent type `jmp_buf'.  PowerPC version.  */
 
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
 /* The previous bits/setjmp.h had __jmp_buf defined as a structure.
    We use an array of 'long int' instead, to make writing the
    assembler easier. Naturally, user code should not depend on
    either representation. */
 
-#if	defined (__USE_MISC) || defined (_ASM)
-#define JB_GPR1  0   /* also known as the stack pointer */
-#define JB_GPR2  1
-#define JB_LR    2
-#define JB_GPRS  3   /* GPRs 14 through 31 are saved, 18 in total */
-#define JB_UNUSED 21 /* it's sometimes faster to store doubles word-aligned */
-#define JB_FPRS  22  /* FPRs 14 through 31 are saved, 18*2 words total */
+#if defined __USE_MISC || defined _ASM
+# define JB_GPR1   0   /* also known as the stack pointer */
+# define JB_GPR2   1
+# define JB_LR     2
+# define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total */
+# define JB_UNUSED 21 /* it's sometimes faster to store doubles word-aligned */
+# define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total */
 #endif
 
 #ifndef	_ASM
diff --git a/sysdeps/sparc/sparc32/bits/endian.h b/sysdeps/sparc/sparc32/bits/endian.h
index f1a75c0652..68fc68de6a 100644
--- a/sysdeps/sparc/sparc32/bits/endian.h
+++ b/sysdeps/sparc/sparc32/bits/endian.h
@@ -1,3 +1,7 @@
 /* SPARC is big-endian.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #define __BYTE_ORDER __BIG_ENDIAN
diff --git a/sysdeps/sparc/sparc32/bits/setjmp.h b/sysdeps/sparc/sparc32/bits/setjmp.h
index 43bae1a496..0e61fe7805 100644
--- a/sysdeps/sparc/sparc32/bits/setjmp.h
+++ b/sysdeps/sparc/sparc32/bits/setjmp.h
@@ -1,9 +1,13 @@
 /* Define the machine-dependent type `jmp_buf'.  SPARC version.  */
 
-#if	defined (__USE_MISC) || defined (_ASM)
-#define	JB_SP	0
-#define	JB_FP	1
-#define	JB_PC	2
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+#if defined __USE_MISC || defined _ASM
+# define JB_SP	0
+# define JB_FP	1
+# define JB_PC	2
 #endif
 
 #ifndef	_ASM
diff --git a/sysdeps/sparc/sparc32/fpu/bits/fenv.h b/sysdeps/sparc/sparc32/fpu/bits/fenv.h
index 6a76795d6a..9fb33cef28 100644
--- a/sysdeps/sparc/sparc32/fpu/bits/fenv.h
+++ b/sysdeps/sparc/sparc32/fpu/bits/fenv.h
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _FENV_H
-#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
 #endif
 
 
@@ -72,5 +72,5 @@ typedef unsigned int fenv_t;
 #endif
 
 /* For internal use only: access the fp state register.  */
-#define __fenv_stfsr(X)   __asm__("st %%fsr,%0" : "=m"(X))
-#define __fenv_ldfsr(X)   __asm__ __volatile__("ld %0,%%fsr" : : "m"(X))
+#define __fenv_stfsr(X)   __asm__ ("st %%fsr,%0" : "=m" (X))
+#define __fenv_ldfsr(X)   __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X))
diff --git a/sysdeps/sparc/sparc64/bits/endian.h b/sysdeps/sparc/sparc64/bits/endian.h
index a2ab07249a..8acfdf5df6 100644
--- a/sysdeps/sparc/sparc64/bits/endian.h
+++ b/sysdeps/sparc/sparc64/bits/endian.h
@@ -1,8 +1,12 @@
 /* Sparc is big-endian, but v9 supports endian conversion on loads/stores
    and GCC supports such a mode.  Be prepared.  */
 
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
 #ifdef __LITTLE_ENDIAN__
-#define __BYTE_ORDER __LITTLE_ENDIAN
+# define __BYTE_ORDER __LITTLE_ENDIAN
 #else
-#define __BYTE_ORDER __BIG_ENDIAN
+# define __BYTE_ORDER __BIG_ENDIAN
 #endif
diff --git a/sysdeps/sparc/sparc64/fpu/bits/fenv.h b/sysdeps/sparc/sparc64/fpu/bits/fenv.h
index 802c58bdce..5728e2b588 100644
--- a/sysdeps/sparc/sparc64/fpu/bits/fenv.h
+++ b/sysdeps/sparc/sparc64/fpu/bits/fenv.h
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _FENV_H
-#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
 #endif
 
 
@@ -72,5 +72,5 @@ typedef unsigned long fenv_t;
 #endif
 
 /* For internal use only: access the fp state register.  */
-#define __fenv_stfsr(X)   __asm__("stx %%fsr,%0" : "=m"(X))
-#define __fenv_ldfsr(X)   __asm__ __volatile__("ldx %0,%%fsr" : : "m"(X))
+#define __fenv_stfsr(X)   __asm__ ("stx %%fsr,%0" : "=m" (X))
+#define __fenv_ldfsr(X)   __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X))
diff --git a/sysdeps/unix/bsd/bits/dirent.h b/sysdeps/unix/bsd/bits/dirent.h
index 6f88661694..642c79183e 100644
--- a/sysdeps/unix/bsd/bits/dirent.h
+++ b/sysdeps/unix/bsd/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 int d_fileno;	/* 32 bits.  */
diff --git a/sysdeps/unix/bsd/bits/stat.h b/sysdeps/unix/bsd/bits/stat.h
index 71130f3fcb..8722fa0249 100644
--- a/sysdeps/unix/bsd/bits/stat.h
+++ b/sysdeps/unix/bsd/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	_STATBUF_H
-#define	_STATBUF_H	1
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 #include <bits/types.h>
 
@@ -82,6 +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/bsd/bits/waitflags.h b/sysdeps/unix/bsd/bits/waitflags.h
index ca952f90b4..47fc6ea1b7 100644
--- a/sysdeps/unix/bsd/bits/waitflags.h
+++ b/sysdeps/unix/bsd/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
 
 
@@ -26,5 +26,5 @@
 #define	WNOHANG		1	/* Don't block waiting.  */
 #define	WUNTRACED	2	/* Report status of stopped children.  */
 #ifdef  __USE_GNU
-#define WNOREAP		4	/* Don't remove record of child reported.  */
+# define WNOREAP	4	/* Don't remove record of child reported.  */
 #endif
diff --git a/sysdeps/unix/bsd/bsd4.4/bits/dirent.h b/sysdeps/unix/bsd/bsd4.4/bits/dirent.h
index b9e0d7277e..e29dac4806 100644
--- a/sysdeps/unix/bsd/bsd4.4/bits/dirent.h
+++ b/sysdeps/unix/bsd/bsd4.4/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
   {
     __ino_t d_fileno;		/* File serial number.  */
diff --git a/sysdeps/unix/bsd/osf/alpha/bits/stat.h b/sysdeps/unix/bsd/osf/alpha/bits/stat.h
index ab0fa48f68..7084b4e534 100644
--- a/sysdeps/unix/bsd/osf/alpha/bits/stat.h
+++ b/sysdeps/unix/bsd/osf/alpha/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
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
 
 #include <bits/types.h>
 
@@ -76,5 +72,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/bsd/osf/bits/sigaction.h b/sysdeps/unix/bsd/osf/bits/sigaction.h
index 56e28a04fb..6bf030793e 100644
--- a/sysdeps/unix/bsd/osf/bits/sigaction.h
+++ b/sysdeps/unix/bsd/osf/bits/sigaction.h
@@ -18,6 +18,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/bsd/sun/m68k/bits/sigcontext.h b/sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h
index 61481cc6a2..f637efa6cd 100644
--- a/sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h
+++ b/sysdeps/unix/bsd/sun/m68k/bits/sigcontext.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 use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
 struct sigcontext
   {
     int sc_onstack;
diff --git a/sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h b/sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h
index e1cdd416a1..29d2d87b26 100644
--- a/sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h
+++ b/sysdeps/unix/bsd/sun/sparc/bits/sigcontext.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 use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
 struct sigcontext
   {
     int sc_onstack;
diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/resource.h b/sysdeps/unix/bsd/sun/sunos4/bits/resource.h
index f51262d92d..6978c87dd2 100644
--- a/sysdeps/unix/bsd/sun/sunos4/bits/resource.h
+++ b/sysdeps/unix/bsd/sun/sunos4/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
+
 /* These are the values for 4.4 BSD and GNU.  Earlier BSD systems have a
    subset of these kinds of resource limit.  In systems where `getrlimit'
    and `setrlimit' are not system calls, these are the values used by the C
@@ -110,7 +114,8 @@ enum __rusage_who
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
   };
 
-#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/bsd/sun/sunos4/bits/termios.h b/sysdeps/unix/bsd/sun/sunos4/bits/termios.h
index dc0a007208..15aaab795a 100644
--- a/sysdeps/unix/bsd/sun/sunos4/bits/termios.h
+++ b/sysdeps/unix/bsd/sun/sunos4/bits/termios.h
@@ -1,5 +1,5 @@
 /* termios type and macro definitions.  SunOS 4 version.
-   Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 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,6 +17,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
 /* Type of terminal control flag masks.  */
 typedef unsigned long int tcflag_t;
 
@@ -41,51 +45,51 @@ struct termios
 #define	IGNCR	0x0080		/* Ignore CR.  */
 #define	ICRNL	0x0100		/* Map CR to NL on input.  */
 #ifdef __USE_BSD
-#define	IUCLC	0x0200		/* Map upper case to lower case on input.  */
+# define IUCLC	0x0200		/* Map upper case to lower case on input.  */
 #endif
 #define	IXON	0x0400		/* Enable start/stop output control.  */
 #define	IXOFF	0x1000		/* Enable start/stop input control.  */
 #ifdef	__USE_BSD
-#define	IXANY	0x0800		/* Any character will restart after stop.  */
-#define	IMAXBEL	0x2000		/* Ring bell when input queue is full.  */
+# define IXANY	0x0800		/* Any character will restart after stop.  */
+# define IMAXBEL	0x2000		/* Ring bell when input queue is full.  */
 #endif
 
   /* Output modes.  */
   tcflag_t c_oflag;
 #define	OPOST	0x0001		/* Perform output processing.  */
 #ifdef	__USE_BSD
-#define	OLCUC	0x00000002	/* Map lower case to upper case on output.  */
-#define	ONLCR	0x00000004	/* Map NL to CR-NL on output.  */
-#define	OCRNL	0x00000008
-#define	ONOCR	0x00000010
-#define	ONLRET	0x00000020
-#define	OFILL	0x00000040
-#define	OFDEL	0x00000080
-#define	NLDLY	0x00000100
-#define	NL0	0
-#define	NL1	0x00000100
-#define	CRDLY	0x00000600
-#define	CR0	0
-#define	CR1	0x00000200
-#define	CR2	0x00000400
-#define	CR3	0x00000600
-#define	TABDLY	0x00001800
-#define	TAB0	0
-#define	TAB1	0x00000800
-#define	TAB2	0x00001000
-#define	XTABS	0x00001800
-#define	TAB3	XTABS
-#define	BSDLY	0x00002000
-#define	BS0	0
-#define	BS1	0x00002000
-#define	VTDLY	0x00004000
-#define	VT0	0
-#define	VT1	0x00004000
-#define	FFDLY	0x00008000
-#define	FF0	0
-#define	FF1	0x00008000
-#define	PAGEOUT	0x00010000
-#define	WRAP	0x00020000
+# define OLCUC	0x00000002	/* Map lower case to upper case on output.  */
+# define ONLCR	0x00000004	/* Map NL to CR-NL on output.  */
+# define OCRNL	0x00000008
+# define ONOCR	0x00000010
+# define ONLRET	0x00000020
+# define OFILL	0x00000040
+# define OFDEL	0x00000080
+# define NLDLY	0x00000100
+# define NL0	0
+# define NL1	0x00000100
+# define CRDLY	0x00000600
+# define CR0	0
+# define CR1	0x00000200
+# define CR2	0x00000400
+# define CR3	0x00000600
+# define TABDLY	0x00001800
+# define TAB0	0
+# define TAB1	0x00000800
+# define TAB2	0x00001000
+# define XTABS	0x00001800
+# define TAB3	XTABS
+# define BSDLY	0x00002000
+# define BS0	0
+# define BS1	0x00002000
+# define VTDLY	0x00004000
+# define VT0	0
+# define VT1	0x00004000
+# define FFDLY	0x00008000
+# define FF0	0
+# define FF1	0x00008000
+# define PAGEOUT 0x00010000
+# define WRAP	0x00020000
 #endif
 
   /* Control modes.  */
@@ -102,11 +106,11 @@ struct termios
 #define	HUPCL	0x00000400	/* Hang up on last close.  */
 #define	CLOCAL	0x00000800	/* Ignore modem status lines.  */
 #ifdef	__USE_BSD
-#define	LOBLK	0x00001000
-#define	CRTSCTS	0x80000000
-#define	CIBAUD	0x000f0000	/* Mask for input speed from c_cflag.  */
-#define	CBAUD	0x0000000f	/* Mask for output speed from c_cflag.  */
-#define	IBSHIFT	16		/* Bits to shift for input speed.  */
+# define LOBLK	0x00001000
+# define CRTSCTS	0x80000000
+# define CIBAUD	0x000f0000	/* Mask for input speed from c_cflag.  */
+# define CBAUD	0x0000000f	/* Mask for output speed from c_cflag.  */
+# define IBSHIFT	16		/* Bits to shift for input speed.  */
 #endif
 
   /* Input and output baud rates.  These are encoded in c_cflag.  */
@@ -127,29 +131,29 @@ struct termios
 #define B19200  14
 #define B38400  15
 #ifdef __USE_BSD
-#define EXTA    14
-#define EXTB    15
+# define EXTA   14
+# define EXTB   15
 #endif
 
   /* Local modes.  */
   tcflag_t c_lflag;
 #ifdef	__USE_BSD
-#define	ECHOKE	0x00000800	/* Visual erase for KILL.  */
+# define ECHOKE	0x00000800	/* Visual erase for KILL.  */
 #endif
 #define	ECHOE	0x00000010	/* Visual erase for ERASE.  */
 #define	ECHOK	0x00000020	/* Echo NL after KILL.  */
 #define	ECHO	0x00000008	/* Enable echo.  */
 #define	ECHONL	0x00000040	/* Echo NL even if ECHO is off.  */
 #ifdef	__USE_BSD
-#define	ECHOPRT	0x00000400	/* Hardcopy visual erase.  */
-#define	ECHOCTL	0x00000200	/* Echo control characters as ^X.  */
+# define ECHOPRT	0x00000400	/* Hardcopy visual erase.  */
+# define ECHOCTL	0x00000200	/* Echo control characters as ^X.  */
 #endif
 #define	ISIG	0x00000001	/* Enable signals.  */
 #define	ICANON	0x00000002	/* Do erase and kill processing.  */
 #define	IEXTEN	0x00008000	/* Enable DISCARD and LNEXT.  */
 #define	TOSTOP	0x00000100	/* Send SIGTTOU for background output.  */
 #ifdef	__USE_BSD
-#define	PENDIN	0x00004000	/* Retype pending input (state).  */
+# define PENDIN	0x00004000	/* Retype pending input (state).  */
 #endif
 #define	NOFLSH	0x00000080	/* Disable flush after interrupt.  */
 
@@ -159,28 +163,28 @@ struct termios
 #define	VEOF	4		/* End-of-file character [ICANON].  */
 #define	VEOL	5		/* End-of-line character [ICANON].  */
 #ifdef	__USE_BSD
-#define	VEOL2	6		/* Second EOL character [ICANON].  */
-#define	VSWTCH	7		/* ??? */
+# define VEOL2	6		/* Second EOL character [ICANON].  */
+# define VSWTCH	7		/* ??? */
 #endif
 #define	VERASE	2		/* Erase character [ICANON].  */
 #ifdef	__USE_BSD
-#define	VWERASE	14		/* Word-erase character [ICANON].  */
+# define VWERASE	14		/* Word-erase character [ICANON].  */
 #endif
 #define	VKILL	3		/* Kill-line character [ICANON].  */
 #ifdef	__USE_BSD
-#define	VREPRINT 12		/* Reprint-line character [ICANON].  */
+# define VREPRINT 12		/* Reprint-line character [ICANON].  */
 #endif
 #define	VINTR	0		/* Interrupt character [ISIG].  */
 #define	VQUIT	1		/* Quit character [ISIG].  */
 #define	VSUSP	10		/* Suspend character [ISIG].  */
 #ifdef	__USE_BSD
-#define	VDSUSP	11		/* Delayed suspend character [ISIG].  */
+# define VDSUSP	11		/* Delayed suspend character [ISIG].  */
 #endif
 #define	VSTART	8		/* Start (X-ON) character [IXON, IXOFF].  */
 #define	VSTOP	9		/* Stop (X-OFF) character [IXON, IXOFF].  */
 #ifdef	__USE_BSD
-#define	VLNEXT	15		/* Literal-next character [IEXTEN].  */
-#define	VDISCARD 13		/* Discard character [IEXTEN].  */
+# define VLNEXT	15		/* Literal-next character [IEXTEN].  */
+# define VDISCARD 13		/* Discard character [IEXTEN].  */
 #endif
 #define	VMIN	VEOF		/* Minimum number of bytes read at once [!ICANON].  */
 #define	VTIME	VEOL		/* Time-out value (tenths of a second) [!ICANON].  */
diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h b/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h
index e9111b6504..5a03bab0c2 100644
--- a/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h
+++ b/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h
@@ -1,2 +1,24 @@
+/* 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
 #define _UTSNAME_NODENAME_LENGTH 65
diff --git a/sysdeps/unix/bsd/ultrix4/bits/utsname.h b/sysdeps/unix/bsd/ultrix4/bits/utsname.h
index ad4389ab02..a9f36ab3d1 100644
--- a/sysdeps/unix/bsd/ultrix4/bits/utsname.h
+++ b/sysdeps/unix/bsd/ultrix4/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 32
diff --git a/sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h b/sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h
index 72b29e5649..cb66517eef 100644
--- a/sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h
+++ b/sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h
@@ -1,6 +1,5 @@
 /* Copyright (C) 1992, 1994, 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,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 use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
 /* Note that ANY change to this instantly implies a change to __handler.S.  */
 
 struct sigcontext
diff --git a/sysdeps/unix/common/bits/dirent.h b/sysdeps/unix/common/bits/dirent.h
index 5ba1054049..e32f7f03c8 100644
--- a/sysdeps/unix/common/bits/dirent.h
+++ b/sysdeps/unix/common/bits/dirent.h
@@ -1,4 +1,4 @@
-/* Directory entry structure `struct dirent'.  SVR4/Linux version.
+/* Directory entry structure `struct dirent'.  SVR4 version.
    Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -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 int d_fileno;
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.  */
+  };
diff --git a/sysdeps/vax/bits/huge_val.h b/sysdeps/vax/bits/huge_val.h
index f323049d83..74930be56a 100644
--- a/sysdeps/vax/bits/huge_val.h
+++ b/sysdeps/vax/bits/huge_val.h
@@ -1,6 +1,6 @@
 /* `HUGE_VAL' constant for Vaxen.
    Used by <stdlib.h> and <math.h> functions for overflow.
-   Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1992, 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
@@ -19,7 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _MATH_H
-#error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
 #endif
 
 
diff --git a/sysdeps/vax/bits/setjmp.h b/sysdeps/vax/bits/setjmp.h
index 7adecd9a17..10ca170a2a 100644
--- a/sysdeps/vax/bits/setjmp.h
+++ b/sysdeps/vax/bits/setjmp.h
@@ -1,5 +1,9 @@
 /* Define the machine-dependent type `jmp_buf'.  Vax version.  */
 
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
 typedef struct
   {
     PTR __fp;
diff --git a/sysdeps/wordsize-32/bits/elfclass.h b/sysdeps/wordsize-32/bits/elfclass.h
index 49411d66f3..7d9ea28695 100644
--- a/sysdeps/wordsize-32/bits/elfclass.h
+++ b/sysdeps/wordsize-32/bits/elfclass.h
@@ -2,4 +2,8 @@
    the ELF file class used for executables and shared objects on this
    machine.  */
 
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
 #define __ELF_NATIVE_CLASS 32
diff --git a/sysdeps/wordsize-64/bits/elfclass.h b/sysdeps/wordsize-64/bits/elfclass.h
index ac52904886..bf76faf418 100644
--- a/sysdeps/wordsize-64/bits/elfclass.h
+++ b/sysdeps/wordsize-64/bits/elfclass.h
@@ -2,4 +2,8 @@
    the ELF file class used for executables and shared objects on this
    machine.  */
 
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
 #define __ELF_NATIVE_CLASS 64