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


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

Remove _BSD_SOURCE and _SVID_SOURCE


This patch removes support for the _BSD_SOURCE and _SVID_SOURCE
feature test macros, as suggested by Roland in
<https://sourceware.org/ml/libc-alpha/2013-04/msg00355.html>; it also
removes the libbsd-compat library (which has long been a dummy library
not doing anything, but was documented as if it did something).  It
does not obsolete any APIs enabled by those macros, except for
__FAVOR_BSD features no longer being available (anonymous unions are
used as Roland suggested for struct tcphdr/udphdr, as it appears
_BSD_SOURCE is actually being used in practice to enable the BSD names
there - it may be necessary to condition the anonymous unions in some
way depending on compiler support).

If anyone wishes to obsolete any BSD/SVID APIs, all conditioned by
__USE_MISC after this patch, or to restrict any of them to
_GNU_SOURCE, or to change conditions such as __USE_MISC ||
__USE_UNIX98 to remove the __USE_MISC case so the APIs aren't visible
by default, such changes should be proposed separately for particular
APIs or groups of APIs in separate threads.  (Obsoleting an API would
mean removing header definitions associated with it and making the
exported symbols into compat symbols only available for existing
binaries.  Or, there could be two-stage obsoletion, first marking
functions with "deprecated" attributes and only later or never making
them into compat symbols.)

In more detail:

The status quo is that the features enabled by _BSD_SOURCE or
_SVID_SOURCE are enabled (a) if the applicable one of those macros is
defined by the user (a case that will no longer be supported), (b) by
default, if the user didn't use a compiler option such as -ansi or
-std=c99 that defines __STRICT_ANSI__ and didn't define
_ISOC99_SOURCE, _POSIX_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE (or
_BSD_SOURCE or _SVID_SOURCE), (c) if _GNU_SOURCE is defined.  There's
the oddity of (b) not checking _ISOC11_SOURCE, but it's not the
function of this patch to change anything in that regard.

The patch retains the status quo for cases not defining _BSD_SOURCE or
_SVID_SOURCE - that is, enabling the relevant features if _GNU_SOURCE
is defined or none of the other macros are defined to disable them.
If none of the macros are defined that would disable those features,
it is also the case that _POSIX_C_SOURCE is defined by features.h to
200809L, and that's the case for _GNU_SOURCE as well.  Thus, all of
__USE_POSIX, __USE_POSIX2, __USE_POSIX199309, __USE_POSIX199506,
__USE_XOPEN2K, __USE_ISOC95, __USE_ISOC99, __USE_XOPEN2K8,
__USE_ATFILE are also defined, and any conditionals that enable a
feature for (__USE_X || __USE_MISC), for __USE_X being one of those
macros, can be simplified accordingly not to mention __USE_MISC, and
this patch makes those simplifications (whether or not the particular
__USE_MISC uses in question arose from conversion of __USE_BSD and
__USE_SVID - the *redundancy* of __USE_MISC still arises from this
patch, by eliminating the previous ways of getting __USE_MISC defined
without the other features).  The other way round, "__USE_MISC ||
__USE_GNU" can just test __USE_MISC.

I should note that I'm unconvinced that the original intent of using
only a single __USE_* macro in any given place is a good idea for the
set of standards we support today; if something is present in all
standards based on Unix98 or C99, "defined __USE_UNIX98 || defined
__USE_ISOC99" seems like a perfectly reasonable way to express things
and a macro for the combination just seems like undue complication.  I
do expect there are lots of places where the combinations used can in
fact be simplified, using the rules about which standard imply which
others, and more simplification may be possible if the only standards
defining a given header are based on standard X and so we can just
assume X is enabled within that header.

The BSD sigpause function is made unavailable by this patch.  Arguably
it should be made a compat symbol, with the POSIX version getting the
sigpause name at a new symbol version rather than relying on
redirection to __xpg_sigpause (which itself would also become a compat
symbol), since the function meets the criteria for being callable
without including a header (no types defined in headers are involved
in the function type), but this patch does not do that (I propose to
file a bug in Bugzilla for it).

The setjmp function declared in headers is the BSD version and the
setjmp macro that hides it maps it to _setjmp.  Arguably the exported
setjmp function (defined in bsd-setjmp.[cS] for each architecture)
should also be made a compat symbol and no longer declared in the
header (and not provided for new ports); ISO C makes it undefined
behavior to undefine a setjmp macro to access any underlying function.
I propose filing a bug in Bugzilla for that as well.

Tested x86_64 and x86.

2013-12-05  Joseph Myers  <joseph@codesourcery.com>

	* include/features.h: Update comment documenting feature test
	macros.
	[_BSD_SOURCE]: Do not handle macro.
	[_SVID_SOURCE]: Likewise.
	(__USE_BSD): Do not define.
	(__USE_SVID): Likewise.
	(__FAVOR_BSD): Likewise.
	(__USE_MISC): Define directly instead of defining _BSD_SOURCE and
	_SVID_SOURCE.
	* manual/creature.texi (_BSD_SOURCE): Remove documentation.
	(_SVID_SOURCE): Likewise.
	(_GNU_SOURCE): Do not mention interaction with _BSD_SOURCE.
	Update description of default features.
	* manual/filesys.texi (__ftw_func_t): Do not refer to _BSD_SOURCE.
	(S_ISVTX): Likewise.
	* manual/job.texi (getpgrp): Do not document BSD version.
	(getpgid): Do not document by reference to BSD getpgrp.
	* manual/math.texi (Mathematical Constants): Do not refer to
	_BSD_SOURCE.
	* manual/signal.texi (Interrupted Primitives): Likewise.
	* manual/startup.texi (putenv): Do not refer to _SVID_SOURCE.
	* bits/fcntl.h [__USE_BSD]: Change conditionals to [__USE_MISC] or
	remove where redundant.
	* bits/mman.h [__USE_BSD]: Change conditionals to [__USE_MISC].
	[__USE_MISC]: Remove redundant conditional.
	* bits/sigaction.h [__USE_MISC]: Remove redundant conditional.
	* bits/termios.h [__USE_BSD]: Change conditionals to [__USE_MISC].
	* bits/waitstatus.h [__USE_BSD]: Likewise.
	* ctype/ctype.h [__USE_SVID]: Remove conditionals redundant with
	[__USE_MISC].
	* dirent/dirent.h [__USE_BSD]: Change conditionals to [__USE_MISC]
	or remove where redundant.
	[__USE_MISC]: Remove redundant conditionals.
	* grp/grp.h [__USE_SVID]: Change conditionals to [__USE_MISC] or
	remove where redundant.
	[__USE_BSD]: Likewise.
	[__USE_MISC]: Remove redundant conditionals.
	* inet/netinet/igmp.h [__USE_BSD]: Change conditional to
	[__USE_MISC].
	* inet/netinet/in.h [__USE_GNU]: Remove conditionals redundant
	with [__USE_MISC].
	* io/fcntl.h [__USE_BSD]: Remove redundant conditional.
	* io/ftw.h [__USE_BSD]: Change conditional to [__USE_MISC].
	* io/sys/stat.h [__USE_BSD]: Change conditionals to [__USE_MISC]
	or remove where redundant.
	[__USE_MISC]: Remove redundant conditionals.
	* libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise.
	* libio/bits/stdio.h [__USE_MISC]: Likewise.
	* libio/bits/stdio2.h [__USE_BSD]: Likewise.
	* libio/stdio.h [__USE_SVID]: Change conditionals to [__USE_MISC]
	or remove where redundant.
	[__USE_BSD]: Likewise.
	[__USE_MISC]: Remove redundant conditionals.
	* math/bits/math-finite.h [__USE_MISC]: Likewise.
	* math/bits/mathcalls.h [__USE_MISC]: Likewise.
	* math/math.h [__USE_MISC]: Likewise.
	[__USE_SVID]: Change conditionals to [__USE_MISC].
	[__USE_BSD]: Likewise.
	* math/test-matherr.c (_SVID_SOURCE): Do not define.
	* misc/Makefile (install-lib): Remove libbsd-compat.a.
	($(objpfx)libbsd-compat.a): Remove rule.
	* misc/bits/syslog-ldbl.h [__USE_BSD]: Change conditionals to
	[__USE_MISC].
	* misc/bits/syslog.h [__USE_BSD]: Likwise.
	* 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]: Change conditionals to
	[__USE_MISC] or remove where redundant.
	* posix/glob.h [__USE_BSD]: Remove redundant conditional.
	* posix/regex.h [__USE_BSD]: Change conditional to [__USE_MISC].
	* posix/sys/types.h [_USE_BSD]: Change conditionals to
	[__USE_MISC].
	[__USE_SVID]: Change conditionals to [__USE_MISC] or remove where
	redundant.
	* posix/sys/utsname.h [__USE_SVID]: Change conditional to
	[__USE_MISC].
	* posix/sys/wait.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Change conditionals to [__USE_MISC] or remove where
	redundant.
	* posix/unistd.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	[__USE_MISC]: Remove redundant conditionals.
	[__FAVOR_BSD]: Remove conditional code.
	* pwd/pwd.h [__USE_GNU]: Remove redundant conditionals.
	[__USE_MISC]: Likewise.
	[__USE_SVID]: Change conditionals to [__USE_MISC] or remove where
	redundant.
	* resolv/netdb.h [__USE_GNU]: Remove redundant conditionals.
	[__USE_BSD]: Change conditionals to [__USE_MISC].
	* setjmp/setjmp.h [__FAVOR_BSD]: Remove conditional code.
	[__USE_BSD]: Change conditionals to [__USE_MISC].
	* signal/signal.h [__USE_BSD]: Change conditionals to [__USE_MISC]
	or remove where redundant.
	[__USE_SVID]: Likewise.
	[__USE_MISC]: Remove redundant conditionals.
	[__FAVOR_BSD]: Remove conditional code.
	* socket/sys/socket.h [__USE_BSD]: Change conditional to
	[__USE_MISC].
	* stdlib/fmtmsg.h [__USE_SVID]: Likewise.
	* stdlib/stdlib.h [__USE_BSD]: Change conditionals to [__USE_MISC]
	or remove where redundant.
	[__USE_SVID]: Likewise.
	[__USE_MISC]: Remove redundant conditionals.
	[__USE_GNU]: Likewise.
	* string/bits/string2.h [__USE_BSD]: Change conditionals to
	[__USE_MISC] or remove where redundant.
	[__USE_SVID]: Likewise.
	[__USE_MISC]: Remove redundant conditionals.
	* string/bits/string3.h [__USE_BSD]: Change conditionals to
	[__USE_MISC].
	* string/endian.h [__USE_BSD]: Likewise.
	* string/string.h [__USE_BSD]: Change conditionals to [__USE_MISC]
	or remove where redundant.
	[__USE_SVID]: Likewise.
	[__USE_MISC]: Remove redundant conditionals.
	* string/strings.h [__USE_BSD]: Change conditional to
	[__USE_MISC].
	* sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise.
	* sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise.
	* sysdeps/gnu/netinet/tcp.h (struct tcphdr): Use anonymous unions
	instead of making contents conditional on [__FAVOR_BSD].
	* sysdeps/gnu/netinet/udp.h (struct udphdr): Likewise.
	* sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Change conditionals
	to [__USE_MISC] or remove where redundant.
	* sysdeps/mach/hurd/bits/stat.h [__USE_MISC]: Remove redundant
	conditionals.
	[__USE_BSD]: Change conditional to [__USE_MISC].
	* sysdeps/unix/bsd/bsd4.4/bits/errno.h [__USE_BSD]: Likewise.
	* sysdeps/unix/bsd/bsdstat.h (__USE_BSD): Remove #undef.
	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]: Change
	conditionals to [__USE_MISC] ot remove where redundant.
	* sysdeps/unix/sysv/linux/bits/in.h [__USE_GNU]: Remove redundant
	conditionals.
	* sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Change
	conditional to [__USE_MISC].
	* sysdeps/unix/sysv/linux/bits/sigaction.h [__USE_MISC]: Remove
	redundant conditional.
	* sysdeps/unix/sysv/linux/bits/socket.h [__USE_GNU]: Likewise.
	* sysdeps/unix/sysv/linux/bits/stat.h [__USE_MISC]: Likewise.
	* sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]: Change
	conditional to [__USE_MISC].
	* sysdeps/unix/sysv/linux/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/stat.h [__USE_MISC]: Remove
	redundant conditionals.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]:
	Change conditional to [__USE_MISC].
	* sysdeps/unix/sysv/linux/s390/bits/sigaction.h [__USE_MISC]:
	Remove redundant conditional.
	* sysdeps/unix/sysv/linux/s390/bits/stat.h [__USE_MISC]: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h [__USE_MISC]:
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/stat.h [__USE_MISC]:
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]: Change
	conditional to [__USE_MISC].
	* sysdeps/unix/sysv/linux/x86/bits/stat.h [__USE_MISC]: Remove
	redundant conditionals.
	* sysdeps/x86/bits/string.h [__USE_BSD]: Change conditionals to
	[__USE_MISC].
	* sysdeps/x86/fpu/bits/mathinline.h [__USE_MISC]: Remove redundant
	conditionals.
	* sysvipc/sys/ipc.h [__USE_SVID]: Change conditional to
	[__USE_MISC].
	* termios/termios.h [__USE_BSD]: Likewise.
	* time/sys/time.h [__USE_BSD]: Likewise.
	* time/time.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Change conditionals to [__USE_MISC] or remove where
	redundant.
	[__USE_MISC]: Remove redundant conditionals.

ports/ChangeLog.alpha:
2013-12-05  Joseph Myers  <joseph@codesourcery.com>

	* ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]:
	Change conditionals to [__USE_MISC].
	* ports/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
	[__USE_MISC]: Remove redundant conditional.
	* ports/sysdeps/unix/sysv/linux/alpha/bits/stat.h [__USE_MISC]:
	Likewise.
	* ports/sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]:
	Change conditional to [__USE_MISC].

ports/ChangeLog.am33:
2013-12-05  Joseph Myers  <joseph@codesourcery.com>

	* ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h [__USE_BSD]:
	Change conditionals to [__USE_MISC] or remove where redundant.

ports/ChangeLog.hppa:
2013-12-05  Joseph Myers  <joseph@codesourcery.com>

	* ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]:
	Change conditional to [__USE_MISC].

ports/ChangeLog.ia64:
2013-12-05  Joseph Myers  <joseph@codesourcery.com>

	* ports/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h
	[__USE_MISC]: Remove redundant conditional.

ports/ChangeLog.m68k:
2013-12-05  Joseph Myers  <joseph@codesourcery.com>

	* ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h [__USE_MISC]:
	Remove redundant conditionals.
	* ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h [__USE_MISC]:
	Likewise.

ports/ChangeLog.mips:
2013-12-05  Joseph Myers  <joseph@codesourcery.com>

	* ports/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
	[__USE_MISC]: Remove redundant conditional.
	* ports/sysdeps/unix/sysv/linux/mips/bits/stat.h [__USE_MISC]:
	Likewise.
	* ports/sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]:
	Change conditional to [__USE_MISC].

diff --git a/NEWS b/NEWS
index c9ba3b7..8127989 100644
--- a/NEWS
+++ b/NEWS
@@ -97,6 +97,13 @@ Version 2.19
 * Support for powerpc64le has been added.
 
 * The soft-float powerpc port now supports e500 processors.
+
+* The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer
+  supported.  Except for cases where _BSD_SOURCE enabled BSD interfaces that
+  conflicted with POSIX, the interfaces those macros enabled remain
+  available when compiling with _GNU_SOURCE defined or without any feature
+  test macros defined.  The libbsd-compat library (which was a dummy library
+  that did nothing) has also been removed.
 
 Version 2.18
 
diff --git a/bits/fcntl.h b/bits/fcntl.h
index 09094d3..7d8185e 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_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 e04e614..5c64d53 100644
--- a/bits/mman.h
+++ b/bits/mman.h
@@ -37,17 +37,15 @@
 /* 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.  */
-# ifdef __USE_MISC
-#  define MAP_ANONYMOUS  MAP_ANON /* Linux name. */
-# endif
+# define MAP_ANONYMOUS	 MAP_ANON /* Linux name. */
 #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 +53,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/sigaction.h b/bits/sigaction.h
index ee92c37..22801db 100644
--- a/bits/sigaction.h
+++ b/bits/sigaction.h
@@ -55,7 +55,7 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK	0x0001	/* Take signal on signal stack.  */
 #endif
-#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define SA_RESTART	0x0002	/* Restart syscall on signal return.  */
 # define SA_NODEFER	0x0010	/* Don't automatically block the signal when
 				    its handler is being executed.  */
diff --git a/bits/termios.h b/bits/termios.h
index 23f3d54..e94ed5f 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 8385d5a..e7b21dd 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>
 
@@ -102,4 +102,4 @@ union wait
 # define w_stopsig	__wait_stopped.__w_stopsig
 # define w_stopval	__wait_stopped.__w_stopval
 
-#endif	/* Use BSD.  */
+#endif	/* Use misc.  */
diff --git a/ctype/ctype.h b/ctype/ctype.h
index c8b19ea..5e054fe 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_XOPEN
 
 /* Return nonzero iff C is in the ASCII set
    (i.e., is no more than 7 bits wide).  */
@@ -157,7 +157,7 @@ extern int toascii (int __c) __THROW;
    check the argument for being in the range of a `char'.  */
 __exctype (_toupper);
 __exctype (_tolower);
-#endif /* Use SVID or use misc.  */
+#endif /* Use X/Open or use misc.  */
 
 /* This code is needed for the optimized mapping functions.  */
 #define __tobody(c, f, a, args) \
@@ -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_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
+#  ifdef __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
+#  ifdef __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 aa22fc8..cb02223 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 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
   {
@@ -173,7 +173,7 @@ extern struct dirent *__REDIRECT (readdir, (DIR *__dirp), readdir64)
 extern struct dirent64 *readdir64 (DIR *__dirp) __nonnull ((1));
 #endif
 
-#if defined __USE_POSIX || defined __USE_MISC
+#ifdef __USE_POSIX
 /* Reentrant version of `readdir'.  Return in RESULT a pointer to the
    next entry.
 
@@ -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_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
+#ifdef __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
+# ifdef __USE_MISC
 #  ifndef MAXNAMLEN
 /* Get the definitions of the POSIX.1 limits.  */
 #  include <bits/posix1_lim.h>
@@ -340,10 +340,10 @@ extern int alphasort64 (const struct dirent64 **__e1,
 			const struct dirent64 **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # endif
-#endif /* Use BSD or misc or XPG7.  */
+#endif /* Use XPG7.  */
 
 
-#if defined __USE_BSD || defined __USE_MISC
+#ifdef __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
@@ -371,7 +371,7 @@ extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
 				  __off64_t *__restrict __basep)
      __THROW __nonnull ((2, 4));
 # endif
-#endif /* Use BSD or misc.  */
+#endif /* Use misc.  */
 
 #ifdef __USE_GNU
 /* Function to compare two `struct dirent's by name & version.  */
diff --git a/grp/grp.h b/grp/grp.h
index 3cbfc26..f9223a5 100644
--- a/grp/grp.h
+++ b/grp/grp.h
@@ -48,13 +48,13 @@ struct group
   };
 
 
-#if defined __USE_SVID || defined __USE_GNU
+#ifdef __USE_MISC
 # define __need_FILE
 # include <stdio.h>
 #endif
 
 
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Rewind the group-file stream.
 
    This function is a possible cancellation point and therefore not
@@ -62,8 +62,7 @@ struct group
 extern void setgrent (void);
 #endif
 
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED \
-    || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* Close the group-file stream.
 
    This function is a possible cancellation point and therefore not
@@ -77,7 +76,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
@@ -110,7 +109,7 @@ extern struct group *getgrgid (__gid_t __gid);
    marked with __THROW.  */
 extern struct group *getgrnam (const char *__name);
 
-#if defined __USE_POSIX || defined __USE_MISC
+#ifdef __USE_POSIX
 
 # ifdef __USE_MISC
 /* Reasonable value for the buffer sized used in the reentrant
@@ -154,7 +153,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 +170,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>
@@ -200,7 +199,7 @@ extern int getgrouplist (const char *__user, __gid_t __group,
    therefore not marked with __THROW.  */
 extern int initgroups (const char *__user, __gid_t __group);
 
-#endif /* Use BSD.  */
+#endif /* Use misc.  */
 
 __END_DECLS
 
diff --git a/include/features.h b/include/features.h
index c9be10a..50c43be 100644
--- a/include/features.h
+++ b/include/features.h
@@ -37,8 +37,6 @@
    _LARGEFILE_SOURCE	Some more functions for correct standard I/O.
    _LARGEFILE64_SOURCE	Additional functionality from LFS for large files.
    _FILE_OFFSET_BITS=N	Select default filesystem interface.
-   _BSD_SOURCE		ISO C, POSIX, and 4.3BSD things.
-   _SVID_SOURCE		ISO C, POSIX, and SVID things.
    _ATFILE_SOURCE	Additional *at interfaces.
    _GNU_SOURCE		All of the above, plus GNU extensions.
    _REENTRANT		Select additionally reentrant object.
@@ -46,12 +44,14 @@
    _FORTIFY_SOURCE	If set to numeric value > 0 additional security
 			measures are defined, according to level.
 
-   The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
-   If none of these are defined, the default is to have _SVID_SOURCE,
-   _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
-   200112L.  If more than one of these are defined, they accumulate.
-   For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
-   together give you ISO C, 1003.1, and 1003.2, but nothing else.
+   The `-ansi' switch to the GNU C compiler, and standards conformance
+   options such as `-std=c99', define __STRICT_ANSI__.  If none of
+   these are defined, the default is to have _POSIX_SOURCE set to one
+   and _POSIX_C_SOURCE set to 200809L, as well as enabling
+   miscellaneous functions from BSD and SVID.  If more than one of
+   these are defined, they accumulate.  For example __STRICT_ANSI__,
+   _POSIX_SOURCE and _POSIX_C_SOURCE together give you ISO C, 1003.1,
+   and 1003.2, but nothing else.
 
    These are defined by this file and are used by the
    header files to decide what to declare or define:
@@ -73,14 +73,11 @@
    __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.
    __USE_FORTIFY_LEVEL	Additional security measures used, according to level.
-   __FAVOR_BSD		Favor 4.3BSD things in cases of conflict.
 
    The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
    defined by this file unconditionally.  `__GNU_LIBRARY__' is provided
@@ -113,14 +110,11 @@
 #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
 #undef	__USE_REENTRANT
 #undef	__USE_FORTIFY_LEVEL
-#undef	__FAVOR_BSD
 #undef	__KERNEL_STRICT_NAMES
 
 /* Suppress kernel-name space pollution unless user expressedly asks
@@ -144,13 +138,6 @@
 #endif
 
 
-/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX.  */
-#if defined _BSD_SOURCE && \
-    !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
-      defined _XOPEN_SOURCE || defined _GNU_SOURCE || defined _SVID_SOURCE)
-# define __FAVOR_BSD	1
-#endif
-
 /* If _GNU_SOURCE was defined by the user, turn on all the other features.  */
 #ifdef _GNU_SOURCE
 # undef  _ISOC95_SOURCE
@@ -169,21 +156,17 @@
 # define _XOPEN_SOURCE_EXTENDED	1
 # undef	 _LARGEFILE64_SOURCE
 # define _LARGEFILE64_SOURCE	1
-# undef  _BSD_SOURCE
-# define _BSD_SOURCE	1
-# undef  _SVID_SOURCE
-# define _SVID_SOURCE	1
 # undef  _ATFILE_SOURCE
 # define _ATFILE_SOURCE	1
+# define __USE_MISC	1
 #endif
 
-/* If nothing (other than _GNU_SOURCE) is defined,
-   define _BSD_SOURCE and _SVID_SOURCE.  */
+/* If nothing (other than _GNU_SOURCE) is defined, define
+   __USE_MISC.  */
 #if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
      !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
-     !defined _XOPEN_SOURCE && !defined _BSD_SOURCE && !defined _SVID_SOURCE)
-# define _BSD_SOURCE	1
-# define _SVID_SOURCE	1
+     !defined _XOPEN_SOURCE)
+# define __USE_MISC	1
 #endif
 
 /* This is to enable the ISO C11 extension.  */
@@ -298,18 +281,6 @@
 # define __USE_FILE_OFFSET64	1
 #endif
 
-#if defined _BSD_SOURCE || defined _SVID_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 915dcab..ee194e3 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/inet/netinet/in.h b/inet/netinet/in.h
index 05c77e2..a66f167 100644
--- a/inet/netinet/in.h
+++ b/inet/netinet/in.h
@@ -211,13 +211,13 @@ struct in6_addr
     union
       {
 	uint8_t	__u6_addr8[16];
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 	uint16_t __u6_addr16[8];
 	uint32_t __u6_addr32[4];
 #endif
       } __in6_u;
 #define s6_addr			__in6_u.__u6_addr8
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 # define s6_addr16		__in6_u.__u6_addr16
 # define s6_addr32		__in6_u.__u6_addr32
 #endif
@@ -259,7 +259,7 @@ struct sockaddr_in6
   };
 #endif /* !__USE_KERNEL_IPV6_DEFS */
 
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 /* IPv4 multicast request.  */
 struct ip_mreq
   {
@@ -295,7 +295,7 @@ struct ipv6_mreq
   };
 #endif /* !__USE_KERNEL_IPV6_DEFS */
 
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 /* Multicast group request.  */
 struct group_req
   {
@@ -496,7 +496,7 @@ extern uint16_t htons (uint16_t __hostshort)
 
 #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff)
 
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 /* Bind socket to a privileged IP port.  */
 extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW;
 
diff --git a/io/fcntl.h b/io/fcntl.h
index 14ccae0..1daa16a 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_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 4f95725..8c9666e 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 f8263d6..ff748c9 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -26,12 +26,11 @@
 
 #include <bits/types.h>		/* For __mode_t and __dev_t.  */
 
-#if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_MISC \
-	 || defined __USE_ATFILE
+#if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_ATFILE
 # if defined __USE_XOPEN || defined __USE_XOPEN2K
 #  define __need_time_t
 # endif
-# if defined __USE_MISC || defined __USE_ATFILE
+# ifdef __USE_ATFILE
 #  define __need_timespec
 # endif
 # include <time.h>		/* For time_t resp. timespec.  */
@@ -104,7 +103,7 @@ __BEGIN_DECLS
 
 #include <bits/stat.h>
 
-#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 # define S_IFMT		__S_IFMT
 # define S_IFDIR	__S_IFDIR
 # define S_IFCHR	__S_IFCHR
@@ -116,7 +115,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_UNIX98) \
      && defined __S_IFSOCK
 #  define S_IFSOCK	__S_IFSOCK
 # endif
@@ -137,11 +136,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_UNIX98 || defined __USE_XOPEN2K) \
     && defined __S_IFSOCK
 # define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
 #elif defined __USE_XOPEN2K
@@ -164,7 +163,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_XOPEN
 /* Save swapped text after use (sticky bit).  This is pretty well obsolete.  */
 # define S_ISVTX	__S_ISVTX
 #endif
@@ -175,7 +174,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
+#ifdef __USE_MISC
 # define S_IREAD	S_IRUSR
 # define S_IWRITE	S_IWUSR
 # define S_IEXEC	S_IXUSR
@@ -194,7 +193,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 +255,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_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 +283,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 +292,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
+#ifdef __USE_POSIX
 extern int fchmod (int __fd, __mode_t __mode) __THROW;
 #endif
 
@@ -332,7 +331,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_XOPEN_EXTENDED
 extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
      __THROW __nonnull ((1));
 
@@ -455,7 +454,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 +477,7 @@ __NTH (fstatat (int __fd, const char *__filename, struct stat *__statbuf,
 }
 # endif
 
-# if defined __USE_MISC || defined __USE_BSD
+# ifdef __USE_MISC
 __extern_inline int
 __NTH (mknod (const char *__path, __mode_t __mode, __dev_t __dev))
 {
@@ -504,7 +503,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 2501eb7..29b2e15 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_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_ISOC99 || defined __USE_UNIX98
 __LDBL_REDIR_DECL (__snprintf_chk)
 __LDBL_REDIR_DECL (__vsnprintf_chk)
 # endif
diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h
index 9deac9f..5c9319e 100644
--- a/libio/bits/stdio.h
+++ b/libio/bits/stdio.h
@@ -57,7 +57,7 @@ fgetc_unlocked (FILE *__fp)
 # endif /* misc */
 
 
-# if defined __USE_POSIX || defined __USE_MISC
+# ifdef __USE_POSIX
 /* This is defined in POSIX.1:1996.  */
 __STDIO_INLINE int
 getc_unlocked (FILE *__fp)
@@ -71,7 +71,7 @@ getchar_unlocked (void)
 {
   return _IO_getc_unlocked (stdin);
 }
-# endif	/* POSIX || misc */
+# endif	/* POSIX */
 
 
 /* Write a character to stdout.  */
@@ -92,7 +92,7 @@ fputc_unlocked (int __c, FILE *__stream)
 # endif /* misc */
 
 
-# if defined __USE_POSIX || defined __USE_MISC
+# ifdef __USE_POSIX
 /* This is defined in POSIX.1:1996.  */
 __STDIO_INLINE int
 putc_unlocked (int __c, FILE *__stream)
@@ -106,7 +106,7 @@ putchar_unlocked (int __c)
 {
   return _IO_putc_unlocked (__c, stdout);
 }
-# endif	/* POSIX || misc */
+# endif	/* POSIX */
 
 
 # ifdef	__USE_GNU
diff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h
index 3e5ce69..712c679 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_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 754301f..b22798c 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_POSIX \
+    || 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_ISOC99 || defined __USE_UNIX98
 __BEGIN_NAMESPACE_C99
 /* Maximum chars of output to write in MAXLEN.  */
 extern int snprintf (char *__restrict __s, size_t __maxlen,
@@ -542,14 +542,14 @@ __END_NAMESPACE_STD
    optimization for it.  */
 #define getc(_fp) _IO_getc (_fp)
 
-#if defined __USE_POSIX || defined __USE_MISC
+#ifdef __USE_POSIX
 /* These are defined in POSIX.1:1996.
 
    These functions are possible cancellation points and therefore not
    marked with __THROW.  */
 extern int getc_unlocked (FILE *__stream);
 extern int getchar_unlocked (void);
-#endif /* Use POSIX or MISC.  */
+#endif /* Use POSIX.  */
 
 #ifdef __USE_MISC
 /* Faster version when locking is not necessary.
@@ -594,17 +594,17 @@ __END_NAMESPACE_STD
 extern int fputc_unlocked (int __c, FILE *__stream);
 #endif /* Use MISC.  */
 
-#if defined __USE_POSIX || defined __USE_MISC
+#ifdef __USE_POSIX
 /* These are defined in POSIX.1:1996.
 
    These functions are possible cancellation points and therefore not
    marked with __THROW.  */
 extern int putc_unlocked (int __c, FILE *__stream);
 extern int putchar_unlocked (int __c);
-#endif /* Use POSIX or MISC.  */
+#endif /* Use POSIX.  */
 
 
-#if defined __USE_SVID || defined __USE_MISC \
+#if defined __USE_MISC \
     || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
 /* Get a word (int) from STREAM.  */
 extern int getw (FILE *__stream);
@@ -864,8 +864,7 @@ extern int fileno_unlocked (FILE *__stream) __THROW __wur;
 #endif
 
 
-#if (defined __USE_POSIX2 || defined __USE_SVID  || defined __USE_BSD || \
-     defined __USE_MISC)
+#ifdef __USE_POSIX2
 /* Create a new stream connected to a pipe running the given command.
 
    This function is a possible cancellation point and therefore not
@@ -906,7 +905,7 @@ extern int obstack_vprintf (struct obstack *__restrict __obstack,
 #endif /* Use GNU.  */
 
 
-#if defined __USE_POSIX || defined __USE_MISC
+#ifdef __USE_POSIX
 /* These are defined in POSIX.1:1996.  */
 
 /* Acquire ownership of STREAM.  */
@@ -918,7 +917,7 @@ extern int ftrylockfile (FILE *__stream) __THROW __wur;
 
 /* Relinquish the ownership granted for STREAM.  */
 extern void funlockfile (FILE *__stream) __THROW;
-#endif /* POSIX || misc */
+#endif /* POSIX */
 
 #if defined __USE_XOPEN && !defined __USE_XOPEN2K && !defined __USE_GNU
 /* The X/Open standard requires some functions and variables to be
diff --git a/manual/creature.texi b/manual/creature.texi
index 1bf5314..e918bd8 100644
--- a/manual/creature.texi
+++ b/manual/creature.texi
@@ -73,38 +73,6 @@ edition is made available.
 @end defvr
 
 @comment (none)
-@comment GNU
-@defvr Macro _BSD_SOURCE
-If you define this macro, functionality derived from 4.3 BSD Unix is
-included as well as the @w{ISO C}, POSIX.1, and POSIX.2 material.
-
-Some of the features derived from 4.3 BSD Unix conflict with the
-corresponding features specified by the POSIX.1 standard.  If this
-macro is defined, the 4.3 BSD definitions take precedence over the
-POSIX definitions.
-
-Due to the nature of some of the conflicts between 4.3 BSD and POSIX.1,
-you need to use a special @dfn{BSD compatibility library} when linking
-programs compiled for BSD compatibility.  This is because some functions
-must be defined in two different ways, one of them in the normal C
-library, and one of them in the compatibility library.  If your program
-defines @code{_BSD_SOURCE}, you must give the option @samp{-lbsd-compat}
-to the compiler or linker when linking the program, to tell it to find
-functions in this special compatibility library before looking for them in
-the normal C library.
-@pindex -lbsd-compat
-@pindex bsd-compat
-@cindex BSD compatibility library.
-@end defvr
-
-@comment (none)
-@comment GNU
-@defvr Macro _SVID_SOURCE
-If you define this macro, functionality derived from SVID is
-included as well as the @w{ISO C}, POSIX.1, POSIX.2, and X/Open material.
-@end defvr
-
-@comment (none)
 @comment X/Open
 @defvr Macro _XOPEN_SOURCE
 @comment (none)
@@ -205,20 +173,6 @@ C99}, POSIX.1, POSIX.2, BSD, SVID, X/Open, LFS, and GNU extensions.  In
 the cases where POSIX.1 conflicts with BSD, the POSIX definitions take
 precedence.
 
-If you want to get the full effect of @code{_GNU_SOURCE} but make the
-BSD definitions take precedence over the POSIX definitions, use this
-sequence of definitions:
-
-@smallexample
-#define _GNU_SOURCE
-#define _BSD_SOURCE
-#define _SVID_SOURCE
-@end smallexample
-
-Note that if you do this, you must link your program with the BSD
-compatibility library by passing the @samp{-lbsd-compat} option to the
-compiler or linker.  @strong{NB:} If you forget to do this, you may
-get very strange errors at run time.
 @end defvr
 
 @comment (none)
@@ -238,21 +192,13 @@ it must have been specified to compile as thread safe.
 
 We recommend you use @code{_GNU_SOURCE} in new programs.  If you don't
 specify the @samp{-ansi} option to GCC and don't define any of these
-macros explicitly, the effect is the same as defining
-@code{_POSIX_C_SOURCE} to 2 and @code{_POSIX_SOURCE},
-@code{_SVID_SOURCE}, and @code{_BSD_SOURCE} to 1.
+macros explicitly, the effect is to enable features from the 2008
+edition of POSIX, as well as certain BSD and SVID features without a
+separate feature test macro to control them.
 
 When you define a feature test macro to request a larger class of features,
 it is harmless to define in addition a feature test macro for a subset of
 those features.  For example, if you define @code{_POSIX_C_SOURCE}, then
 defining @code{_POSIX_SOURCE} as well has no effect.  Likewise, if you
 define @code{_GNU_SOURCE}, then defining either @code{_POSIX_SOURCE} or
-@code{_POSIX_C_SOURCE} or @code{_SVID_SOURCE} as well has no effect.
-
-Note, however, that the features of @code{_BSD_SOURCE} are not a subset of
-any of the other feature test macros supported.  This is because it defines
-BSD features that take precedence over the POSIX features that are
-requested by the other macros.  For this reason, defining
-@code{_BSD_SOURCE} in addition to the other feature test macros does have
-an effect: it causes the BSD features to take priority over the conflicting
-POSIX features.
+@code{_POSIX_C_SOURCE} as well has no effect.
diff --git a/manual/filesys.texi b/manual/filesys.texi
index 1cac453..7ebaeb0 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -812,7 +812,7 @@ seeing this value in a @code{ftw} callback function means the referenced
 file does not exist.  The situation for @code{nftw} is different.
 
 This value is only available if the program is compiled with
-@code{_BSD_SOURCE} or @code{_XOPEN_EXTENDED} defined before including
+@code{_XOPEN_EXTENDED} defined before including
 the first header.  The original SVID systems do not have symbolic links.
 @end vtable
 
@@ -2415,8 +2415,9 @@ the file's modification time onto disk reliably (the idea being that
 no-one cares for a swap file).
 
 This bit is only available on BSD systems (and those derived from
-them).  Therefore one has to use the @code{_BSD_SOURCE} feature select
-macro to get the definition (@pxref{Feature Test Macros}).
+them).  Therefore one has to use the @code{_GNU_SOURCE} feature select
+macro, or not define any feature test macros, to get the definition
+(@pxref{Feature Test Macros}).
 @end table
 
 The actual bit values of the symbols are listed in the table above
diff --git a/manual/job.texi b/manual/job.texi
index 4efeed3..8f6f33b 100644
--- a/manual/job.texi
+++ b/manual/job.texi
@@ -1118,39 +1118,18 @@ from the calling process.
 @end table
 @end deftypefun
 
-The @code{getpgrp} function has two definitions: one derived from BSD
-Unix, and one from the POSIX.1 standard.  The feature test macros you
-have selected (@pxref{Feature Test Macros}) determine which definition
-you get.  Specifically, you get the BSD version if you define
-@code{_BSD_SOURCE}; otherwise, you get the POSIX version if you define
-@code{_POSIX_SOURCE} or @code{_GNU_SOURCE}.  Programs written for old
-BSD systems will not include @file{unistd.h}, which defines
-@code{getpgrp} specially under @code{_BSD_SOURCE}.  You must link such
-programs with the @code{-lbsd-compat} option to get the BSD definition.@refill
-@pindex -lbsd-compat
-@pindex bsd-compat
-@cindex BSD compatibility library
-
 @comment unistd.h
 @comment POSIX.1
-@deftypefn {POSIX.1 Function} pid_t getpgrp (void)
-The POSIX.1 definition of @code{getpgrp} returns the process group ID of
+@deftypefn pid_t getpgrp (void)
+The @code{getpgrp} function returns the process group ID of
 the calling process.
 @end deftypefn
 
 @comment unistd.h
-@comment BSD
-@deftypefn {BSD Function} pid_t getpgrp (pid_t @var{pid})
-The BSD definition of @code{getpgrp} returns the process group ID of the
-process @var{pid}.  You can supply a value of @code{0} for the @var{pid}
-argument to get information about the calling process.
-@end deftypefn
-
-@comment unistd.h
 @comment SVID
 @deftypefn {System V Function} int getpgid (pid_t @var{pid})
 
-@code{getpgid} is the same as the BSD function @code{getpgrp}.  It
+The @code{getpgid} function
 returns the process group ID of the process @var{pid}.  You can supply a
 value of @code{0} for the @var{pid} argument to get information about
 the calling process.
diff --git a/manual/math.texi b/manual/math.texi
index 5e7c90e..35662cd 100644
--- a/manual/math.texi
+++ b/manual/math.texi
@@ -106,7 +106,7 @@ The reciprocal of the square root of two (also the square root of 1/2).
 @end vtable
 
 These constants come from the Unix98 standard and were also available in
-4.4BSD; therefore they are only defined if @code{_BSD_SOURCE} or
+4.4BSD; therefore they are only defined if
 @code{_XOPEN_SOURCE=500}, or a more general feature select macro, is
 defined.  The default set of features includes these constants.
 @xref{Feature Test Macros}.
diff --git a/manual/signal.texi b/manual/signal.texi
index adcda37..facdfb5 100644
--- a/manual/signal.texi
+++ b/manual/signal.texi
@@ -2108,16 +2108,9 @@ that handler will cause @code{EINTR}.  @xref{Flags for Sigaction}.
 Another way to specify the choice is with the @code{siginterrupt}
 function.  @xref{BSD Handler}.
 
-@c !!! not true now about _BSD_SOURCE
 When you don't specify with @code{sigaction} or @code{siginterrupt} what
 a particular handler should do, it uses a default choice.  The default
-choice in @theglibc{} depends on the feature test macros you have
-defined.  If you define @code{_BSD_SOURCE} or @code{_GNU_SOURCE} before
-calling @code{signal}, the default is to resume primitives; otherwise,
-the default is to make them fail with @code{EINTR}.  (The library
-contains alternate versions of the @code{signal} function, and the
-feature test macros determine which one you really call.)  @xref{Feature
-Test Macros}.
+choice in @theglibc{} is to make primitives fail with @code{EINTR}.
 @cindex EINTR, and restarting interrupted primitives
 @cindex restarting interrupted primitives
 @cindex interrupting primitives
diff --git a/manual/startup.texi b/manual/startup.texi
index a277714..f7f5836 100644
--- a/manual/startup.texi
+++ b/manual/startup.texi
@@ -363,9 +363,8 @@ reflect in automatically in the environment.  This also requires that
 variable is removed from the environment.  The same applies of course to
 dynamically allocated variables which are freed later.
 
-This function is part of the extended Unix interface.  Since it was also
-available in old SVID libraries you should define either
-@var{_XOPEN_SOURCE} or @var{_SVID_SOURCE} before including any header.
+This function is part of the extended Unix interface.  You should define
+@var{_XOPEN_SOURCE} before including any header.
 @end deftypefun
 
 
diff --git a/math/bits/math-finite.h b/math/bits/math-finite.h
index 6888462..98a0c17 100644
--- a/math/bits/math-finite.h
+++ b/math/bits/math-finite.h
@@ -31,7 +31,7 @@ extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite);
 # endif
 #endif
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* acosh.  */
 extern double __REDIRECT_NTH (acosh, (double), __acosh_finite);
 extern float __REDIRECT_NTH (acoshf, (float), __acoshf_finite);
@@ -68,7 +68,7 @@ extern long double __REDIRECT_NTH (atan2l, (long double, long double),
 # endif
 #endif
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* atanh.  */
 extern double __REDIRECT_NTH (atanh, (double), __atanh_finite);
 extern float __REDIRECT_NTH (atanhf, (float), __atanhf_finite);
@@ -251,7 +251,7 @@ extern long double __REDIRECT_NTH (lgammal_r, (long double, int *),
 # endif
 #endif
 
-#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+#if defined __USE_XOPEN || defined __USE_ISOC99
 /* lgamma.  */
 __extern_always_inline double __NTH (lgamma (double __d))
 {
diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index 870c54c..9a77125 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -82,7 +82,7 @@ __MATHDECL (void,sincos,,
 	    (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
 #endif
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Hyperbolic arc cosine of X.  */
 __MATHCALL (acosh,, (_Mdouble_ __x));
@@ -122,7 +122,7 @@ __MATHCALL (exp10,, (_Mdouble_ __x));
 __MATHCALL (pow10,, (_Mdouble_ __x));
 #endif
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Return exp(X) - 1.  */
 __MATHCALL (expm1,, (_Mdouble_ __x));
@@ -156,14 +156,14 @@ __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y));
 __MATHCALL (sqrt,, (_Mdouble_ __x));
 _Mdouble_END_NAMESPACE
 
-#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+#if defined __USE_XOPEN || defined __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Return `sqrt(X*X + Y*Y)'.  */
 __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
 __END_NAMESPACE_C99
 #endif
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Return the cube root of X.  */
 __MATHCALL (cbrt,, (_Mdouble_ __x));
@@ -211,7 +211,7 @@ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
 __MATHCALL (significand,, (_Mdouble_ __x));
 #endif /* Use misc.  */
 
-#if defined __USE_MISC || defined __USE_ISOC99
+#ifdef __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Return X with its signed changed to Y's.  */
 __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
@@ -243,7 +243,7 @@ __MATHCALL (yn,, (int, _Mdouble_));
 #endif
 
 
-#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+#if defined __USE_XOPEN || defined __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Error and gamma functions.  */
 __MATHCALL (erf,, (_Mdouble_));
@@ -272,7 +272,7 @@ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
 #endif
 
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Return the integer nearest X in the direction of the
    prevailing rounding mode.  */
@@ -287,7 +287,7 @@ __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 /* Return the remainder of integer divison X / Y with infinite precision.  */
 __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
 
-# if defined __USE_MISC || defined __USE_ISOC99
+# ifdef __USE_ISOC99
 /* Return X times (2 to the Nth power).  */
 __MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
 # endif
@@ -356,7 +356,7 @@ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
 __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
 #endif /* Use ISO C99.  */
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 __END_NAMESPACE_C99
 #endif
 
diff --git a/math/math.h b/math/math.h
index e3adf09..feafa3e 100644
--- a/math/math.h
+++ b/math/math.h
@@ -72,7 +72,7 @@ __BEGIN_DECLS
 #undef _Mdouble_END_NAMESPACE
 #undef	__MATH_PRECNAME
 
-#if defined __USE_MISC || defined __USE_ISOC99
+#ifdef __USE_ISOC99
 
 
 /* Include the file of declarations again, this time using `float'
@@ -137,7 +137,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
 
 # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */
 
-#endif	/* Use misc or ISO C99.  */
+#endif	/* Use ISO C99.  */
 #undef	__MATHDECL_1
 #undef	__MATHDECL
 #undef	__MATHCALL
@@ -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.
 
@@ -352,18 +352,18 @@ extern int matherr (struct exception *__exc);
 /* SVID mode specifies returning this large value instead of infinity.  */
 # define HUGE		3.40282347e+38F
 
-#else	/* !SVID */
+#else	/* !Misc.  */
 
 # ifdef __USE_XOPEN
 /* X/Open wants another strange constant.  */
 #  define MAXFLOAT	3.40282347e+38F
 # endif
 
-#endif	/* SVID */
+#endif	/* Misc.  */
 
 
 /* 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/math/test-matherr.c b/math/test-matherr.c
index 91657a8..cd09a39 100644
--- a/math/test-matherr.c
+++ b/math/test-matherr.c
@@ -1,5 +1,3 @@
-#undef _SVID_SOURCE
-#define _SVID_SOURCE
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/misc/Makefile b/misc/Makefile
index 5df70e6..3b15fb5 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -72,7 +72,7 @@ generated := tst-error1.mtrace tst-error1-mem
 include ../Makeconfig
 
 aux := init-misc
-install-lib := libbsd-compat.a libg.a
+install-lib := libg.a
 gpl2lgpl := error.c error.h
 
 tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
@@ -100,7 +100,6 @@ CFLAGS-tst-tsearch.c = $(stack-align-test-flags)
 
 include ../Rules
 
-$(objpfx)libbsd-compat.a: $(dep-dummy-lib); $(make-dummy-lib)
 $(objpfx)libg.a: $(dep-dummy-lib); $(make-dummy-lib)
 
 ifeq ($(build-shared),yes)
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
index 527cc48..fad3ade 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 5d04a92..95ca2f1 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 e3b3dfd..fc290cb 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 70454a5..8fbe587 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 41331a8..ee01478 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 2481515..adb7fa6 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
@@ -115,7 +115,7 @@ extern ssize_t preadv64 (int __fd, const struct iovec *__iovec, int __count,
 extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count,
 			  __off64_t __offset) __wur;
 # endif
-#endif	/* Use BSD */
+#endif	/* Use misc.  */
 
 __END_DECLS
 
diff --git a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
index 0ad5bae..0f66072 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -131,7 +131,7 @@ __NTH (__signbitl (long double __x))
    suffixed with f and l for the float and long double version, resp).  OP
    is the name of the fpu operation (without leading f).  */
 
-#if defined __USE_MISC || defined __USE_ISOC99
+#if defined __USE_ISOC99
 # define __inline_mathop(func, op)			\
   __inline_mathop1(double, func, op)			\
   __inline_mathop1(float, __CONCAT(func,f), op)	\
@@ -157,7 +157,7 @@ __inline_mathop(__tan, tan)
 __inline_mathop(__tanh, tanh)
 __inline_mathop(__fabs, abs)
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 __inline_mathop(__rint, int)
 __inline_mathop(__expm1, etoxm1)
 __inline_mathop(__log1p, lognp1)
@@ -176,7 +176,7 @@ __inline_mathop(__trunc, intrz)
 __inline_mathop(atan, atan)
 __inline_mathop(tanh, tanh)
 
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+# if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 __inline_mathop(rint, int)
 __inline_mathop(log1p, lognp1)
 # endif
@@ -229,7 +229,7 @@ __m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x))	  	  \
 }
 
 __inline_functions(double,)
-#if defined __USE_MISC || defined __USE_ISOC99
+#if defined __USE_ISOC99
 __inline_functions(float,f)
 __inline_functions(long double,l)
 #endif
@@ -392,7 +392,7 @@ __inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
 		 (__x, __sinx, __cosx))
 # endif
 
-# if defined __USE_MISC || defined __USE_ISOC99
+# ifdef __USE_ISOC99
 
 __inline_forward_c(float,floorf, (float __x), (__x))
 __inline_forward_c(float,ceilf, (float __x), (__x))
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h
index c51b05d..a764d1c 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h
@@ -58,7 +58,7 @@
 
 /* Not used by Linux, but here to make sure we don't clash with
    OSF/1 defines.  */
-#if 0 && defined __USE_BSD
+#if 0 && defined __USE_MISC
 # define MAP_HASSEMAPHORE 0x0200
 # define MAP_INHERIT	  0x0400
 # define MAP_UNALIGNED	  0x0800
@@ -94,7 +94,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.  */
@@ -123,7 +123,7 @@
 
 /* Not used by Linux, but here to make sure we don't clash with
    OSF/1 defines.  */
-#if 0 && defined __USE_BSD
+#if 0 && defined __USE_MISC
 # define MADV_DONTNEED_COMPAT 4	/* Old version?  */
 # define MADV_SPACEAVAIL 5	/* Ensure resources are available.  */
 #endif
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
index 698ac86..88ed5f8 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h
@@ -54,7 +54,7 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK   0x00000001 /* Use signal stack by using `sa_restorer'. */
 #endif
-#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define SA_RESTART   0x00000002 /* Restart syscall on signal return.  */
 # define SA_NODEFER   0x00000008 /* Don't automatically block the signal
 				    when its handler is being executed.  */
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/stat.h
index c34cbca..335fa4a 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/stat.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/stat.h
@@ -43,7 +43,7 @@
 
    Use neat tidy anonymous unions and structures when possible.  */
 
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#ifdef __USE_XOPEN2K8
 # if __GNUC_PREREQ(3,3)
 #  define __ST_TIME(X)				\
 	__extension__ union {			\
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/termios.h
index 88d86af..7e1534f 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/termios.h
+++ b/ports/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/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
index 4474838..e03c201 100644
--- a/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
+++ b/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
@@ -77,7 +77,7 @@
 #define F_SETLK64	13	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#ifdef __USE_XOPEN2K
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
@@ -107,7 +107,7 @@
 #define F_EXLCK		4	/* or 3 */
 #define F_SHLCK		8	/* or 4 */
 
-#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 */
@@ -161,13 +161,13 @@ struct flock64
 
 /* 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
 # define FNONBLOCK	O_NONBLOCK
 # define FNDELAY	O_NDELAY
-#endif /* Use BSD.  */
+#endif /* Use misc.  */
 
 /* Advise to `posix_fadvise'.  */
 #ifdef __USE_XOPEN2K
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
index 2835b0f..467f898 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/ports/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h
index 63fdec9..2ea3a7c 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h
+++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h
@@ -53,7 +53,7 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
 #endif
-#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
 # define SA_NODEFER   0x40000000 /* Don't automatically block the signal
 				    when its handler is being executed.  */
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
index da6e456..fea622d 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h
@@ -62,7 +62,7 @@ struct stat
 #else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
 #endif
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -108,7 +108,7 @@ struct stat64
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/ports/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
index 251c368..850c40d 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
@@ -63,7 +63,7 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
 #endif
-#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
 # define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
 # define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/stat.h b/ports/sysdeps/unix/sysv/linux/mips/bits/stat.h
index becb428..e673d62 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/bits/stat.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -62,7 +62,7 @@ struct stat
     long int st_pad2[3];
     __off64_t st_size;		/* Size of file, in bytes.  */
 #endif
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -106,7 +106,7 @@ struct stat64
     unsigned long int st_rdev;	/* Device number, if device.  */
     long int st_pad2[3];
     __off64_t st_size;		/* Size of file, in bytes.  */
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -153,7 +153,7 @@ struct stat
     unsigned int st_pad2[3];	/* Reserved for st_rdev expansion  */
     __off64_t st_size;
 #endif
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -197,7 +197,7 @@ struct stat64
     __dev_t st_rdev;
     unsigned int st_pad2[3];	/* Reserved for st_rdev expansion  */
     __off64_t st_size;
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/termios.h b/ports/sysdeps/unix/sysv/linux/mips/bits/termios.h
index 1f3c47c..3135e3d 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/bits/termios.h
+++ b/ports/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/posix/bits/unistd.h b/posix/bits/unistd.h
index 349a042..2e601da 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_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 70e7ffa..680bfb4 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
 # 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 74c73bc..8982b63 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 33c2176..23e09be 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_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>
 
@@ -220,7 +220,7 @@ typedef int register_t __attribute__ ((__mode__ (__word__)));
 
 /* BSD defines these symbols, so we follow.  */
 # include <sys/sysmacros.h>
-#endif /* Use BSD.  */
+#endif /* Use misc.  */
 
 
 #if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \
diff --git a/posix/sys/utsname.h b/posix/sys/utsname.h
index a0c917a..9ba03c6 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 3ecc493..33fc125 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.  */
@@ -65,13 +65,13 @@ typedef union
 #   define __WAIT_STATUS_DEFN	int *
 #  endif
 
-# else /* Don't use BSD.  */
+# else /* Don't use misc.  */
 
 #  define __WAIT_INT(status)	(status)
 #  define __WAIT_STATUS		int *
 #  define __WAIT_STATUS_DEFN	int *
 
-# endif /* Use BSD.  */
+# endif /* Use misc.  */
 
 /* This will define all the `__W*' macros.  */
 # include <bits/waitstatus.h>
@@ -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_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_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,11 +174,11 @@ 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;
-#endif /* Use BSD.  */
+#endif /* Use misc.  */
 
 
 __END_DECLS
diff --git a/posix/unistd.h b/posix/unistd.h
index d4eeaf1..823efb1 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -262,14 +262,14 @@ typedef __pid_t pid_t;
 # endif
 #endif	/* X/Open */
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 # ifndef __intptr_t_defined
 typedef __intptr_t intptr_t;
 #  define __intptr_t_defined
 # 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_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;
 
@@ -483,7 +483,7 @@ extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur;
 extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
      __THROW __nonnull ((1)) __wur;
 
-#endif /* Use BSD || X/Open Unix.  */
+#endif /* Use X/Open Unix.  */
 
 #ifdef __USE_ATFILE
 /* Change the owner and group of FILE relative to the directory FD is open
@@ -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_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.  */
@@ -630,17 +630,8 @@ extern __pid_t getpid (void) __THROW;
 /* Get the process ID of the calling process's parent.  */
 extern __pid_t getppid (void) __THROW;
 
-/* Get the process group ID of the calling process.
-   This function is different on old BSD. */
-#ifndef __FAVOR_BSD
+/* Get the process group ID of the calling process.  */
 extern __pid_t getpgrp (void) __THROW;
-#else
-# ifdef __REDIRECT_NTH
-extern __pid_t __REDIRECT_NTH (getpgrp, (__pid_t __pid), __getpgid);
-# else
-#  define getpgrp __getpgid
-# endif
-#endif
 
 /* Get the process group ID of process PID.  */
 extern __pid_t __getpgid (__pid_t __pid) __THROW;
@@ -654,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_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
@@ -662,26 +653,13 @@ extern int setpgid (__pid_t __pid, __pid_t __pgid) __THROW;
 
    New programs should always use `setpgid' instead.
 
-   The default in GNU is to provide the System V function.  The BSD
-   function is available under -D_BSD_SOURCE.  */
-
-# ifndef __FAVOR_BSD
+   GNU provides the System V function.  */
 
 /* Set the process group ID of the calling process to its own PID.
    This is exactly the same as `setpgid (0, 0)'.  */
 extern int setpgrp (void) __THROW;
 
-# else
-
-/* Another name for `setpgid' (above).  */
-#  ifdef __REDIRECT_NTH
-extern int __REDIRECT_NTH (setpgrp, (__pid_t __pid, __pid_t __pgrp), setpgid);
-#  else
-#   define setpgrp setpgid
-#  endif
-
-# endif	/* Favor BSD.  */
-#endif	/* Use SVID or BSD.  */
+#endif	/* Use misc or X/Open.  */
 
 /* Create a new session with the calling process as its leader.
    The process group IDs of the session and the calling process
@@ -721,16 +699,16 @@ 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
+#ifdef __USE_XOPEN2K
 /* Set the effective user ID of the calling process to UID.  */
 extern int seteuid (__uid_t __uid) __THROW __wur;
-#endif /* Use BSD.  */
+#endif /* Use POSIX.1-2001.  */
 
 /* Set the group ID of the calling process to GID.
    If the calling process is the super-user, set the real
@@ -738,16 +716,16 @@ 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
+#ifdef __USE_XOPEN2K
 /* Set the effective group ID of the calling process to GID.  */
 extern int setegid (__gid_t __gid) __THROW __wur;
-#endif /* Use BSD.  */
+#endif /* Use POSIX.1-2001.  */
 
 #ifdef __USE_GNU
 /* Fetch the real user ID, effective user ID, and saved-set user ID,
@@ -778,13 +756,13 @@ 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,
    and the process ID of the new process to the old process.  */
 extern __pid_t vfork (void) __THROW;
-#endif /* Use BSD or XPG < 7. */
+#endif /* Use misc or XPG < 7. */
 
 
 /* Return the pathname of the terminal FD is open on, or NULL on errors.
@@ -800,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.  */
@@ -820,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_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;
@@ -831,7 +809,7 @@ extern int symlink (const char *__from, const char *__to)
 extern ssize_t readlink (const char *__restrict __path,
 			 char *__restrict __buf, size_t __len)
      __THROW __nonnull ((1, 2)) __wur;
-#endif /* Use BSD.  */
+#endif /* Use POSIX.1-2001.  */
 
 #ifdef __USE_ATFILE
 /* Like symlink but a relative path in TO is interpreted relative to TOFD.  */
@@ -879,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
@@ -894,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_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.  */
@@ -902,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)
@@ -957,10 +935,10 @@ extern void setusershell (void) __THROW; /* Rewind and re-read the file.  */
    terminal.  If NOCHDIR is zero, do `chdir ("/")'.  If NOCLOSE is zero,
    redirects stdin, stdout, and stderr to /dev/null.  */
 extern int daemon (int __nochdir, int __noclose) __THROW __wur;
-#endif /* Use BSD || X/Open.  */
+#endif /* Use misc || 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;
@@ -968,7 +946,7 @@ extern int chroot (const char *__path) __THROW __nonnull ((1)) __wur;
 /* Prompt with PROMPT and read a string from the terminal without echoing.
    Uses /dev/tty if possible; otherwise stderr and stdin.  */
 extern char *getpass (const char *__prompt) __nonnull ((1));
-#endif /* Use BSD || X/Open.  */
+#endif /* Use misc || X/Open.  */
 
 
 /* Make all changes done to FD actually appear on disk.
@@ -985,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);
@@ -994,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__));
@@ -1005,10 +983,10 @@ extern int getpagesize (void)  __THROW __attribute__ ((__const__));
 extern int getdtablesize (void) __THROW;
 # endif
 
-#endif /* Use BSD || X/Open Unix.  */
+#endif /* Use misc || X/Open Unix.  */
 
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 
 /* Truncate FILE to LENGTH bytes.  */
 # ifndef __USE_FILE_OFFSET64
@@ -1028,9 +1006,9 @@ extern int truncate64 (const char *__file, __off64_t __length)
      __THROW __nonnull ((1)) __wur;
 # endif
 
-#endif /* Use BSD || X/Open Unix || POSIX 2008.  */
+#endif /* Use X/Open Unix || POSIX 2008.  */
 
-#if defined __USE_BSD || defined __USE_POSIX199309 \
+#if defined __USE_POSIX199309 \
     || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 
 /* Truncate the file FD is open on to LENGTH bytes.  */
@@ -1048,7 +1026,7 @@ extern int __REDIRECT_NTH (ftruncate, (int __fd, __off64_t __length),
 extern int ftruncate64 (int __fd, __off64_t __length) __THROW __wur;
 # endif
 
-#endif /* Use BSD || POSIX.1b || X/Open Unix || XPG6.  */
+#endif /* Use POSIX.1b || X/Open Unix || XPG6.  */
 
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
diff --git a/pwd/pwd.h b/pwd/pwd.h
index 290726f..0ea66fc 100644
--- a/pwd/pwd.h
+++ b/pwd/pwd.h
@@ -58,13 +58,13 @@ struct passwd
 };
 
 
-#if defined __USE_SVID || defined __USE_GNU
+#ifdef __USE_MISC
 # define __need_FILE
 # include <stdio.h>
 #endif
 
 
-#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+#if 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
@@ -115,7 +115,7 @@ extern struct passwd *getpwuid (__uid_t __uid);
    marked with __THROW.  */
 extern struct passwd *getpwnam (const char *__name);
 
-#if defined __USE_POSIX || defined __USE_MISC
+#ifdef __USE_POSIX
 
 # ifdef __USE_MISC
 /* Reasonable value for the buffer sized used in the reentrant
@@ -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
+# ifdef __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 56729d1..41fe7ba 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -70,7 +70,7 @@ extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
 # define NO_DATA	4	/* Valid name, no data record of requested
 				   type.  */
 #endif
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 # define NETDB_INTERNAL	-1	/* See errno.  */
 # define NETDB_SUCCESS	0	/* No problem.  */
 # define NO_ADDRESS	NO_DATA	/* No address, look for MX record.  */
@@ -104,7 +104,7 @@ struct hostent
   int h_addrtype;		/* Host address type.  */
   int h_length;			/* Length of address.  */
   char **h_addr_list;		/* List of addresses from name server.  */
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 # define	h_addr	h_addr_list[0] /* Address, for backward compatibility.*/
 #endif
 };
@@ -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 67de76c..3be4a96 100644
--- a/setjmp/setjmp.h
+++ b/setjmp/setjmp.h
@@ -58,7 +58,6 @@ __END_NAMESPACE_STD
    This is the internal name for `sigsetjmp'.  */
 extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;
 
-#ifndef	__FAVOR_BSD
 /* Store the calling environment in ENV, not saving the signal mask.
    Return 0.  */
 extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROWNL;
@@ -66,12 +65,6 @@ extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROWNL;
 /* Do not save the signal mask.  This is equivalent to the `_setjmp'
    BSD function.  */
 # define setjmp(env)	_setjmp (env)
-#else
-/* We are in 4.3 BSD-compatibility mode in which `setjmp'
-   saves the signal mask like `sigsetjmp (ENV, 1)'.  We have to
-   define a macro since ISO C says `setjmp' is one.  */
-# define setjmp(env)	setjmp (env)
-#endif /* Favor BSD.  */
 
 
 __BEGIN_NAMESPACE_STD
@@ -83,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 ec28b31..9a24968 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,29 +127,29 @@ 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.  */
 extern int killpg (__pid_t __pgrp, int __sig) __THROW;
-#endif /* Use BSD || X/Open Unix.  */
+#endif /* Use misc || X/Open Unix.  */
 
 __BEGIN_NAMESPACE_STD
 /* Raise signal SIG, i.e., send SIG to yourself.  */
 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;
 extern int gsignal (int __sig) __THROW;
-#endif /* Use SVID.  */
+#endif /* Use misc.  */
 
-#if defined __USE_MISC || defined __USE_XOPEN2K
+#ifdef __USE_XOPEN2K
 /* Print a message describing the meaning of the given signal number.  */
 extern void psignal (int __sig, const char *__s);
-#endif /* Use misc or POSIX 2008.  */
+#endif /* Use POSIX 2008.  */
 
 #ifdef __USE_XOPEN2K
 /* Print a message describing the meaning of the given signal information.  */
@@ -158,33 +158,25 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
 
 
 
-/* The `sigpause' function has two different interfaces.  The original
-   BSD definition defines the argument as a mask of the signal, while
-   the more modern interface in X/Open defines it as the signal
-   number.  We go with the BSD version unless the user explicitly
-   selects the X/Open version.
+/* The `sigpause' function in X/Open defines the argument as the
+   signal number.  This requires redirecting to another function
+   because the default version in glibc uses an old BSD interface.
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
 extern int __sigpause (int __sig_or_mask, int __is_sig);
 
-#ifdef __FAVOR_BSD
-/* Set the mask of blocked signals to MASK,
-   wait for a signal to arrive, and then restore the mask.  */
-extern int sigpause (int __mask) __THROW __attribute_deprecated__;
-#else
-# ifdef __USE_XOPEN
-#  ifdef __GNUC__
+#ifdef __USE_XOPEN
+# ifdef __GNUC__
 extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
-#  else
+# else
 /* Remove a signal from the signal mask and suspend the process.  */
-#   define sigpause(sig) __sigpause ((sig), 1)
-#  endif
+#  define sigpause(sig) __sigpause ((sig), 1)
 # endif
 #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
@@ -201,7 +193,7 @@ extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
 
 /* Return currently selected signal mask.  */
 extern int siggetmask (void) __THROW __attribute_deprecated__;
-#endif /* Use BSD.  */
+#endif /* Use misc.  */
 
 
 #ifdef __USE_MISC
@@ -213,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
 
@@ -304,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>).  */
@@ -342,10 +334,10 @@ extern int sigvec (int __sig, const struct sigvec *__vec,
 /* Restore the state saved in SCP.  */
 extern int sigreturn (struct sigcontext *__scp) __THROW;
 
-#endif /*  use BSD.  */
+#endif /* Use misc.  */
 
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 # define __need_size_t
 # include <stddef.h>
 
@@ -371,7 +363,7 @@ extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
 extern int sigaltstack (const struct sigaltstack *__restrict __ss,
 			struct sigaltstack *__restrict __oss) __THROW;
 
-#endif /* use BSD or X/Open Unix.  */
+#endif /* Use POSIX.1-2008 or X/Open Unix.  */
 
 #ifdef __USE_XOPEN_EXTENDED
 /* Simplified interface for signal management.  */
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index 8aa0bab..2d1c22c 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 73bbb12..710d209 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 813da19..455a133 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.  */
@@ -72,13 +72,13 @@ typedef union
 #   define __WAIT_STATUS_DEFN	int *
 #  endif
 
-# else /* Don't use BSD.  */
+# else /* Don't use misc.  */
 
 #  define __WAIT_INT(status)	(status)
 #  define __WAIT_STATUS		int *
 #  define __WAIT_STATUS_DEFN	int *
 
-# endif /* Use BSD.  */
+# endif /* Use misc.  */
 
 /* Define the macros <sys/wait.h> also would define this way.  */
 # define WEXITSTATUS(status)	__WEXITSTATUS (__WAIT_INT (status))
@@ -151,7 +151,7 @@ extern long int atol (const char *__nptr)
      __THROW __attribute_pure__ __nonnull ((1)) __wur;
 __END_NAMESPACE_STD
 
-#if defined __USE_ISOC99 || defined __USE_MISC
+#ifdef __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Convert a string to a long long integer.  */
 __extension__ extern long long int atoll (const char *__nptr)
@@ -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,
@@ -200,9 +200,9 @@ __extension__
 extern unsigned long long int strtouq (const char *__restrict __nptr,
 				       char **__restrict __endptr, int __base)
      __THROW __nonnull ((1));
-#endif /* Use BSD.  */
+#endif /* Use misc.  */
 
-#if defined __USE_ISOC99 || defined __USE_MISC
+#ifdef __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Convert a string to a quadword integer.  */
 __extension__
@@ -286,7 +286,7 @@ __NTH (atol (const char *__nptr))
 }
 __END_NAMESPACE_STD
 
-# if defined __USE_MISC || defined __USE_ISOC99
+# if defined __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 __extension__ __extern_inline long long int
 __NTH (atoll (const char *__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.  */
@@ -308,9 +308,9 @@ extern char *l64a (long int __n) __THROW __wur;
 extern long int a64l (const char *__s)
      __THROW __attribute_pure__ __nonnull ((1)) __wur;
 
-#endif	/* Use SVID || extended X/Open.  */
+#endif	/* Use misc || extended X/Open.  */
 
-#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 # include <sys/types.h>	/* we need int32_t... */
 
 /* These are the functions that actually do things.  The `random', `srandom',
@@ -366,7 +366,7 @@ extern int setstate_r (char *__restrict __statebuf,
 		       struct random_data *__restrict __buf)
      __THROW __nonnull ((1, 2));
 # endif	/* Use misc.  */
-#endif	/* Use SVID || extended X/Open || BSD. */
+#endif	/* Use extended X/Open || misc. */
 
 
 __BEGIN_NAMESPACE_STD
@@ -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).  */
@@ -455,7 +455,7 @@ extern int lcong48_r (unsigned short int __param[7],
 		      struct drand48_data *__buffer)
      __THROW __nonnull ((1, 2));
 # endif	/* Use misc.  */
-#endif	/* Use SVID or X/Open.  */
+#endif	/* Use misc or X/Open.  */
 
 #endif /* don't just need malloc and calloc */
 
@@ -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
+#ifdef __USE_MISC
 # include <alloca.h>
-#endif /* Use GNU, BSD, or misc.  */
+#endif /* Use 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
+#ifdef __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)
@@ -606,8 +606,7 @@ extern int clearenv (void) __THROW;
 extern char *mktemp (char *__template) __THROW __nonnull ((1));
 #endif
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED \
-    || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the filename unique.
@@ -654,7 +653,7 @@ extern int mkstemps64 (char *__template, int __suffixlen)
 # endif
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K8
+#ifdef __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 +724,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 +801,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 +879,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 +943,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 9369a7c..f3325ad 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -1167,7 +1167,7 @@ __strtok_r_1c (char *__s, char __sep, char **__nextp)
   *__nextp = __s;
   return __result;
 }
-# if defined __USE_POSIX || defined __USE_MISC
+# ifdef __USE_POSIX
 #  define strtok_r(s, sep, nextp) __strtok_r (s, sep, nextp)
 # endif
 #endif
@@ -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_XOPEN_EXTENDED
 #   define strdup(s) __strdup (s)
 #  endif
 # endif
diff --git a/string/bits/string3.h b/string/bits/string3.h
index 233aa9e..ad232eb 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 f414cb1..1d2d8d7 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 ecc3fef..40a751f 100644
--- a/string/string.h
+++ b/string/string.h
@@ -50,11 +50,11 @@ __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_XOPEN
 extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
 		      int __c, size_t __n)
      __THROW __nonnull ((1, 2));
-#endif /* SVID.  */
+#endif /* Misc || X/Open.  */
 
 
 __BEGIN_NAMESPACE_STD
@@ -166,8 +166,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 \
-    || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* Duplicate S, returning an identical malloc'd string.  */
 extern char *strdup (const char *__s)
      __THROW __attribute_malloc__ __nonnull ((1));
@@ -351,7 +350,7 @@ extern char *__strtok_r (char *__restrict __s,
 			 const char *__restrict __delim,
 			 char **__restrict __save_ptr)
      __THROW __nonnull ((2, 3));
-#if defined __USE_POSIX || defined __USE_MISC
+#ifdef __USE_POSIX
 extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
 		       char **__restrict __save_ptr)
      __THROW __nonnull ((2, 3));
@@ -408,7 +407,7 @@ __BEGIN_NAMESPACE_STD
 /* Return a string describing the meaning of the `errno' code in ERRNUM.  */
 extern char *strerror (int __errnum) __THROW;
 __END_NAMESPACE_STD
-#if defined __USE_XOPEN2K || defined __USE_MISC
+#ifdef __USE_XOPEN2K
 /* Reentrant version of `strerror'.
    There are 2 flavors of `strerror_r', GNU which returns the string
    and may or may not use the supplied temporary buffer and POSIX one
@@ -446,7 +445,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));
@@ -533,7 +532,7 @@ extern int strcasecmp (const char *__s1, const char *__s2)
 /* Compare no more than N chars of S1 and S2, ignoring case.  */
 extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
-#endif /* Use BSD.  */
+#endif /* Use misc.  */
 
 #ifdef	__USE_GNU
 /* Again versions of a few functions which use the given locale instead
@@ -547,7 +546,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 dad0a04..fa4ad46 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 9e14a2d..9991d5e 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 d23318c..3ef3c8b 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/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h
index b7bf9b3..e82449e 100644
--- a/sysdeps/gnu/netinet/tcp.h
+++ b/sysdeps/gnu/netinet/tcp.h
@@ -66,7 +66,6 @@
 # include <sys/types.h>
 # include <sys/socket.h>
 
-# ifdef __FAVOR_BSD
 typedef	u_int32_t tcp_seq;
 /*
  * TCP header.
@@ -74,65 +73,68 @@ typedef	u_int32_t tcp_seq;
  */
 struct tcphdr
   {
-    u_int16_t th_sport;		/* source port */
-    u_int16_t th_dport;		/* destination port */
-    tcp_seq th_seq;		/* sequence number */
-    tcp_seq th_ack;		/* acknowledgement number */
+    union
+    {
+      struct
+      {
+	u_int16_t th_sport;		/* source port */
+	u_int16_t th_dport;		/* destination port */
+	tcp_seq th_seq;		/* sequence number */
+	tcp_seq th_ack;		/* acknowledgement number */
 #  if __BYTE_ORDER == __LITTLE_ENDIAN
-    u_int8_t th_x2:4;		/* (unused) */
-    u_int8_t th_off:4;		/* data offset */
+	u_int8_t th_x2:4;		/* (unused) */
+	u_int8_t th_off:4;		/* data offset */
 #  endif
 #  if __BYTE_ORDER == __BIG_ENDIAN
-    u_int8_t th_off:4;		/* data offset */
-    u_int8_t th_x2:4;		/* (unused) */
+	u_int8_t th_off:4;		/* data offset */
+	u_int8_t th_x2:4;		/* (unused) */
 #  endif
-    u_int8_t th_flags;
+	u_int8_t th_flags;
 #  define TH_FIN	0x01
 #  define TH_SYN	0x02
 #  define TH_RST	0x04
 #  define TH_PUSH	0x08
 #  define TH_ACK	0x10
 #  define TH_URG	0x20
-    u_int16_t th_win;		/* window */
-    u_int16_t th_sum;		/* checksum */
-    u_int16_t th_urp;		/* urgent pointer */
-};
-
-# else /* !__FAVOR_BSD */
-struct tcphdr
-  {
-    u_int16_t source;
-    u_int16_t dest;
-    u_int32_t seq;
-    u_int32_t ack_seq;
+	u_int16_t th_win;		/* window */
+	u_int16_t th_sum;		/* checksum */
+	u_int16_t th_urp;		/* urgent pointer */
+      };
+      struct
+      {
+	u_int16_t source;
+	u_int16_t dest;
+	u_int32_t seq;
+	u_int32_t ack_seq;
 #  if __BYTE_ORDER == __LITTLE_ENDIAN
-    u_int16_t res1:4;
-    u_int16_t doff:4;
-    u_int16_t fin:1;
-    u_int16_t syn:1;
-    u_int16_t rst:1;
-    u_int16_t psh:1;
-    u_int16_t ack:1;
-    u_int16_t urg:1;
-    u_int16_t res2:2;
+	u_int16_t res1:4;
+	u_int16_t doff:4;
+	u_int16_t fin:1;
+	u_int16_t syn:1;
+	u_int16_t rst:1;
+	u_int16_t psh:1;
+	u_int16_t ack:1;
+	u_int16_t urg:1;
+	u_int16_t res2:2;
 #  elif __BYTE_ORDER == __BIG_ENDIAN
-    u_int16_t doff:4;
-    u_int16_t res1:4;
-    u_int16_t res2:2;
-    u_int16_t urg:1;
-    u_int16_t ack:1;
-    u_int16_t psh:1;
-    u_int16_t rst:1;
-    u_int16_t syn:1;
-    u_int16_t fin:1;
+	u_int16_t doff:4;
+	u_int16_t res1:4;
+	u_int16_t res2:2;
+	u_int16_t urg:1;
+	u_int16_t ack:1;
+	u_int16_t psh:1;
+	u_int16_t rst:1;
+	u_int16_t syn:1;
+	u_int16_t fin:1;
 #  else
 #   error "Adjust your <bits/endian.h> defines"
 #  endif
-    u_int16_t window;
-    u_int16_t check;
-    u_int16_t urg_ptr;
+	u_int16_t window;
+	u_int16_t check;
+	u_int16_t urg_ptr;
+      };
+    };
 };
-# endif /* __FAVOR_BSD */
 
 enum
 {
diff --git a/sysdeps/gnu/netinet/udp.h b/sysdeps/gnu/netinet/udp.h
index 3beb371..efb1543 100644
--- a/sysdeps/gnu/netinet/udp.h
+++ b/sysdeps/gnu/netinet/udp.h
@@ -52,27 +52,28 @@
 
 
 /* UDP header as specified by RFC 768, August 1980. */
-#ifdef __FAVOR_BSD
 
 struct udphdr
 {
-  u_int16_t uh_sport;		/* source port */
-  u_int16_t uh_dport;		/* destination port */
-  u_int16_t uh_ulen;		/* udp length */
-  u_int16_t uh_sum;		/* udp checksum */
+  union
+  {
+    struct
+    {
+      u_int16_t uh_sport;		/* source port */
+      u_int16_t uh_dport;		/* destination port */
+      u_int16_t uh_ulen;		/* udp length */
+      u_int16_t uh_sum;		/* udp checksum */
+    };
+    struct
+    {
+      u_int16_t source;
+      u_int16_t dest;
+      u_int16_t len;
+      u_int16_t check;
+    };
+  };
 };
 
-#else
-
-struct udphdr
-{
-  u_int16_t source;
-  u_int16_t dest;
-  u_int16_t len;
-  u_int16_t check;
-};
-#endif
-
 /* UDP socket options */
 #define UDP_CORK	1	/* Never send partially complete segments.  */
 #define UDP_ENCAP	100	/* Set the socket to accept
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h
index 9d598a1..1b2346e 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_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 be9defd..e2b9c28 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -57,7 +57,7 @@ struct stat
     __off64_t st_size;		/* Size in bytes.  */
 #endif
 
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -121,7 +121,7 @@ struct stat64
 
     __off64_t st_size;		/* Size in bytes.  */
 
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -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/bsd/bsd4.4/bits/errno.h b/sysdeps/unix/bsd/bsd4.4/bits/errno.h
index 48b1c8b..d0e9b73 100644
--- a/sysdeps/unix/bsd/bsd4.4/bits/errno.h
+++ b/sysdeps/unix/bsd/bsd4.4/bits/errno.h
@@ -51,7 +51,7 @@
 #define	ENOMEM		12		/* Cannot allocate memory */
 #define	EACCES		13		/* Permission denied */
 #define	EFAULT		14		/* Bad address */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 #define	ENOTBLK		15		/* Block device required */
 #endif
 #define	EBUSY		16		/* Device busy */
@@ -64,7 +64,7 @@
 #define	ENFILE		23		/* Too many open files in system */
 #define	EMFILE		24		/* Too many open files */
 #define	ENOTTY		25		/* Inappropriate ioctl for device */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 #define	ETXTBSY		26		/* Text file busy */
 #endif
 #define	EFBIG		27		/* File too large */
@@ -89,7 +89,7 @@
 
 /* non-blocking and interrupt i/o */
 #define	EAGAIN		35		/* Resource temporarily unavailable */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 #define	EWOULDBLOCK	EAGAIN		/* Operation would block */
 #define	EINPROGRESS	36		/* Operation now in progress */
 #define	EALREADY	37		/* Operation already in progress */
@@ -123,18 +123,18 @@
 #define	ECONNREFUSED	61		/* Connection refused */
 
 #define	ELOOP		62		/* Too many levels of symbolic links */
-#endif /* __USE_BSD */
+#endif /* __USE_MISC */
 #define	ENAMETOOLONG	63		/* File name too long */
 
 /* should be rearranged */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 #define	EHOSTDOWN	64		/* Host is down */
 #define	EHOSTUNREACH	65		/* No route to host */
-#endif /* __USE_BSD */
+#endif /* __USE_MISC */
 #define	ENOTEMPTY	66		/* Directory not empty */
 
 /* quotas & mush */
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 #define	EPROCLIM	67		/* Too many processes */
 #define	EUSERS		68		/* Too many users */
 #define	EDQUOT		69		/* Disc quota exceeded */
@@ -147,18 +147,18 @@
 #define	EPROGUNAVAIL	74		/* RPC prog. not avail */
 #define	EPROGMISMATCH	75		/* Program version wrong */
 #define	EPROCUNAVAIL	76		/* Bad procedure for program */
-#endif /* __USE_BSD */
+#endif /* __USE_MISC */
 
 #define	ENOLCK		77		/* No locks available */
 #define	ENOSYS		78		/* Function not implemented */
 
 #define	EFTYPE		79		/* Inappropriate file type or format */
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 #define	EAUTH		80		/* Authentication error */
 #define	ENEEDAUTH	81		/* Need authenticator */
 #define	ELAST		81		/* Must be equal largest errno */
-#endif /* __USE_BSD */
+#endif /* __USE_MISC */
 
 
 #endif /* <errno.h> included.  */
diff --git a/sysdeps/unix/bsd/bsdstat.h b/sysdeps/unix/bsd/bsdstat.h
index 3c9f837..9de3704 100644
--- a/sysdeps/unix/bsd/bsdstat.h
+++ b/sysdeps/unix/bsd/bsdstat.h
@@ -20,7 +20,6 @@
 #include <sys/types.h>
 
 /* This will make it not define major, minor, makedev, and S_IF*.  */
-#undef	__USE_BSD
 #undef	__USE_MISC
 #include <sys/stat.h>
 
diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 9b0421e..fae1c0c 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_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,13 +256,13 @@ 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
 # define FNONBLOCK	O_NONBLOCK
 # define FNDELAY	O_NDELAY
-#endif /* Use BSD.  */
+#endif /* Use misc.  */
 
 #ifndef __POSIX_FADV_DONTNEED
 #  define __POSIX_FADV_DONTNEED	4
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
index d763ce9..422caab 100644
--- a/sysdeps/unix/sysv/linux/bits/in.h
+++ b/sysdeps/unix/sysv/linux/bits/in.h
@@ -54,7 +54,7 @@
 #define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */
 #define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */
 #define IP_MSFILTER 41
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 # define MCAST_JOIN_GROUP 42	/* group_req: join any-source group */
 # define MCAST_BLOCK_SOURCE 43	/* group_source_req: block from given group */
 # define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/
@@ -105,7 +105,7 @@
 #define IP_DEFAULT_MULTICAST_LOOP       1
 #define IP_MAX_MEMBERSHIPS              20
 
-#if defined __USE_MISC || defined __USE_GNU
+#ifdef __USE_MISC
 /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
    The `ip_dst' field is used for the first-hop gateway when using a
    source route (this gets put into the header proper).  */
diff --git a/sysdeps/unix/sysv/linux/bits/mman-linux.h b/sysdeps/unix/sysv/linux/bits/mman-linux.h
index 05d2d92..9e127a9 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/sigaction.h b/sysdeps/unix/sysv/linux/bits/sigaction.h
index 47a7dc1..80dd4ac 100644
--- a/sysdeps/unix/sysv/linux/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/bits/sigaction.h
@@ -57,7 +57,7 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
 #endif
-#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
 # define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
 				    its handler is being executed.  */
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 9312849..79515af 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -317,7 +317,7 @@ struct ucred
 #endif
 
 /* Ugly workaround for unclean kernel headers.  */
-#if !defined __USE_MISC && !defined __USE_GNU
+#if !defined __USE_MISC
 # ifndef FIOGETOWN
 #  define __SYS_SOCKET_H_undef_FIOGETOWN
 # endif
@@ -344,7 +344,7 @@ struct ucred
 /* Get socket manipulation related informations from kernel headers.  */
 #include <asm/socket.h>
 
-#if !defined __USE_MISC && !defined __USE_GNU
+#if !defined __USE_MISC
 # ifdef __SYS_SOCKET_H_undef_FIOGETOWN
 #  undef __SYS_SOCKET_H_undef_FIOGETOWN
 #  undef FIOGETOWN
diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h
index 65e2a5a..f8bb299 100644
--- a/sysdeps/unix/sysv/linux/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/bits/stat.h
@@ -62,7 +62,7 @@ struct stat
 #else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
 #endif
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -108,7 +108,7 @@ struct stat64
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
diff --git a/sysdeps/unix/sysv/linux/bits/sys_errlist.h b/sysdeps/unix/sysv/linux/bits/sys_errlist.h
index f0c2242..7829738 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 171bae0..65378ff 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/netinet/if_ether.h b/sysdeps/unix/sysv/linux/netinet/if_ether.h
index 2c5e5f0..6d816db 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 fed06e5..0644a37 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 b1f8a60..b762d65 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/stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
index 252aae9..86551ee 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
@@ -70,7 +70,7 @@ struct stat
 # else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
 # endif
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -110,7 +110,7 @@ struct stat64
     __off64_t st_size;			/* Size of file, in bytes.  */
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#  if defined __USE_MISC || defined __USE_XOPEN2K8
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -164,7 +164,7 @@ struct stat
 # else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
 # endif
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -204,7 +204,7 @@ struct stat64
     __off64_t st_size;			/* Size of file, in bytes.  */
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#  if defined __USE_MISC || defined __USE_XOPEN2K8
+#  ifdef __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
index 4d94a8d..f532e89 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/s390/bits/sigaction.h b/sysdeps/unix/sysv/linux/s390/bits/sigaction.h
index a6f1cd8..55ca76d 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/sigaction.h
@@ -90,7 +90,7 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
 #endif
-#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
 # define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
 				    its handler is being executed.	 */
diff --git a/sysdeps/unix/sysv/linux/s390/bits/stat.h b/sysdeps/unix/sysv/linux/s390/bits/stat.h
index 51be598..1c92637 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/stat.h
@@ -58,7 +58,7 @@ struct stat
     int pad0;
     __dev_t st_rdev;		/* Device number, if device.  */
     __off_t st_size;		/* Size of file, in bytes.  */
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -111,7 +111,7 @@ struct stat
 # else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
 # endif
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -155,7 +155,7 @@ struct stat64
     int pad0;
     __dev_t st_rdev;		/* Device number, if device.  */
     __off_t st_size;		/* Size of file, in bytes.  */
-#  if defined __USE_MISC || defined __USE_XOPEN2K8
+#  if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -197,7 +197,7 @@ struct stat64
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#  if defined __USE_MISC || defined __USE_XOPEN2K8
+#  if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
index 1e3521d..e8bea7c 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
@@ -58,7 +58,7 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK   0x00000001 /* Use signal stack by using `sa_restorer'. */
 #endif
-#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define SA_RESTART   0x00000002 /* Restart syscall on signal return.  */
 # define SA_INTERRUPT 0x00000010 /* Historical no-op.  */
 # define SA_NOMASK    0x00000020 /* Don't automatically block the signal when
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/stat.h b/sysdeps/unix/sysv/linux/sparc/bits/stat.h
index b87fd58..3e5da8c 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/stat.h
@@ -62,7 +62,7 @@ struct stat
 #else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
 #endif
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -105,7 +105,7 @@ struct stat64
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h
index 32ae4ed..f5656f5 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/unix/sysv/linux/x86/bits/stat.h b/sysdeps/unix/sysv/linux/x86/bits/stat.h
index efda673..6e3b1f1 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/stat.h
@@ -81,7 +81,7 @@ struct stat
 #else
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
 #endif
-#if defined __USE_MISC || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
@@ -142,7 +142,7 @@ struct stat64
 # endif
     __blksize_t st_blksize;	/* Optimal block size for I/O.  */
     __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
-# if defined __USE_MISC || defined __USE_XOPEN2K8
+# if defined __USE_XOPEN2K8
     /* Nanosecond resolution timestamps are stored in a format
        equivalent to 'struct timespec'.  This is the type used
        whenever possible but the Unix namespace rules do not allow the
diff --git a/sysdeps/x86/bits/string.h b/sysdeps/x86/bits/string.h
index 24b64ec..4e2bd28 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)			      \
@@ -1974,7 +1974,7 @@ __strstr_g (const char *__haystack, const char *__needle)
 #    define ffsl(word) ffs(word)
 #   endif
 #  endif /* i686 */
-# endif	/* BSD || X/Open */
+# endif	/* Misc || X/Open */
 
 # ifndef _FORCE_INLINES
 #  undef __STRING_INLINE
diff --git a/sysdeps/x86/fpu/bits/mathinline.h b/sysdeps/x86/fpu/bits/mathinline.h
index fed6414..cd96269 100644
--- a/sysdeps/x86/fpu/bits/mathinline.h
+++ b/sysdeps/x86/fpu/bits/mathinline.h
@@ -283,7 +283,7 @@ __END_NAMESPACE_C99
 #  endif
 
 #  if defined __SSE4_1__ && defined __SSE2_MATH__
-#   if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+#   if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 
 /* Round to nearest integer.  */
@@ -399,7 +399,7 @@ __END_NAMESPACE_C99
    We define two sets of macros.  The set with the additional NP
    doesn't add a prototype declaration.  */
 
-#  if defined __USE_MISC || defined __USE_ISOC99
+#  ifdef __USE_ISOC99
 #   define __inline_mathop(func, op) \
   __inline_mathop_ (double, func, op)					      \
   __inline_mathop_ (float, __CONCAT(func,f), op)			      \
@@ -421,7 +421,7 @@ __END_NAMESPACE_C99
   __inline_mathop_declNP_ (float_type, func, op, "0" (__x))
 
 
-#  if defined __USE_MISC || defined __USE_ISOC99
+#  ifdef __USE_ISOC99
 #   define __inline_mathop_decl(func, op, params...) \
   __inline_mathop_decl_ (double, func, op, params)			      \
   __inline_mathop_decl_ (float, __CONCAT(func,f), op, params)		      \
@@ -450,7 +450,7 @@ __END_NAMESPACE_C99
   }
 
 
-#  if defined __USE_MISC || defined __USE_ISOC99
+#  ifdef __USE_ISOC99
 #   define __inline_mathcode(func, arg, code) \
   __inline_mathcode_ (double, func, arg, code)				      \
   __inline_mathcode_ (float, __CONCAT(func,f), arg, code)		      \
@@ -684,7 +684,7 @@ __inline_mathopNP_ (long double, __sqrtl, "fsqrt")
 
 #  if __GNUC_PREREQ (2, 8)
 __inline_mathcodeNP_ (double, fabs, __x, return __builtin_fabs (__x))
-#   if defined __USE_MISC || defined __USE_ISOC99
+#   ifdef __USE_ISOC99
 __inline_mathcodeNP_ (float, fabsf, __x, return __builtin_fabsf (__x))
 __inline_mathcodeNP_ (long double, fabsl, __x, return __builtin_fabsl (__x))
 #   endif
@@ -793,7 +793,7 @@ __NTH (ldexp (double __x, int __y))
 
 
 /* Optimized versions for some non-standardized functions.  */
-#  if defined __USE_ISOC99 || defined __USE_MISC
+#  ifdef __USE_ISOC99
 
 #   ifdef __FAST_MATH__
 __inline_mathcodeNP (expm1, __x, __expm1_code)
diff --git a/sysvipc/sys/ipc.h b/sysvipc/sys/ipc.h
index 0a87aff..0c574a1 100644
--- a/sysvipc/sys/ipc.h
+++ b/sysvipc/sys/ipc.h
@@ -20,8 +20,8 @@
 
 #include <features.h>
 
-#if !defined __USE_SVID && !defined __USE_XOPEN && __GNUC__ >= 2
-# warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
+#if !defined __USE_MISC && !defined __USE_XOPEN && __GNUC__ >= 2
+# warning "Files using this header must be compiled with _XOPEN_SOURCE"
 #endif
 
 /* Get system dependent definition of `struct ipc_perm' and more.  */
diff --git a/termios/termios.h b/termios/termios.h
index 3dc12b2..a9cb191 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 52edf41..29053f3 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)
@@ -184,7 +184,7 @@ extern int futimesat (int __fd, const char *__file,
       (result)->tv_usec += 1000000;					      \
     }									      \
   } while (0)
-#endif	/* BSD */
+#endif	/* Misc.  */
 
 __END_DECLS
 
diff --git a/time/time.h b/time/time.h
index ac20942..a21b908 100644
--- a/time/time.h
+++ b/time/time.h
@@ -58,7 +58,7 @@ __BEGIN_NAMESPACE_STD
 /* Returned by `clock'.  */
 typedef __clock_t clock_t;
 __END_NAMESPACE_STD
-#if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC
+#if defined __USE_XOPEN || defined __USE_POSIX
 __USING_NAMESPACE_STD(clock_t)
 #endif
 
@@ -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
+#ifdef __USE_POSIX
 __USING_NAMESPACE_STD(time_t)
 #endif
 
@@ -108,7 +108,7 @@ typedef __timer_t timer_t;
 
 #if (!defined __timespec_defined					\
      && ((defined _TIME_H						\
-	  && (defined __USE_POSIX199309 || defined __USE_MISC		\
+	  && (defined __USE_POSIX199309					\
 	      || defined __USE_ISOC11))					\
 	 || defined __need_timespec))
 # define __timespec_defined	1
@@ -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
@@ -151,7 +151,7 @@ struct tm
 # endif
 };
 __END_NAMESPACE_STD
-#if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC
+#if defined __USE_XOPEN || defined __USE_POSIX
 __USING_NAMESPACE_STD(tm)
 #endif
 
@@ -243,7 +243,7 @@ extern struct tm *gmtime (const time_t *__timer) __THROW;
 extern struct tm *localtime (const time_t *__timer) __THROW;
 __END_NAMESPACE_STD
 
-# if defined __USE_POSIX || defined __USE_MISC
+# ifdef __USE_POSIX
 /* Return the `struct tm' representation of *TIMER in UTC,
    using *TP to store the result.  */
 extern struct tm *gmtime_r (const time_t *__restrict __timer,
@@ -253,7 +253,7 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer,
    using *TP to store the result.  */
 extern struct tm *localtime_r (const time_t *__restrict __timer,
 			       struct tm *__restrict __tp) __THROW;
-# endif	/* POSIX or misc */
+# endif	/* POSIX */
 
 __BEGIN_NAMESPACE_STD
 /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n"
@@ -264,7 +264,7 @@ extern char *asctime (const struct tm *__tp) __THROW;
 extern char *ctime (const time_t *__timer) __THROW;
 __END_NAMESPACE_STD
 
-# if defined __USE_POSIX || defined __USE_MISC
+# ifdef __USE_POSIX
 /* Reentrant versions of the above functions.  */
 
 /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n"
@@ -275,7 +275,7 @@ extern char *asctime_r (const struct tm *__restrict __tp,
 /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'.  */
 extern char *ctime_r (const time_t *__restrict __timer,
 		      char *__restrict __buf) __THROW;
-# endif	/* POSIX or misc */
+# endif	/* POSIX */
 
 
 /* Defined in localtime.c.  */
@@ -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;

-- 
Joseph S. Myers
joseph@codesourcery.com


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