about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog88
-rw-r--r--bits/fcntl.h6
-rw-r--r--bits/mman.h8
-rw-r--r--bits/termios.h40
-rw-r--r--bits/waitstatus.h2
-rw-r--r--ctype/ctype.h8
-rw-r--r--dirent/dirent.h12
-rw-r--r--grp/grp.h12
-rw-r--r--include/features.h29
-rw-r--r--inet/netinet/igmp.h2
-rw-r--r--io/fcntl.h2
-rw-r--r--io/ftw.h2
-rw-r--r--io/sys/stat.h28
-rw-r--r--libio/bits/stdio-ldbl.h4
-rw-r--r--libio/bits/stdio2.h2
-rw-r--r--libio/stdio.h16
-rw-r--r--math/math.h4
-rw-r--r--misc/bits/syslog-ldbl.h4
-rw-r--r--misc/bits/syslog.h2
-rw-r--r--misc/search.h2
-rw-r--r--misc/sys/mman.h2
-rw-r--r--misc/sys/syslog.h2
-rw-r--r--misc/sys/uio.h2
-rw-r--r--ports/ChangeLog.hppa5
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h2
-rw-r--r--posix/bits/unistd.h8
-rw-r--r--posix/glob.h2
-rw-r--r--posix/regex.h2
-rw-r--r--posix/sys/types.h10
-rw-r--r--posix/sys/utsname.h2
-rw-r--r--posix/sys/wait.h14
-rw-r--r--posix/unistd.h44
-rw-r--r--pwd/pwd.h10
-rw-r--r--resolv/netdb.h2
-rw-r--r--setjmp/setjmp.h2
-rw-r--r--signal/signal.h14
-rw-r--r--socket/sys/socket.h2
-rw-r--r--stdlib/fmtmsg.h2
-rw-r--r--stdlib/stdlib.h28
-rw-r--r--string/bits/string2.h4
-rw-r--r--string/bits/string3.h4
-rw-r--r--string/endian.h4
-rw-r--r--string/string.h8
-rw-r--r--string/strings.h4
-rw-r--r--sysdeps/generic/netinet/ip.h4
-rw-r--r--sysdeps/gnu/netinet/ip_icmp.h4
-rw-r--r--sysdeps/mach/hurd/bits/fcntl.h6
-rw-r--r--sysdeps/mach/hurd/bits/stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/mman.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/fcntl-linux.h6
-rw-r--r--sysdeps/unix/sysv/linux/bits/mman-linux.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/sys_errlist.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_ether.h4
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_fddi.h2
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_tr.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/termios.h2
-rw-r--r--sysdeps/x86/bits/string.h6
-rw-r--r--sysvipc/sys/ipc.h2
-rw-r--r--termios/termios.h8
-rw-r--r--time/sys/time.h8
-rw-r--r--time/time.h8
65 files changed, 301 insertions, 229 deletions
diff --git a/ChangeLog b/ChangeLog
index facaae32fc..a8dcc80520 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,93 @@
 2014-02-12  Joseph Myers  <joseph@codesourcery.com>
 
+	* include/features.h (__USE_BSD): Remove macro definitions.
+	(__USE_SVID): Likewise.
+	(_BSD_SOURCE): Likewise.
+	(_SVID_SOURCE): Likewise.
+	[!defined _BSD_SOURCE && !defined _SVID_SOURCE]: Remove condition
+	from definition of _DEFAULT_SOURCE.
+	[_BSD_SOURCE || _SVID_SOURCE]: Change condition to
+	[_DEFAULT_SOURCE].
+	* bits/fcntl.h [__USE_BSD]: Change condition to [__USE_MISC].
+	* bits/mman.h [__USE_BSD]: Likewise.
+	* bits/termios.h [__USE_BSD]: Likewise.
+	* bits/waitstatus.h [__USE_BSD]: Likewise.
+	* ctype/ctype.h [__USE_SVID]: Likewise.
+	* dirent/dirent.h [__USE_BSD]: Likewise.
+	* grp/grp.h [__USE_SVID]: Likewise.
+	[__USE_BSD]: Likewise.
+	* inet/netinet/igmp.h [__USE_BSD]: Likewise.
+	* io/fcntl.h [__USE_BSD]: Likewise.
+	* io/ftw.h [__USE_BSD]: Likewise.
+	* io/sys/stat.h [__USE_BSD]: Likewise.
+	* libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise.
+	* libio/bits/stdio2.h [__USE_BSD]: Likewise.
+	* libio/stdio.h [__USE_SVID]: Likewise.
+	[__USE_BSD]: Likewise.
+	* math/math.h [__USE_SVID]: Likewise.
+	[__USE_BSD]: Likewise.
+	* misc/bits/syslog-ldbl.h [__USE_BSD]: Likewise.
+	* misc/bits/syslog.h [__USE_BSD]: Likewise.
+	* misc/search.h [__USE_SVID]: Likewise.
+	* misc/sys/mman.h [__USE_BSD]: Likewise.
+	* misc/sys/syslog.h [__USE_BSD]: Likewise.
+	* misc/sys/uio.h [__USE_BSD]: Likewise.
+	* posix/bits/unistd.h [__USE_BSD]: Likewise.
+	* posix/glob.h [__USE_BSD]: Likewise.
+	* posix/regex.h [__USE_BSD]: Likewise.
+	* posix/sys/types.h [__USE_BSD]: Likewise.
+	[__USE_SVID]: Likewise.
+	* posix/sys/utsname.h [__USE_SVID]: Likewise.
+	* posix/sys/wait.h [__USE_BSD]: Likewise.
+	[__USE_SVID]: Likewise.
+	* posix/unistd.h [__USE_BSD]: Likewise.
+	[__USE_SVID]: Likewise.
+	* pwd/pwd.h [__USE_SVID]: Likewise.
+	* resolv/netdb.h [__USE_BSD]: Likewise.
+	* setjmp/setjmp.h [__USE_BSD]: Likewise.
+	* signal/signal.h [__USE_BSD]: Likewise.
+	[__USE_SVID]: Likewise.
+	* socket/sys/socket.h [__USE_BSD]: Likewise.
+	* stdlib/fmtmsg.h [__USE_SVID]: Likewise.
+	* stdlib/stdlib.h [__USE_BSD]: Likewise.
+	[__USE_SVID]: Likewise.
+	* string/bits/string2.h [__USE_BSD]: Likewise.
+	[__USE_SVID]: Likewise.
+	* string/bits/string3.h [__USE_BSD]: Likewise.
+	* string/endian.h [__USE_BSD]: Likewise.
+	* string/string.h [__USE_SVID]: Likewise.
+	[__USE_BSD]: Likewise.
+	* string/strings.h [__USE_BSD]: Likewise.
+	* sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise.
+	* sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise.
+	* sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Likewise.
+	* sysdeps/mach/hurd/bits/stat.h [__USE_BSD]: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]:
+	Likewise.
+	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]:
+	Likewise.
+	* sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Likewise.
+	* sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]:
+	Likewise.
+	* sysdeps/unix/sysv/linux/bits/termios.h [__USE_BSD]: Likewise.
+	* sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]:
+	Likewise.
+	* sysdeps/unix/sysv/linux/netinet/if_ether.h [__USE_BSD]:
+	Likewise.
+	* sysdeps/unix/sysv/linux/netinet/if_fddi.h [__USE_BSD]: Likewise.
+	* sysdeps/unix/sysv/linux/netinet/if_tr.h [__USE_BSD]: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]:
+	Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]:
+	Likewise.
+	* sysdeps/x86/bits/string.h [__USE_BSD]: Likewise.
+	* sysvipc/sys/ipc.h [__USE_SVID]: Likewise.
+	* termios/termios.h [__USE_BSD]: Likewise.
+	* time/sys/time.h [__USE_BSD]: Likewise.
+	* time/time.h [__USE_BSD]: Likewise.
+	[__USE_SVID]: Likewise.
+
 	* Makefile (subdir_targets): Remove subdir_lint.out.
 
 	* stdio-common/Makefile (do-tst-unbputc): Remove target.
diff --git a/bits/fcntl.h b/bits/fcntl.h
index 61b42dc166..c5eb3758bc 100644
--- a/bits/fcntl.h
+++ b/bits/fcntl.h
@@ -58,11 +58,11 @@
 #define	O_APPEND	0x0008	/* Writes append to the file.  */
 #define	O_NONBLOCK	0x0004	/* Non-blocking I/O.  */
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define O_NDELAY	O_NONBLOCK
 #endif
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Bits in the file status flags returned by F_GETFL.
    These are all the O_* flags, plus FREAD and FWRITE, which are
    independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was
@@ -88,7 +88,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 #define	F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 #define	F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
diff --git a/bits/mman.h b/bits/mman.h
index 360f0d0c98..ba57af0885 100644
--- a/bits/mman.h
+++ b/bits/mman.h
@@ -37,7 +37,7 @@
 /* Flags contain mapping type, sharing type and options.  */
 
 /* Mapping type (must choose one and only one of these).  */
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define MAP_FILE	 0x0001	/* Mapped from a file or device.  */
 # define MAP_ANON	 0x0002	/* Allocated from anonymous virtual memory.  */
 # define MAP_TYPE	 0x000f	/* Mask for type field.  */
@@ -47,7 +47,7 @@
 #endif
 
 /* Sharing types (must choose one and only one of these).  */
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define MAP_COPY	 0x0020	/* Virtual copy of region at mapping time.  */
 #endif
 #define	MAP_SHARED	 0x0010	/* Share changes.  */
@@ -55,14 +55,14 @@
 
 /* Other flags.  */
 #define	MAP_FIXED	 0x0100	/* Map address must be exactly as requested. */
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define MAP_NOEXTEND	 0x0200	/* For MAP_FILE, don't change file size.  */
 # define MAP_HASSEMPHORE 0x0400	/* Region may contain semaphores.  */
 # define MAP_INHERIT	 0x0800	/* Region is retained after exec.  */
 #endif
 
 /* Advice to `madvise'.  */
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define MADV_NORMAL	 0	/* No further special treatment.  */
 # define MADV_RANDOM	 1	/* Expect random page references.  */
 # define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
diff --git a/bits/termios.h b/bits/termios.h
index 9fd694a284..13442a5c7c 100644
--- a/bits/termios.h
+++ b/bits/termios.h
@@ -67,7 +67,7 @@
 
 #endif /* __USE_MISC || __USE_XOPEN */
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 
 # ifdef MDMBUF
 #  undef MDMBUF
@@ -79,7 +79,7 @@
 #  undef PENDIN
 # endif
 
-#endif /* __USE_BSD */
+#endif /* __USE_MISC */
 
 #ifdef ECHO
 # undef ECHO
@@ -123,10 +123,10 @@ struct termios
 #define	ICRNL	(1 << 8)	/* Map CR to NL on input.  */
 #define	IXON	(1 << 9)	/* Enable start/stop output control.  */
 #define	IXOFF	(1 << 10)	/* Enable start/stop input control.  */
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_MISC || defined __USE_UNIX98
 # define IXANY	(1 << 11)	/* Any character will restart after stop.  */
 #endif
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define IMAXBEL (1 << 13)	/* Ring bell when input queue is full.  */
 #endif
 #ifdef __USE_GNU
@@ -136,14 +136,14 @@ struct termios
   /* Output modes.  */
   tcflag_t c_oflag;
 #define	OPOST	(1 << 0)	/* Perform output processing.  */
-#if defined __USE_BSD || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 # define ONLCR	(1 << 1)	/* Map NL to CR-NL on output.  */
 #endif
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define OXTABS	TAB3		/* Expand tabs to spaces.  */
 # define ONOEOT	(1 << 3)	/* Discard EOT (^D) on output.  */
 #endif
-#if defined __USE_BSD || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 # define OCRNL	(1 << 4)	/* Map CR to NL.  */
 # define ONOCR	(1 << 5)	/* Discard CR's when on column 0.  */
 # define ONLRET	(1 << 6)	/* Move to column 0 on NL.  */
@@ -181,7 +181,7 @@ struct termios
 
   /* Control modes.  */
   tcflag_t c_cflag;
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define CIGNORE	(1 << 0)	/* Ignore these control flags.  */
 #endif
 #define	CSIZE	(CS5|CS6|CS7|CS8)	/* Number of bits per byte (mask).  */
@@ -195,7 +195,7 @@ struct termios
 #define	PARODD	(1 << 13)	/* Odd parity instead of even.  */
 #define	HUPCL	(1 << 14)	/* Hang up on last close.  */
 #define	CLOCAL	(1 << 15)	/* Ignore modem status lines.  */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define CRTSCTS	(1 << 16)	/* RTS/CTS flow control.  */
 # define CRTS_IFLOW	CRTSCTS		/* Compatibility.  */
 # define CCTS_OFLOW	CRTSCTS		/* Compatibility.  */
@@ -206,7 +206,7 @@ struct termios
 
   /* Local modes.  */
   tcflag_t c_lflag;
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define ECHOKE	(1 << 0)	/* Visual erase for KILL.  */
 #endif
 #define	_ECHOE	(1 << 1)	/* Visual erase for ERASE.  */
@@ -217,7 +217,7 @@ struct termios
 #define	ECHO	_ECHO
 #define	_ECHONL	(1 << 4)	/* Echo NL even if ECHO is off.  */
 #define	ECHONL	_ECHONL
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define ECHOPRT	(1 << 5)	/* Hardcopy visual erase.  */
 # define ECHOCTL	(1 << 6)	/* Echo control characters as ^X.  */
 #endif
@@ -225,7 +225,7 @@ struct termios
 #define	ISIG	_ISIG
 #define	_ICANON	(1 << 8)	/* Do erase and kill processing.  */
 #define	ICANON	_ICANON
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define ALTWERASE (1 << 9)	/* Alternate WERASE algorithm.  */
 #endif
 #define	_IEXTEN	(1 << 10)	/* Enable DISCARD and LNEXT.  */
@@ -233,7 +233,7 @@ struct termios
 #define	EXTPROC	(1 << 11)	/* External processing.  */
 #define	_TOSTOP	(1 << 22)	/* Send SIGTTOU for background output.  */
 #define	TOSTOP	_TOSTOP
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define FLUSHO	(1 << 23)	/* Output being flushed (state).  */
 # define NOKERNINFO (1 << 25)	/* Disable VSTATUS.  */
 # define PENDIN	(1 << 29)	/* Retype pending input (state).  */
@@ -244,32 +244,32 @@ struct termios
   /* Control characters.  */
 #define	VEOF	0		/* End-of-file character [ICANON].  */
 #define	VEOL	1		/* End-of-line character [ICANON].  */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define VEOL2	2		/* Second EOL character [ICANON].  */
 #endif
 #define	VERASE	3		/* Erase character [ICANON].  */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define VWERASE	4		/* Word-erase character [ICANON].  */
 #endif
 #define	VKILL	5		/* Kill-line character [ICANON].  */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # 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
+#ifdef	__USE_MISC
 # 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
+#ifdef	__USE_MISC
 # 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
+#ifdef	__USE_MISC
 # define VSTATUS	18		/* Status character [ICANON].  */
 #endif
 #define	NCCS	20		/* Value duplicated in <hurd/tioctl.defs>.  */
@@ -325,7 +325,7 @@ struct termios
 #define	TCSANOW		0	/* Change immediately.  */
 #define	TCSADRAIN	1	/* Change when pending output is written.  */
 #define	TCSAFLUSH	2	/* Flush pending input before changing.  */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define TCSASOFT	0x10	/* Flag: Don't alter hardware state.  */
 #endif
 
diff --git a/bits/waitstatus.h b/bits/waitstatus.h
index baa3962e09..76f9ee48e9 100644
--- a/bits/waitstatus.h
+++ b/bits/waitstatus.h
@@ -59,7 +59,7 @@
 #define	__WCOREFLAG		0x80
 
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 
 # include <endian.h>
 
diff --git a/ctype/ctype.h b/ctype/ctype.h
index e15749ce1d..e5a45923db 100644
--- a/ctype/ctype.h
+++ b/ctype/ctype.h
@@ -143,7 +143,7 @@ __END_NAMESPACE_C99
 extern int isctype (int __c, int __mask) __THROW;
 #endif
 
-#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN
 
 /* Return nonzero iff C is in the ASCII set
    (i.e., is no more than 7 bits wide).  */
@@ -229,7 +229,7 @@ __NTH (toupper (int __c))
 #  define toupper(c)	__tobody (c, toupper, *__ctype_toupper_loc (), (c))
 # endif /* Optimizing gcc */
 
-# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN
 #  define isascii(c)	__isascii (c)
 #  define toascii(c)	__toascii (c)
 
@@ -316,7 +316,7 @@ extern int toupper_l (int __c, __locale_t __l) __THROW;
 
 #  define __isblank_l(c,l)	__isctype_l((c), _ISblank, (l))
 
-#  if defined __USE_SVID || defined __USE_MISC
+#  if defined __USE_MISC || defined __USE_MISC
 #   define __isascii_l(c,l)	((l), __isascii (c))
 #   define __toascii_l(c,l)	((l), __toascii (c))
 #  endif
@@ -335,7 +335,7 @@ extern int toupper_l (int __c, __locale_t __l) __THROW;
 
 #  define isblank_l(c,l)	__isblank_l ((c), (l))
 
-#  if defined __USE_SVID || defined __USE_MISC
+#  if defined __USE_MISC || defined __USE_MISC
 #   define isascii_l(c,l)	__isascii_l ((c), (l))
 #   define toascii_l(c,l)	__toascii_l ((c), (l))
 #  endif
diff --git a/dirent/dirent.h b/dirent/dirent.h
index 9227adc867..24710f056d 100644
--- a/dirent/dirent.h
+++ b/dirent/dirent.h
@@ -60,7 +60,7 @@ typedef __ino64_t ino64_t;
 
 #include <bits/dirent.h>
 
-#if (defined __USE_BSD || defined __USE_MISC) && !defined d_fileno
+#if (defined __USE_MISC || defined __USE_MISC) && !defined d_fileno
 # define d_ino	d_fileno		 /* Backward compatibility.  */
 #endif
 
@@ -92,7 +92,7 @@ typedef __ino64_t ino64_t;
 #endif
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* File types for `d_type'.  */
 enum
   {
@@ -207,7 +207,7 @@ extern int readdir64_r (DIR *__restrict __dirp,
 /* Rewind DIRP to the beginning of the directory.  */
 extern void rewinddir (DIR *__dirp) __THROW __nonnull ((1));
 
-#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN
 # include <bits/types.h>
 
 /* Seek to position POS on DIRP.  */
@@ -217,7 +217,7 @@ extern void seekdir (DIR *__dirp, long int __pos) __THROW __nonnull ((1));
 extern long int telldir (DIR *__dirp) __THROW __nonnull ((1));
 #endif
 
-#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN2K8
 
 /* Return the file descriptor used by DIRP.  */
 extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
@@ -226,7 +226,7 @@ extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
 #  define dirfd(dirp)	_DIR_dirfd (dirp)
 # endif
 
-# if defined __USE_BSD || defined __USE_MISC
+# if defined __USE_MISC || defined __USE_MISC
 #  ifndef MAXNAMLEN
 /* Get the definitions of the POSIX.1 limits.  */
 #  include <bits/posix1_lim.h>
@@ -343,7 +343,7 @@ extern int alphasort64 (const struct dirent64 **__e1,
 #endif /* Use BSD or misc or XPG7.  */
 
 
-#if defined __USE_BSD || defined __USE_MISC
+#if defined __USE_MISC || defined __USE_MISC
 /* Read directory entries from FD into BUF, reading at most NBYTES.
    Reading starts at offset *BASEP, and *BASEP is updated with the new
    position after reading.  Returns the number of bytes read; zero when at
diff --git a/grp/grp.h b/grp/grp.h
index 13b00ecba5..7cae768f55 100644
--- a/grp/grp.h
+++ b/grp/grp.h
@@ -48,13 +48,13 @@ struct group
   };
 
 
-#if defined __USE_SVID || defined __USE_GNU
+#if defined __USE_MISC || defined __USE_GNU
 # define __need_FILE
 # include <stdio.h>
 #endif
 
 
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Rewind the group-file stream.
 
    This function is a possible cancellation point and therefore not
@@ -62,7 +62,7 @@ struct group
 extern void setgrent (void);
 #endif
 
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED \
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN_EXTENDED \
     || defined __USE_XOPEN2K8
 /* Close the group-file stream.
 
@@ -77,7 +77,7 @@ extern void endgrent (void);
 extern struct group *getgrent (void);
 #endif
 
-#ifdef	__USE_SVID
+#ifdef	__USE_MISC
 /* Read a group entry from STREAM.
 
    This function is not part of POSIX and therefore no official
@@ -154,7 +154,7 @@ extern int getgrnam_r (const char *__restrict __name,
 		       char *__restrict __buffer, size_t __buflen,
 		       struct group **__restrict __result);
 
-# ifdef	__USE_SVID
+# ifdef	__USE_MISC
 /* Read a group entry from STREAM.  This function is not standardized
    an probably never will.
 
@@ -171,7 +171,7 @@ extern int fgetgrent_r (FILE *__restrict __stream,
 #endif	/* POSIX or reentrant */
 
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 
 # define __need_size_t
 # include <stddef.h>
diff --git a/include/features.h b/include/features.h
index c729a3fc0d..75237a7984 100644
--- a/include/features.h
+++ b/include/features.h
@@ -75,9 +75,7 @@
    __USE_LARGEFILE	Define correct standard I/O things.
    __USE_LARGEFILE64	Define LFS things with separate names.
    __USE_FILE_OFFSET64	Define 64bit interface as default.
-   __USE_BSD		Define 4.3BSD things.
-   __USE_SVID		Define SVID things.
-   __USE_MISC		Define things common to BSD and System V Unix.
+   __USE_MISC		Define things from 4.3BSD or System V Unix.
    __USE_ATFILE		Define *at interfaces and AT_* constants for them.
    __USE_GNU		Define GNU extensions.
    __USE_REENTRANT	Define reentrant/thread-safe *_r functions.
@@ -114,8 +112,6 @@
 #undef	__USE_LARGEFILE
 #undef	__USE_LARGEFILE64
 #undef	__USE_FILE_OFFSET64
-#undef	__USE_BSD
-#undef	__USE_SVID
 #undef	__USE_MISC
 #undef	__USE_ATFILE
 #undef	__USE_GNU
@@ -171,28 +167,19 @@
 # define _LARGEFILE64_SOURCE	1
 # undef  _DEFAULT_SOURCE
 # define _DEFAULT_SOURCE	1
-# undef  _BSD_SOURCE
-# define _BSD_SOURCE	1
-# undef  _SVID_SOURCE
-# define _SVID_SOURCE	1
 # undef  _ATFILE_SOURCE
 # define _ATFILE_SOURCE	1
 #endif
 
 /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,
-   define _DEFAULT_SOURCE, _BSD_SOURCE and _SVID_SOURCE.  */
+   define _DEFAULT_SOURCE.  */
 #if (defined _DEFAULT_SOURCE					\
      || (!defined __STRICT_ANSI__				\
 	 && !defined _ISOC99_SOURCE				\
 	 && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE	\
-	 && !defined _XOPEN_SOURCE				\
-	 && !defined _BSD_SOURCE && !defined _SVID_SOURCE))
+	 && !defined _XOPEN_SOURCE))
 # undef  _DEFAULT_SOURCE
 # define _DEFAULT_SOURCE	1
-# undef  _BSD_SOURCE
-# define _BSD_SOURCE	1
-# undef  _SVID_SOURCE
-# define _SVID_SOURCE	1
 #endif
 
 /* This is to enable the ISO C11 extension.  */
@@ -317,18 +304,10 @@
 # define __USE_FILE_OFFSET64	1
 #endif
 
-#if defined _BSD_SOURCE || defined _SVID_SOURCE
+#if defined _DEFAULT_SOURCE
 # define __USE_MISC	1
 #endif
 
-#ifdef	_BSD_SOURCE
-# define __USE_BSD	1
-#endif
-
-#ifdef	_SVID_SOURCE
-# define __USE_SVID	1
-#endif
-
 #ifdef	_ATFILE_SOURCE
 # define __USE_ATFILE	1
 #endif
diff --git a/inet/netinet/igmp.h b/inet/netinet/igmp.h
index c12552cd13..e5f07adf33 100644
--- a/inet/netinet/igmp.h
+++ b/inet/netinet/igmp.h
@@ -21,7 +21,7 @@
 #include <sys/cdefs.h>
 #include <sys/types.h>
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 
 #include <netinet/in.h>
 
diff --git a/io/fcntl.h b/io/fcntl.h
index 28d83aeab5..3848df9e5c 100644
--- a/io/fcntl.h
+++ b/io/fcntl.h
@@ -87,7 +87,7 @@ typedef __pid_t pid_t;
 # define S_ISUID	__S_ISUID       /* Set user ID on execution.  */
 # define S_ISGID	__S_ISGID       /* Set group ID on execution.  */
 
-# if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+# if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN
 /* Save swapped text after use (sticky bit).  This is pretty well obsolete.  */
 #  define S_ISVTX	__S_ISVTX
 # endif
diff --git a/io/ftw.h b/io/ftw.h
index e5e3dd0c49..19f8129be5 100644
--- a/io/ftw.h
+++ b/io/ftw.h
@@ -43,7 +43,7 @@ enum
   FTW_NS,		/* Unstatable file.  */
 #define FTW_NS	 FTW_NS
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 
   FTW_SL,		/* Symbolic link.  */
 # define FTW_SL	 FTW_SL
diff --git a/io/sys/stat.h b/io/sys/stat.h
index 63e64dd777..0dbcc86341 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -104,7 +104,7 @@ __BEGIN_DECLS
 
 #include <bits/stat.h>
 
-#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN
 # define S_IFMT		__S_IFMT
 # define S_IFDIR	__S_IFDIR
 # define S_IFCHR	__S_IFCHR
@@ -116,7 +116,7 @@ __BEGIN_DECLS
 # ifdef __S_IFLNK
 #  define S_IFLNK	__S_IFLNK
 # endif
-# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98) \
+# if (defined __USE_MISC || defined __USE_MISC || defined __USE_UNIX98) \
      && defined __S_IFSOCK
 #  define S_IFSOCK	__S_IFSOCK
 # endif
@@ -137,11 +137,11 @@ __BEGIN_DECLS
 # define S_ISLNK(mode)	 __S_ISTYPE((mode), __S_IFLNK)
 #endif
 
-#if defined __USE_BSD && !defined __S_IFLNK
+#if defined __USE_MISC && !defined __S_IFLNK
 # define S_ISLNK(mode)  0
 #endif
 
-#if (defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K) \
+#if (defined __USE_MISC || defined __USE_UNIX98 || defined __USE_XOPEN2K) \
     && defined __S_IFSOCK
 # define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
 #elif defined __USE_XOPEN2K
@@ -164,7 +164,7 @@ __BEGIN_DECLS
 #define	S_ISUID __S_ISUID	/* Set user ID on execution.  */
 #define	S_ISGID	__S_ISGID	/* Set group ID on execution.  */
 
-#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN
 /* Save swapped text after use (sticky bit).  This is pretty well obsolete.  */
 # define S_ISVTX	__S_ISVTX
 #endif
@@ -175,7 +175,7 @@ __BEGIN_DECLS
 /* Read, write, and execute by owner.  */
 #define	S_IRWXU	(__S_IREAD|__S_IWRITE|__S_IEXEC)
 
-#if defined __USE_MISC && defined __USE_BSD
+#if defined __USE_MISC && defined __USE_MISC
 # define S_IREAD	S_IRUSR
 # define S_IWRITE	S_IWUSR
 # define S_IEXEC	S_IXUSR
@@ -194,7 +194,7 @@ __BEGIN_DECLS
 #define	S_IRWXO	(S_IRWXG >> 3)
 
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* Macros for common mode bit masks.  */
 # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
 # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
@@ -256,7 +256,7 @@ extern int fstatat64 (int __fd, const char *__restrict __file,
 # endif
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 # ifndef __USE_FILE_OFFSET64
 /* Get file attributes about FILE and put them in BUF.
    If FILE is a symbolic link, do not follow it.  */
@@ -284,7 +284,7 @@ extern int lstat64 (const char *__restrict __file,
 extern int chmod (const char *__file, __mode_t __mode)
      __THROW __nonnull ((1));
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Set file access permissions for FILE to MODE.
    If FILE is a symbolic link, this affects the link itself
    rather than its target.  */
@@ -293,7 +293,7 @@ extern int lchmod (const char *__file, __mode_t __mode)
 #endif
 
 /* Set file access permissions of the file FD is open on to MODE.  */
-#if defined __USE_BSD || defined __USE_POSIX
+#if defined __USE_MISC || defined __USE_POSIX
 extern int fchmod (int __fd, __mode_t __mode) __THROW;
 #endif
 
@@ -332,7 +332,7 @@ extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
 /* Create a device file named PATH, with permission and special bits MODE
    and device number DEV (which can be constructed from major and minor
    device numbers with the `makedev' macro above).  */
-#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
      __THROW __nonnull ((1));
 
@@ -455,7 +455,7 @@ __NTH (stat (const char *__path, struct stat *__statbuf))
   return __xstat (_STAT_VER, __path, __statbuf);
 }
 
-# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 __extern_inline int
 __NTH (lstat (const char *__path, struct stat *__statbuf))
 {
@@ -478,7 +478,7 @@ __NTH (fstatat (int __fd, const char *__filename, struct stat *__statbuf,
 }
 # endif
 
-# if defined __USE_MISC || defined __USE_BSD
+# if defined __USE_MISC || defined __USE_MISC
 __extern_inline int
 __NTH (mknod (const char *__path, __mode_t __mode, __dev_t __dev))
 {
@@ -504,7 +504,7 @@ __NTH (stat64 (const char *__path, struct stat64 *__statbuf))
   return __xstat64 (_STAT_VER, __path, __statbuf);
 }
 
-#  if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#  if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 __extern_inline int
 __NTH (lstat64 (const char *__path, struct stat64 *__statbuf))
 {
diff --git a/libio/bits/stdio-ldbl.h b/libio/bits/stdio-ldbl.h
index e8f714f5cf..dc8b33c4a9 100644
--- a/libio/bits/stdio-ldbl.h
+++ b/libio/bits/stdio-ldbl.h
@@ -40,7 +40,7 @@ __LDBL_REDIR_DECL (sscanf)
 #endif
 __END_NAMESPACE_STD
 
-#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+#if defined __USE_MISC || defined __USE_ISOC99 || defined __USE_UNIX98
 __BEGIN_NAMESPACE_C99
 __LDBL_REDIR_DECL (snprintf)
 __LDBL_REDIR_DECL (vsnprintf)
@@ -78,7 +78,7 @@ __LDBL_REDIR_DECL (obstack_vprintf)
 #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
 __LDBL_REDIR_DECL (__sprintf_chk)
 __LDBL_REDIR_DECL (__vsprintf_chk)
-# if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+# if defined __USE_MISC || defined __USE_ISOC99 || defined __USE_UNIX98
 __LDBL_REDIR_DECL (__snprintf_chk)
 __LDBL_REDIR_DECL (__vsnprintf_chk)
 # endif
diff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h
index efa886976c..305620688a 100644
--- a/libio/bits/stdio2.h
+++ b/libio/bits/stdio2.h
@@ -47,7 +47,7 @@ __NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt,
 				   __bos (__s), __fmt, __ap);
 }
 
-#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+#if defined __USE_MISC || defined __USE_ISOC99 || defined __USE_UNIX98
 
 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
 			   size_t __slen, const char *__restrict __format,
diff --git a/libio/stdio.h b/libio/stdio.h
index bdc79eabee..b70e1079d5 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -47,8 +47,8 @@ __BEGIN_NAMESPACE_STD
 /* The opaque type of streams.  This is the definition used elsewhere.  */
 typedef struct _IO_FILE FILE;
 __END_NAMESPACE_STD
-#if defined __USE_LARGEFILE64 || defined __USE_SVID || defined __USE_POSIX \
-    || defined __USE_BSD || defined __USE_ISOC99 || defined __USE_XOPEN \
+#if defined __USE_LARGEFILE64 || defined __USE_MISC || defined __USE_POSIX \
+    || defined __USE_MISC || defined __USE_ISOC99 || defined __USE_XOPEN \
     || defined __USE_POSIX2
 __USING_NAMESPACE_STD(FILE)
 #endif
@@ -146,7 +146,7 @@ typedef _G_fpos64_t fpos64_t;
 #endif
 
 
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 /* Default path prefix for `tempnam' and `tmpnam'.  */
 # define P_tmpdir	"/tmp"
 #endif
@@ -216,7 +216,7 @@ extern char *tmpnam_r (char *__s) __THROW __wur;
 #endif
 
 
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 /* Generate a unique temporary filename using up to five characters of PFX
    if it is not NULL.  The directory to put this file in is searched for
    as follows: First the environment variable "TMPDIR" is checked.
@@ -337,7 +337,7 @@ extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
 		    int __modes, size_t __n) __THROW;
 __END_NAMESPACE_STD
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* If BUF is NULL, make STREAM unbuffered.
    Else make it use SIZE bytes of BUF for buffering.  */
 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
@@ -380,7 +380,7 @@ extern int vsprintf (char *__restrict __s, const char *__restrict __format,
 		     _G_va_list __arg) __THROWNL;
 __END_NAMESPACE_STD
 
-#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+#if defined __USE_MISC || defined __USE_ISOC99 || defined __USE_UNIX98
 __BEGIN_NAMESPACE_C99
 /* Maximum chars of output to write in MAXLEN.  */
 extern int snprintf (char *__restrict __s, size_t __maxlen,
@@ -604,7 +604,7 @@ extern int putchar_unlocked (int __c);
 #endif /* Use POSIX or MISC.  */
 
 
-#if defined __USE_SVID || defined __USE_MISC \
+#if defined __USE_MISC || defined __USE_MISC \
     || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
 /* Get a word (int) from STREAM.  */
 extern int getw (FILE *__stream);
@@ -864,7 +864,7 @@ extern int fileno_unlocked (FILE *__stream) __THROW __wur;
 #endif
 
 
-#if (defined __USE_POSIX2 || defined __USE_SVID  || defined __USE_BSD || \
+#if (defined __USE_POSIX2 || defined __USE_MISC  || defined __USE_MISC || \
      defined __USE_MISC)
 /* Create a new stream connected to a pipe running the given command.
 
diff --git a/math/math.h b/math/math.h
index 4cdbd08bf8..ee574d7323 100644
--- a/math/math.h
+++ b/math/math.h
@@ -314,7 +314,7 @@ extern _LIB_VERSION_TYPE _LIB_VERSION;
 #endif
 
 
-#ifdef __USE_SVID
+#ifdef __USE_MISC
 /* In SVID error handling, `matherr' is called with this description
    of the exceptional condition.
 
@@ -363,7 +363,7 @@ extern int matherr (struct exception *__exc);
 
 
 /* Some useful constants.  */
-#if defined __USE_BSD || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 # define M_E		2.7182818284590452354	/* e */
 # define M_LOG2E	1.4426950408889634074	/* log_2 e */
 # define M_LOG10E	0.43429448190325182765	/* log_10 e */
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
index 989978d94d..5b413d8c32 100644
--- a/misc/bits/syslog-ldbl.h
+++ b/misc/bits/syslog-ldbl.h
@@ -22,14 +22,14 @@
 
 __LDBL_REDIR_DECL (syslog)
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 __LDBL_REDIR_DECL (vsyslog)
 #endif
 
 #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
 __LDBL_REDIR_DECL (__syslog_chk)
 
-# ifdef __USE_BSD
+# ifdef __USE_MISC
 __LDBL_REDIR_DECL (__vsyslog_chk)
 # endif
 #endif
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index a5c693a134..90908b6f9a 100644
--- a/misc/bits/syslog.h
+++ b/misc/bits/syslog.h
@@ -36,7 +36,7 @@ syslog (int __pri, const char *__fmt, ...)
 #endif
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt,
 			   __gnuc_va_list __ap)
      __attribute__ ((__format__ (__printf__, 3, 0)));
diff --git a/misc/search.h b/misc/search.h
index e09790c832..b84d2a81be 100644
--- a/misc/search.h
+++ b/misc/search.h
@@ -26,7 +26,7 @@
 
 __BEGIN_DECLS
 
-#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Prototype structure for a linked-list data structure.
    This is the type used by the `insque' and `remque' functions.  */
 
diff --git a/misc/sys/mman.h b/misc/sys/mman.h
index 5a3be79b3c..08f221f840 100644
--- a/misc/sys/mman.h
+++ b/misc/sys/mman.h
@@ -88,7 +88,7 @@ extern int mprotect (void *__addr, size_t __len, int __prot) __THROW;
    __THROW.  */
 extern int msync (void *__addr, size_t __len, int __flags);
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Advise the system about particular usage patterns the program follows
    for the region starting at ADDR and extending LEN bytes.  */
 extern int madvise (void *__addr, size_t __len, int __advice) __THROW;
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index 41331a8fd1..ee01478c4b 100644
--- a/misc/sys/syslog.h
+++ b/misc/sys/syslog.h
@@ -190,7 +190,7 @@ extern int setlogmask (int __mask) __THROW;
 extern void syslog (int __pri, const char *__fmt, ...)
      __attribute__ ((__format__ (__printf__, 2, 3)));
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Generate a log message using FMT and using arguments pointed to by AP.
 
    This function is not part of POSIX and therefore no official
diff --git a/misc/sys/uio.h b/misc/sys/uio.h
index 183ea9de49..cabeaf5ce4 100644
--- a/misc/sys/uio.h
+++ b/misc/sys/uio.h
@@ -51,7 +51,7 @@ extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count)
   __wur;
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # ifndef __USE_FILE_OFFSET64
 /* Read data from file descriptor FD at the given position OFFSET
    without change the file pointer, and put the result in the buffers
diff --git a/ports/ChangeLog.hppa b/ports/ChangeLog.hppa
index 9d784aa301..c98364ba84 100644
--- a/ports/ChangeLog.hppa
+++ b/ports/ChangeLog.hppa
@@ -1,3 +1,8 @@
+2014-02-12  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]: Change
+	condition to [__USE_MISC].
+
 2014-02-10  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/hppa/umount.c: Move to
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
index 6254b23972..ae6683d073 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
@@ -76,7 +76,7 @@
 #endif
 
 /* Advice to "madvise"  */
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define MADV_NORMAL	  0	/* No further special treatment */
 # define MADV_RANDOM	  1	/* Expect random page references */
 # define MADV_SEQUENTIAL  2	/* Expect sequential page references */
diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h
index 336b928b40..d377d28f8b 100644
--- a/posix/bits/unistd.h
+++ b/posix/bits/unistd.h
@@ -119,7 +119,7 @@ pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
 # endif
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 extern ssize_t __readlink_chk (const char *__restrict __path,
 			       char *__restrict __buf, size_t __len,
 			       size_t __buflen)
@@ -210,7 +210,7 @@ __NTH (getcwd (char *__buf, size_t __size))
   return __getcwd_alias (__buf, __size);
 }
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 extern char *__getwd_chk (char *__buf, size_t buflen)
      __THROW __nonnull ((1)) __wur;
 extern char *__REDIRECT_NTH (__getwd_warn, (char *__buf), getwd)
@@ -329,7 +329,7 @@ getlogin_r (char *__buf, size_t __buflen)
 #endif
 
 
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_MISC || defined __USE_UNIX98
 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal)
      __THROW __nonnull ((1));
 extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen),
@@ -356,7 +356,7 @@ __NTH (gethostname (char *__buf, size_t __buflen))
 #endif
 
 
-#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98)
 extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal)
      __THROW __nonnull ((1)) __wur;
 extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf,
diff --git a/posix/glob.h b/posix/glob.h
index 9c5f37fc87..c0036433e5 100644
--- a/posix/glob.h
+++ b/posix/glob.h
@@ -45,7 +45,7 @@ typedef __SIZE_TYPE__ size_t;
 #define	GLOB_NOESCAPE	(1 << 6)/* Backslashes don't quote metacharacters.  */
 #define	GLOB_PERIOD	(1 << 7)/* Leading `.' can be matched by metachars.  */
 
-#if !defined __USE_POSIX2 || defined __USE_BSD || defined __USE_GNU
+#if !defined __USE_POSIX2 || defined __USE_MISC || defined __USE_GNU
 # define GLOB_MAGCHAR	 (1 << 8)/* Set in gl_flags if any metachars seen.  */
 # define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions.  */
 # define GLOB_BRACE	 (1 << 10)/* Expand "{a,b}" to "a" "b".  */
diff --git a/posix/regex.h b/posix/regex.h
index bb18d64a85..35de759dae 100644
--- a/posix/regex.h
+++ b/posix/regex.h
@@ -529,7 +529,7 @@ extern void re_set_registers (struct re_pattern_buffer *__buffer,
 			      regoff_t *__starts, regoff_t *__ends);
 #endif	/* Use GNU */
 
-#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_BSD)
+#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC)
 # ifndef _CRAY
 /* 4.2 bsd compatibility.  */
 extern char *re_comp (const char *);
diff --git a/posix/sys/types.h b/posix/sys/types.h
index 0d51ae8a67..3681813579 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -28,7 +28,7 @@ __BEGIN_DECLS
 
 #include <bits/types.h>
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # ifndef __u_char_defined
 typedef __u_char u_char;
 typedef __u_short u_short;
@@ -99,7 +99,7 @@ typedef __pid_t pid_t;
 # define __pid_t_defined
 #endif
 
-#if (defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8) \
+#if (defined __USE_MISC || defined __USE_XOPEN || defined __USE_XOPEN2K8) \
     && !defined __id_t_defined
 typedef __id_t id_t;
 # define __id_t_defined
@@ -110,7 +110,7 @@ typedef __ssize_t ssize_t;
 # define __ssize_t_defined
 #endif
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # ifndef __daddr_t_defined
 typedef __daddr_t daddr_t;
 typedef __caddr_t caddr_t;
@@ -118,7 +118,7 @@ typedef __caddr_t caddr_t;
 # endif
 #endif
 
-#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __key_t_defined
+#if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined
 typedef __key_t key_t;
 # define __key_t_defined
 #endif
@@ -211,7 +211,7 @@ typedef int register_t __attribute__ ((__mode__ (__word__)));
 #define __BIT_TYPES_DEFINED__	1
 
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* In BSD <sys/types.h> is expected to define BYTE_ORDER.  */
 # include <endian.h>
 
diff --git a/posix/sys/utsname.h b/posix/sys/utsname.h
index 32e3ba66be..a30d9c5fdb 100644
--- a/posix/sys/utsname.h
+++ b/posix/sys/utsname.h
@@ -71,7 +71,7 @@ struct utsname
 #endif
   };
 
-#ifdef __USE_SVID
+#ifdef __USE_MISC
 /* Note that SVID assumes all members have the same size.  */
 # define SYS_NMLN  _UTSNAME_LENGTH
 #endif
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index 72983865e5..e243db3374 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -34,7 +34,7 @@ __BEGIN_DECLS
    bits to `waitpid', `wait3', and `wait4'.  */
 # include <bits/waitflags.h>
 
-# ifdef	__USE_BSD
+# ifdef	__USE_MISC
 
 /* Lots of hair to allow traditional BSD use of `union wait'
    as well as POSIX.1 use of `int' for the status word.  */
@@ -87,7 +87,7 @@ typedef union
 # endif
 #endif	/* <stdlib.h> not included.  */
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define WCOREFLAG		__WCOREFLAG
 # define WCOREDUMP(status)	__WCOREDUMP (__WAIT_INT (status))
 # define W_EXITCODE(ret, sig)	__W_EXITCODE (ret, sig)
@@ -95,7 +95,7 @@ typedef union
 #endif
 
 /* The following values are used by the `waitid' function.  */
-#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_XOPEN2K8
 typedef enum
 {
   P_ALL,		/* Wait for any child.  */
@@ -112,7 +112,7 @@ typedef enum
    __THROW.  */
 extern __pid_t wait (__WAIT_STATUS __stat_loc);
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* Special values for the PID argument to `waitpid' and `wait4'.  */
 # define WAIT_ANY	(-1)	/* Any process.  */
 # define WAIT_MYPGRP	0	/* Any process in my process group.  */
@@ -135,7 +135,7 @@ extern __pid_t wait (__WAIT_STATUS __stat_loc);
    __THROW.  */
 extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
 
-#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_XOPEN2K8
 # ifndef __id_t_defined
 #  include <bits/types.h>
 typedef __id_t id_t;
@@ -160,7 +160,7 @@ extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
 		   int __options);
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* This being here makes the prototypes valid whether or not
    we have already included <sys/resource.h> to define `struct rusage'.  */
 struct rusage;
@@ -174,7 +174,7 @@ extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
 		      struct rusage * __usage) __THROWNL;
 #endif
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* PID is like waitpid.  Other args are like wait3.  */
 extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
 		      struct rusage *__usage) __THROWNL;
diff --git a/posix/unistd.h b/posix/unistd.h
index 64734b0f9b..b9ff6e453d 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -269,7 +269,7 @@ typedef __intptr_t intptr_t;
 # endif
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 # ifndef __socklen_t_defined
 typedef __socklen_t socklen_t;
 #  define __socklen_t_defined
@@ -317,7 +317,7 @@ extern int faccessat (int __fd, const char *__file, int __type, int __flag)
 # endif
 #endif
 
-#if defined __USE_BSD && !defined L_SET
+#if defined __USE_MISC && !defined L_SET
 /* Old BSD names for the same constants; just for compatibility.  */
 # define L_SET		SEEK_SET
 # define L_INCR		SEEK_CUR
@@ -444,7 +444,7 @@ extern unsigned int alarm (unsigned int __seconds) __THROW;
 extern unsigned int sleep (unsigned int __seconds);
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
-    || defined __USE_BSD
+    || defined __USE_MISC
 /* Set an alarm to go off (generating a SIGALRM signal) in VALUE
    microseconds.  If INTERVAL is nonzero, when the alarm goes off, the
    timer is reset to go off every INTERVAL microseconds thereafter.
@@ -473,7 +473,7 @@ extern int pause (void);
 extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
      __THROW __nonnull ((1)) __wur;
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* Change the owner and group of the file that FD is open on.  */
 extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur;
 
@@ -496,7 +496,7 @@ extern int fchownat (int __fd, const char *__file, __uid_t __owner,
 /* Change the process's working directory to PATH.  */
 extern int chdir (const char *__path) __THROW __nonnull ((1)) __wur;
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* Change the process's working directory to the one FD is open on.  */
 extern int fchdir (int __fd) __THROW __wur;
 #endif
@@ -518,7 +518,7 @@ extern char *get_current_dir_name (void) __THROW;
 #endif
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
-    || defined __USE_BSD
+    || defined __USE_MISC
 /* Put the absolute pathname of the current working directory in BUF.
    If successful, return BUF.  If not, put an error message in
    BUF and return NULL.  BUF should be at least PATH_MAX bytes long.  */
@@ -645,7 +645,7 @@ extern __pid_t getpgid (__pid_t __pid) __THROW;
    If PGID is zero, the process ID of the process is used.  */
 extern int setpgid (__pid_t __pid, __pid_t __pgid) __THROW;
 
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Both System V and BSD have `setpgrp' functions, but with different
    calling conventions.  The BSD function is the same as POSIX.1 `setpgid'
    (above).  The System V function takes no arguments and puts the calling
@@ -699,13 +699,13 @@ extern int group_member (__gid_t __gid) __THROW;
    if not, the effective user ID is set to UID.  */
 extern int setuid (__uid_t __uid) __THROW __wur;
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Set the real user ID of the calling process to RUID,
    and the effective user ID of the calling process to EUID.  */
 extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW __wur;
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN2K
 /* Set the effective user ID of the calling process to UID.  */
 extern int seteuid (__uid_t __uid) __THROW __wur;
 #endif /* Use BSD.  */
@@ -716,13 +716,13 @@ extern int seteuid (__uid_t __uid) __THROW __wur;
    if not, the effective group ID is set to GID.  */
 extern int setgid (__gid_t __gid) __THROW __wur;
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Set the real group ID of the calling process to RGID,
    and the effective group ID of the calling process to EGID.  */
 extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW __wur;
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN2K
 /* Set the effective group ID of the calling process to GID.  */
 extern int setegid (__gid_t __gid) __THROW __wur;
 #endif /* Use BSD.  */
@@ -756,7 +756,7 @@ extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
 extern __pid_t fork (void) __THROWNL;
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
-    || defined __USE_BSD
+    || defined __USE_MISC
 /* Clone the calling process, but without copying the whole address space.
    The calling process is suspended until the new process exits or is
    replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
@@ -778,7 +778,7 @@ extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
    with a terminal, zero if not.  */
 extern int isatty (int __fd) __THROW;
 
-#if defined __USE_BSD \
+#if defined __USE_MISC \
     || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98)
 /* Return the index into the active-logins file (utmp) for
    the controlling terminal.  */
@@ -798,7 +798,7 @@ extern int linkat (int __fromfd, const char *__from, int __tofd,
      __THROW __nonnull ((2, 4)) __wur;
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 /* Make a symbolic link to FROM named TO.  */
 extern int symlink (const char *__from, const char *__to)
      __THROW __nonnull ((1, 2)) __wur;
@@ -857,7 +857,7 @@ extern char *getlogin (void);
 extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
 #endif
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* Set the login name returned by `getlogin'.  */
 extern int setlogin (const char *__name) __THROW __nonnull ((1));
 #endif
@@ -872,7 +872,7 @@ extern int setlogin (const char *__name) __THROW __nonnull ((1));
 #endif
 
 
-#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_UNIX98 || defined __USE_XOPEN2K
 /* Put the name of the current host in no more than LEN bytes of NAME.
    The result is null-terminated if LEN is large enough for the full
    name and the terminator.  */
@@ -880,7 +880,7 @@ extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1));
 #endif
 
 
-#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98)
 /* Set the name of the current host to NAME, which is LEN bytes long.
    This call is restricted to the super-user.  */
 extern int sethostname (const char *__name, size_t __len)
@@ -938,7 +938,7 @@ extern int daemon (int __nochdir, int __noclose) __THROW __wur;
 #endif /* Use BSD || X/Open.  */
 
 
-#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
 /* Make PATH be the root directory (the starting point for absolute paths).
    This call is restricted to the super-user.  */
 extern int chroot (const char *__path) __THROW __nonnull ((1)) __wur;
@@ -963,7 +963,7 @@ extern int syncfs (int __fd) __THROW;
 #endif
 
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 
 /* Return identifier for the current host.  */
 extern long int gethostid (void);
@@ -972,7 +972,7 @@ extern long int gethostid (void);
 extern void sync (void) __THROW;
 
 
-# if defined __USE_BSD || !defined __USE_XOPEN2K
+# if defined __USE_MISC || !defined __USE_XOPEN2K
 /* Return the number of bytes in a page.  This is the system's page size,
    which is not necessarily the same as the hardware page size.  */
 extern int getpagesize (void)  __THROW __attribute__ ((__const__));
@@ -986,7 +986,7 @@ extern int getdtablesize (void) __THROW;
 #endif /* Use BSD || X/Open Unix.  */
 
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 
 /* Truncate FILE to LENGTH bytes.  */
 # ifndef __USE_FILE_OFFSET64
@@ -1008,7 +1008,7 @@ extern int truncate64 (const char *__file, __off64_t __length)
 
 #endif /* Use BSD || X/Open Unix || POSIX 2008.  */
 
-#if defined __USE_BSD || defined __USE_POSIX199309 \
+#if defined __USE_MISC || defined __USE_POSIX199309 \
     || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 
 /* Truncate the file FD is open on to LENGTH bytes.  */
diff --git a/pwd/pwd.h b/pwd/pwd.h
index 626fcdd29f..7b40b4871a 100644
--- a/pwd/pwd.h
+++ b/pwd/pwd.h
@@ -58,13 +58,13 @@ struct passwd
 };
 
 
-#if defined __USE_SVID || defined __USE_GNU
+#if defined __USE_MISC || defined __USE_GNU
 # define __need_FILE
 # include <stdio.h>
 #endif
 
 
-#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Rewind the password-file stream.
 
    This function is a possible cancellation point and therefore not
@@ -84,7 +84,7 @@ extern void endpwent (void);
 extern struct passwd *getpwent (void);
 #endif
 
-#ifdef	__USE_SVID
+#ifdef	__USE_MISC
 /* Read an entry from STREAM.
 
    This function is not part of POSIX and therefore no official
@@ -131,7 +131,7 @@ extern struct passwd *getpwnam (const char *__name);
    other reentrant functions so the chances are good this is what the
    POSIX people would choose.  */
 
-# if defined __USE_SVID || defined __USE_MISC
+# if defined __USE_MISC || defined __USE_MISC
 /* This function is not part of POSIX and therefore no official
    cancellation point.  But due to similarity with an POSIX interface
    or due to the implementation it is a cancellation point and
@@ -152,7 +152,7 @@ extern int getpwnam_r (const char *__restrict __name,
 		       struct passwd **__restrict __result);
 
 
-# ifdef	__USE_SVID
+# ifdef	__USE_MISC
 /* Read an entry from STREAM.  This function is not standardized and
    probably never will.
 
diff --git a/resolv/netdb.h b/resolv/netdb.h
index f9e2bf00cb..171d85d3c0 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -436,7 +436,7 @@ extern int getnetgrent_r (char **__restrict __hostp,
 #endif	/* misc */
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
    The local user is LOCUSER, on the remote machine the command is
    executed as REMUSER.  In *FD2P the descriptor to the socket for the
diff --git a/setjmp/setjmp.h b/setjmp/setjmp.h
index 774b764237..a411cfcdac 100644
--- a/setjmp/setjmp.h
+++ b/setjmp/setjmp.h
@@ -76,7 +76,7 @@ extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
 
 __END_NAMESPACE_STD
 
-#if defined __USE_BSD || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 /* Same.  Usually `_longjmp' is used with `_setjmp', which does not save
    the signal mask.  But it is how ENV was saved that determines whether
    `longjmp' restores the mask; `_longjmp' is just an alias.  */
diff --git a/signal/signal.h b/signal/signal.h
index 1807658f41..abe0440c8a 100644
--- a/signal/signal.h
+++ b/signal/signal.h
@@ -98,7 +98,7 @@ extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
    handler, or SIG_ERR on error.
    By default `signal' has the BSD semantic.  */
 __BEGIN_NAMESPACE_STD
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 extern __sighandler_t signal (int __sig, __sighandler_t __handler)
      __THROW;
 #else
@@ -127,7 +127,7 @@ extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
 extern int kill (__pid_t __pid, int __sig) __THROW;
 #endif /* Use POSIX.  */
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Send SIG to all processes in process group PGRP.
    If PGRP is zero, send SIG to all processes in
    the current process's process group.  */
@@ -139,7 +139,7 @@ __BEGIN_NAMESPACE_STD
 extern int raise (int __sig) __THROW;
 __END_NAMESPACE_STD
 
-#ifdef __USE_SVID
+#ifdef __USE_MISC
 /* SVID names for the same things.  */
 extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
      __THROW;
@@ -176,7 +176,7 @@ extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
 #endif
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* None of the following functions should be used anymore.  They are here
    only for compatibility.  A single word (`int') is not guaranteed to be
    enough to hold a complete signal mask and therefore these functions
@@ -205,7 +205,7 @@ typedef __sighandler_t sighandler_t;
 #endif
 
 /* 4.4 BSD uses the name `sig_t' for this.  */
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 typedef __sighandler_t sig_t;
 #endif
 
@@ -296,7 +296,7 @@ extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
 
 #endif /* Use POSIX.  */
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 
 /* Names of the signals.  This variable exists only for compatibility.
    Use `strsignal' instead (see <string.h>).  */
@@ -337,7 +337,7 @@ extern int sigreturn (struct sigcontext *__scp) __THROW;
 #endif /*  use BSD.  */
 
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 # define __need_size_t
 # include <stddef.h>
 
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index 10e17d3926..c0f3ee65ec 100644
--- a/socket/sys/socket.h
+++ b/socket/sys/socket.h
@@ -37,7 +37,7 @@ __BEGIN_DECLS
    `struct msghdr', and `struct linger' types.  */
 #include <bits/socket.h>
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* This is the 4.3 BSD `struct sockaddr' format, which is used as wire
    format in the grotty old 4.3 `talk' protocol.  */
 struct osockaddr
diff --git a/stdlib/fmtmsg.h b/stdlib/fmtmsg.h
index ec4c5e0f73..b48946e681 100644
--- a/stdlib/fmtmsg.h
+++ b/stdlib/fmtmsg.h
@@ -95,7 +95,7 @@ extern int fmtmsg (long int __classification, const char *__label,
 		   int __severity, const char *__text,
 		   const char *__action, const char *__tag);
 
-#ifdef __USE_SVID
+#ifdef __USE_MISC
 /* Add or remove severity level.  */
 extern int addseverity (int __severity, const char *__string) __THROW;
 #endif
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index d35ffac792..6f3449bbb5 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -41,7 +41,7 @@ __BEGIN_DECLS
 # include <bits/waitflags.h>
 # include <bits/waitstatus.h>
 
-# ifdef __USE_BSD
+# ifdef __USE_MISC
 
 /* Lots of hair to allow traditional BSD use of `union wait'
    as well as POSIX.1 use of `int' for the status word.  */
@@ -189,7 +189,7 @@ extern unsigned long int strtoul (const char *__restrict __nptr,
      __THROW __nonnull ((1));
 __END_NAMESPACE_STD
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Convert a string to a quadword integer.  */
 __extension__
 extern long long int strtoq (const char *__restrict __nptr,
@@ -298,7 +298,7 @@ __END_NAMESPACE_C99
 #endif /* Optimizing and Inlining.  */
 
 
-#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant
    digit first.  Returns a pointer to static storage overwritten by the
    next call.  */
@@ -310,7 +310,7 @@ extern long int a64l (const char *__s)
 
 #endif	/* Use SVID || extended X/Open.  */
 
-#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_MISC
 # include <sys/types.h>	/* we need int32_t... */
 
 /* These are the functions that actually do things.  The `random', `srandom',
@@ -382,7 +382,7 @@ extern int rand_r (unsigned int *__seed) __THROW;
 #endif
 
 
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 /* System V style 48-bit random number generator functions.  */
 
 /* Return non-negative, double-precision floating-point value in [0.0,1.0).  */
@@ -488,12 +488,12 @@ __END_NAMESPACE_STD
 extern void cfree (void *__ptr) __THROW;
 #endif /* Use misc.  */
 
-#if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC
+#if defined __USE_GNU || defined __USE_MISC || defined __USE_MISC
 # include <alloca.h>
 #endif /* Use GNU, BSD, or misc.  */
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
-    || defined __USE_BSD
+    || defined __USE_MISC
 /* Allocate SIZE bytes on a page boundary.  The storage cannot be freed.  */
 extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
 #endif
@@ -571,14 +571,14 @@ extern char *secure_getenv (const char *__name)
      __THROW __nonnull ((1)) __wur;
 #endif
 
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 /* The SVID says this is in <stdio.h>, but this seems a better place.	*/
 /* Put STRING, which is of the form "NAME=VALUE", in the environment.
    If there is no `=', remove NAME from the environment.  */
 extern int putenv (char *__string) __THROW __nonnull ((1));
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN2K
 /* Set NAME to VALUE in the environment.
    If REPLACE is nonzero, overwrite an existing value.  */
 extern int setenv (const char *__name, const char *__value, int __replace)
@@ -654,7 +654,7 @@ extern int mkstemps64 (char *__template, int __suffixlen)
 # endif
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN2K8
 /* Create a unique temporary directory from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the directory name unique.
@@ -725,7 +725,7 @@ extern char *canonicalize_file_name (const char *__name)
      __THROW __nonnull ((1)) __wur;
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Return the canonical absolute name of file NAME.  If RESOLVED is
    null, the result is malloc'd; otherwise, if the canonical name is
    PATH_MAX chars or more, returns null with `errno' set to
@@ -802,7 +802,7 @@ __END_NAMESPACE_C99
 
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
-    || defined __USE_SVID
+    || defined __USE_MISC
 /* Convert floating point numbers to strings.  The returned values are
    valid only until another call to the same function.  */
 
@@ -880,7 +880,7 @@ extern size_t wcstombs (char *__restrict __s,
 __END_NAMESPACE_STD
 
 
-#ifdef __USE_SVID
+#ifdef __USE_MISC
 /* Determine whether the string value of RESPONSE matches the affirmation
    or negative response expression as specified by the LC_MESSAGES category
    in the program's current locale.  Returns 1 if affirmative, 0 if
@@ -944,7 +944,7 @@ extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
 extern int getpt (void);
 #endif
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Put the 1 minute, 5 minute and 15 minute load averages into the first
    NELEM elements of LOADAVG.  Return the number written (never more than
    three, but may be less than NELEM), or -1 if an error occurred.  */
diff --git a/string/bits/string2.h b/string/bits/string2.h
index b3df7089a9..fb835799ba 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -1258,7 +1258,7 @@ __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
     }
   return __retval;
 }
-# ifdef __USE_BSD
+# ifdef __USE_MISC
 #  define strsep(s, reject) __strsep (s, reject)
 # endif
 #endif
@@ -1287,7 +1287,7 @@ extern char *__strdup (const char *__string) __THROW __attribute_malloc__;
 			  __retval; }))					      \
 		  : __strdup (s)))
 
-#  if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#  if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 #   define strdup(s) __strdup (s)
 #  endif
 # endif
diff --git a/string/bits/string3.h b/string/bits/string3.h
index acd2577406..760609033a 100644
--- a/string/bits/string3.h
+++ b/string/bits/string3.h
@@ -37,7 +37,7 @@ __warndecl (__warn_memset_zero_len,
 #  undef mempcpy
 #  undef stpcpy
 # endif
-# ifdef __USE_BSD
+# ifdef __USE_MISC
 #  undef bcopy
 #  undef bzero
 # endif
@@ -84,7 +84,7 @@ __NTH (memset (void *__dest, int __ch, size_t __len))
   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
 }
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 __fortify_function void
 __NTH (bcopy (const void *__src, void *__dest, size_t __len))
 {
diff --git a/string/endian.h b/string/endian.h
index 875fea3778..9368b5c377 100644
--- a/string/endian.h
+++ b/string/endian.h
@@ -41,7 +41,7 @@
 # define __FLOAT_WORD_ORDER __BYTE_ORDER
 #endif
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define LITTLE_ENDIAN	__LITTLE_ENDIAN
 # define BIG_ENDIAN	__BIG_ENDIAN
 # define PDP_ENDIAN	__PDP_ENDIAN
@@ -55,7 +55,7 @@
 #endif
 
 
-#if defined __USE_BSD && !defined __ASSEMBLER__
+#if defined __USE_MISC && !defined __ASSEMBLER__
 /* Conversion interfaces.  */
 # include <bits/byteswap.h>
 
diff --git a/string/string.h b/string/string.h
index b127e8d9dd..9fabf2bab8 100644
--- a/string/string.h
+++ b/string/string.h
@@ -54,7 +54,7 @@ __END_NAMESPACE_STD
 /* Copy no more than N bytes of SRC to DEST, stopping when C is found.
    Return the position in DEST one byte past where C was copied,
    or NULL if C was not found in the first N bytes of SRC.  */
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN
 extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
 		      int __c, size_t __n)
      __THROW __nonnull ((1, 2));
@@ -170,7 +170,7 @@ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
 			 __locale_t __l) __THROW __nonnull ((2, 4));
 #endif
 
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED \
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN_EXTENDED \
     || defined __USE_XOPEN2K8
 /* Duplicate S, returning an identical malloc'd string.  */
 extern char *strdup (const char *__s)
@@ -450,7 +450,7 @@ extern char *strerror_l (int __errnum, __locale_t __l) __THROW;
    the namespace rules does not allow this.  */
 extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
 extern void bcopy (const void *__src, void *__dest, size_t __n)
      __THROW __nonnull ((1, 2));
@@ -551,7 +551,7 @@ extern int strncasecmp_l (const char *__s1, const char *__s2,
      __THROW __attribute_pure__ __nonnull ((1, 2, 4));
 #endif
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* Return the next DELIM-delimited token from *STRINGP,
    terminating it with a '\0', and update *STRINGP to point past it.  */
 extern char *strsep (char **__restrict __stringp,
diff --git a/string/strings.h b/string/strings.h
index 994c4b048c..872a0b252a 100644
--- a/string/strings.h
+++ b/string/strings.h
@@ -19,9 +19,9 @@
 #define	_STRINGS_H	1
 
 /* We don't need and should not read this file if <string.h> was already
-   read. The one exception being that if __USE_BSD isn't defined, then
+   read. The one exception being that if __USE_MISC isn't defined, then
    these aren't defined in string.h, so we need to define them here.  */
-#if !defined _STRING_H || !defined __USE_BSD
+#if !defined _STRING_H || !defined __USE_MISC
 
 # include <features.h>
 # define __need_size_t
diff --git a/sysdeps/generic/netinet/ip.h b/sysdeps/generic/netinet/ip.h
index ecf340e07f..7f90382c3d 100644
--- a/sysdeps/generic/netinet/ip.h
+++ b/sysdeps/generic/netinet/ip.h
@@ -64,7 +64,7 @@ struct iphdr
     /*The options start here. */
   };
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /*
  * Copyright (c) 1982, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -146,7 +146,7 @@ struct ip_timestamp
 #endif
     u_int32_t data[9];
   };
-#endif /* __USE_BSD */
+#endif /* __USE_MISC */
 
 #define	IPVERSION	4               /* IP version number */
 #define	IP_MAXPACKET	65535		/* maximum packet size */
diff --git a/sysdeps/gnu/netinet/ip_icmp.h b/sysdeps/gnu/netinet/ip_icmp.h
index e7a351e966..02c5b5e8eb 100644
--- a/sysdeps/gnu/netinet/ip_icmp.h
+++ b/sysdeps/gnu/netinet/ip_icmp.h
@@ -90,7 +90,7 @@ struct icmphdr
 #define ICMP_EXC_FRAGTIME	1	/* Fragment Reass time exceeded	*/
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /*
  * Copyright (c) 1982, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -275,7 +275,7 @@ struct icmp
 	(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
 	(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
 
-#endif /* __USE_BSD */
+#endif /* __USE_MISC */
 
 __END_DECLS
 
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h
index 135aba3bc9..109cc07201 100644
--- a/sysdeps/mach/hurd/bits/fcntl.h
+++ b/sysdeps/mach/hurd/bits/fcntl.h
@@ -103,7 +103,7 @@
    fail with EAGAIN.  */
 
 #define	O_NONBLOCK	0x0008	/* Non-blocking open or non-blocking I/O.  */
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define O_NDELAY	O_NONBLOCK /* Deprecated.  */
 #endif
 
@@ -134,7 +134,7 @@
 #define	O_NOCTTY	0	/* Don't assign a controlling terminal.  */
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Bits in the file status flags returned by F_GETFL.  */
 # define FREAD		O_RDONLY
 # define FWRITE		O_WRONLY
@@ -159,7 +159,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 # define F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index e6bec34660..6f7a781119 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -223,7 +223,7 @@ struct stat64
 #endif
 
 /* Default file creation mask (umask).  */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define CMASK		0022
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/mman.h b/sysdeps/unix/sysv/linux/alpha/bits/mman.h
index 650e5e370b..6cab851de5 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/mman.h
@@ -55,7 +55,7 @@
 #undef  MS_INVALIDATE
 #define MS_INVALIDATE	  4
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # undef  MADV_DONTNEED
 # define MADV_DONTNEED    6
 #endif
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
index 4310585563..1780a5687d 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
@@ -70,7 +70,7 @@ struct termios
 #define ICRNL	0000400
 #define IXON	0001000
 #define IXOFF	0002000
-#ifdef __USE_BSD
+#ifdef __USE_MISC
   /* POSIX.1 doesn't want these... */
 # define IXANY		0004000
 # define IUCLC		0010000
diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index cd4722b836..0be95955fc 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
@@ -158,7 +158,7 @@
 # define __F_GETOWN	9
 #endif
 
-#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_SETOWN	__F_SETOWN /* Get owner (process receiving SIGIO).  */
 # define F_GETOWN	__F_GETOWN /* Set owner (process receiving SIGIO).  */
 #endif
@@ -208,7 +208,7 @@
 # define F_SHLCK		8	/* or 4 */
 #endif
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Operations for BSD flock, also used by the kernel implementation.  */
 # define LOCK_SH	1	/* Shared lock.  */
 # define LOCK_EX	2	/* Exclusive lock.  */
@@ -256,7 +256,7 @@ struct f_owner_ex
 
 /* Define some more compatibility macros to be backward compatible with
    BSD systems which did not managed to hide these kernel macros.  */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define FAPPEND	O_APPEND
 # define FFSYNC		O_FSYNC
 # define FASYNC		O_ASYNC
diff --git a/sysdeps/unix/sysv/linux/bits/mman-linux.h b/sysdeps/unix/sysv/linux/bits/mman-linux.h
index 5473986015..45f76f568c 100644
--- a/sysdeps/unix/sysv/linux/bits/mman-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/mman-linux.h
@@ -72,7 +72,7 @@
 #endif
 
 /* Advice to `madvise'.  */
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define MADV_NORMAL	  0	/* No further special treatment.  */
 # define MADV_RANDOM	  1	/* Expect random page references.  */
 # define MADV_SEQUENTIAL  2	/* Expect sequential page references.  */
diff --git a/sysdeps/unix/sysv/linux/bits/sys_errlist.h b/sysdeps/unix/sysv/linux/bits/sys_errlist.h
index 47ba9ceba9..4f4b9862f7 100644
--- a/sysdeps/unix/sysv/linux/bits/sys_errlist.h
+++ b/sysdeps/unix/sysv/linux/bits/sys_errlist.h
@@ -22,7 +22,7 @@
 
 /* sys_errlist and sys_nerr are deprecated.  Use strerror instead.  */
 
-#ifdef  __USE_BSD
+#ifdef  __USE_MISC
 extern int sys_nerr;
 extern const char *const sys_errlist[];
 #endif
diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h
index db283c8b25..12333d224f 100644
--- a/sysdeps/unix/sysv/linux/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/bits/termios.h
@@ -194,7 +194,7 @@ struct termios
 # define PENDIN	 0040000
 #endif
 #define IEXTEN	0100000
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define EXTPROC 0200000
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h
index 51059f5336..fac0f82738 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h
@@ -193,7 +193,7 @@ struct termios
 #endif
 #define TOSTOP	0100000		/* Send SIGTTOU for background output.  */
 #define ITOSTOP	TOSTOP
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define EXTPROC 0200000
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/netinet/if_ether.h b/sysdeps/unix/sysv/linux/netinet/if_ether.h
index 51f7f67b85..81037ce1ca 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_ether.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_ether.h
@@ -24,7 +24,7 @@
 /* Get definitions from kernel header file.  */
 #include <linux/if_ether.h>
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /*
  * Copyright (c) 1982, 1986, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -99,6 +99,6 @@ struct	ether_arp {
 }
 
 __END_DECLS
-#endif /* __USE_BSD */
+#endif /* __USE_MISC */
 
 #endif /* netinet/if_ether.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/if_fddi.h b/sysdeps/unix/sysv/linux/netinet/if_fddi.h
index 67bdf02748..795c6e7d87 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_fddi.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_fddi.h
@@ -24,7 +24,7 @@
 
 #include <linux/if_fddi.h>
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 
 struct fddi_header {
   u_int8_t fddi_fc;                    /* Frame Control (FC) value */
diff --git a/sysdeps/unix/sysv/linux/netinet/if_tr.h b/sysdeps/unix/sysv/linux/netinet/if_tr.h
index 068d725472..d3d1352dc9 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_tr.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_tr.h
@@ -93,7 +93,7 @@ struct tr_statistics
 #define TR_RCF_BROADCAST_MASK 	0xC000
 #define TR_MAXRIFLEN 		18
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 
 struct trn_hdr
 {
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
index d5dbdaa579..de57249ec4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
@@ -202,7 +202,7 @@ struct termios {
 # define PENDIN	0x20000000
 #endif
 #define IEXTEN	0x00000400
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define EXTPROC 0x10000000
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h
index 0109cdd10d..94524b32b8 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h
@@ -196,7 +196,7 @@ struct termios
 # define PENDIN		0x00004000
 #endif
 #define IEXTEN	0x00008000
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # define EXTPROC 0x00010000
 #endif
 
diff --git a/sysdeps/x86/bits/string.h b/sysdeps/x86/bits/string.h
index a401a0d215..30c88d6315 100644
--- a/sysdeps/x86/bits/string.h
+++ b/sysdeps/x86/bits/string.h
@@ -1373,7 +1373,7 @@ __strchrnul_g (const char *__s, int __c)
 # endif
 
 
-# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Find the first occurrence of C in S.  This is the BSD name.  */
 #  define _HAVE_STRING_ARCH_index 1
 #  define index(s, c) \
@@ -1487,7 +1487,7 @@ __strrchr_g (const char *__s, int __c)
 # endif
 
 
-# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Find the last occurrence of C in S.  This is the BSD name.  */
 #  define _HAVE_STRING_ARCH_rindex 1
 #  define rindex(s, c) \
@@ -1957,7 +1957,7 @@ __strstr_g (const char *__haystack, const char *__needle)
 
 /* Bit find functions.  We define only the i686 version since for the other
    processors gcc generates good code.  */
-# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 #  ifdef __i686__
 #   define _HAVE_STRING_ARCH_ffs 1
 #   define ffs(word) (__builtin_constant_p (word)			      \
diff --git a/sysvipc/sys/ipc.h b/sysvipc/sys/ipc.h
index a1af5314f4..0ea5e56a5e 100644
--- a/sysvipc/sys/ipc.h
+++ b/sysvipc/sys/ipc.h
@@ -20,7 +20,7 @@
 
 #include <features.h>
 
-#if !defined __USE_SVID && !defined __USE_XOPEN && __GNUC__ >= 2
+#if !defined __USE_MISC && !defined __USE_XOPEN && __GNUC__ >= 2
 # warning "Files using this header must be compiled with _GNU_SOURCE or _XOPEN_SOURCE"
 #endif
 
diff --git a/termios/termios.h b/termios/termios.h
index 827ee23c0e..715dc22a5c 100644
--- a/termios/termios.h
+++ b/termios/termios.h
@@ -38,7 +38,7 @@ __BEGIN_DECLS
    `cc_t', `speed_t', and all the macros specifying the flag bits.  */
 #include <bits/termios.h>
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Compare a character C to a value VAL from the `c_cc' array in a
    `struct termios'.  If VAL is _POSIX_VDISABLE, no character can match it.  */
 # define CCEQ(val, c)	((c) == (val) && (val) != _POSIX_VDISABLE)
@@ -56,7 +56,7 @@ extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) __THROW;
 /* Set the input baud rate stored in *TERMIOS_P to SPEED.  */
 extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW;
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* Set both the input and output baud rates in *TERMIOS_OP to SPEED.  */
 extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW;
 #endif
@@ -71,7 +71,7 @@ extern int tcsetattr (int __fd, int __optional_actions,
 		      const struct termios *__termios_p) __THROW;
 
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* Set *TERMIOS_P to indicate raw mode.  */
 extern void cfmakeraw (struct termios *__termios_p) __THROW;
 #endif
@@ -100,7 +100,7 @@ extern __pid_t tcgetsid (int __fd) __THROW;
 #endif
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 # include <sys/ttydefaults.h>
 #endif
 
diff --git a/time/sys/time.h b/time/sys/time.h
index c01b23bc66..60cf2d2289 100644
--- a/time/sys/time.h
+++ b/time/sys/time.h
@@ -49,7 +49,7 @@ __BEGIN_DECLS
 #endif
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Structure crudely representing a timezone.
    This is obsolete and should never be used.  */
 struct timezone
@@ -71,7 +71,7 @@ typedef void *__restrict __timezone_ptr_t;
 extern int gettimeofday (struct timeval *__restrict __tv,
 			 __timezone_ptr_t __tz) __THROW __nonnull ((1));
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Set the current time of day and timezone information.
    This call is restricted to the super-user.  */
 extern int settimeofday (const struct timeval *__tv,
@@ -138,7 +138,7 @@ extern int setitimer (__itimer_which_t __which,
 extern int utimes (const char *__file, const struct timeval __tvp[2])
      __THROW __nonnull ((1));
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Same as `utimes', but does not follow symbolic links.  */
 extern int lutimes (const char *__file, const struct timeval __tvp[2])
      __THROW __nonnull ((1));
@@ -156,7 +156,7 @@ extern int futimesat (int __fd, const char *__file,
 #endif
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* Convenience macros for operations on timevals.
    NOTE: `timercmp' does not work for >= or <=.  */
 # define timerisset(tvp)	((tvp)->tv_sec || (tvp)->tv_usec)
diff --git a/time/time.h b/time/time.h
index 9777dd9684..99b84749a8 100644
--- a/time/time.h
+++ b/time/time.h
@@ -74,7 +74,7 @@ __BEGIN_NAMESPACE_STD
 /* Returned by `time'.  */
 typedef __time_t time_t;
 __END_NAMESPACE_STD
-#if defined __USE_POSIX || defined __USE_MISC || defined __USE_SVID
+#if defined __USE_POSIX || defined __USE_MISC || defined __USE_MISC
 __USING_NAMESPACE_STD(time_t)
 #endif
 
@@ -142,7 +142,7 @@ struct tm
   int tm_yday;			/* Days in year.[0-365]	*/
   int tm_isdst;			/* DST.		[-1/0/1]*/
 
-# ifdef	__USE_BSD
+# ifdef	__USE_MISC
   long int tm_gmtoff;		/* Seconds east of UTC.  */
   const char *tm_zone;		/* Timezone abbreviation.  */
 # else
@@ -293,12 +293,12 @@ extern char *tzname[2];
 extern void tzset (void) __THROW;
 # endif
 
-# if defined __USE_SVID || defined __USE_XOPEN
+# if defined __USE_MISC || defined __USE_XOPEN
 extern int daylight;
 extern long int timezone;
 # endif
 
-# ifdef __USE_SVID
+# ifdef __USE_MISC
 /* Set the system time to *WHEN.
    This call is restricted to the superuser.  */
 extern int stime (const time_t *__when) __THROW;