summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-02-12 23:41:01 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-02-12 23:41:01 +0000
commit498afc54dfee41d33ba519f496e96480badace8e (patch)
tree8f45f9dedd46e1d9aa5558db399d0d9ebd87d8ce /posix
parentdd7b064ccaa3afc96499c7be2776baade60bcb56 (diff)
downloadglibc-498afc54dfee41d33ba519f496e96480badace8e.tar.gz
glibc-498afc54dfee41d33ba519f496e96480badace8e.tar.xz
glibc-498afc54dfee41d33ba519f496e96480badace8e.zip
Combine __USE_BSD and __USE_SVID into __USE_MISC.
This patch cleans up following the obsoletion of _BSD_SOURCE and
_SVID_SOURCE by combining __USE_BSD and __USE_SVID into __USE_MISC.

The only non-mechanical part of this patch is the changes to
features.h; everything else is simple substitution of __USE_MISC for
the old macros.  Thus, this patch leaves obviously redundant
conditionals such as "defined __USE_MISC || defined __USE_MISC", and
does not update #endif comments where they referred to BSD or SVID in
words instead of the literal macro name.  This is intended to
facilitate patch review by separating the less mechanical changes from
these purely mechanical changes into a separate patch.  (I do intend
to integrate all the changes from
<https://sourceware.org/ml/libc-alpha/2013-12/msg00226.html>, which I
believe includes all the trailing comment updates, in subsequent
patches.)

Tested x86_64.

	* include/features.h (__USE_BSD): Remove macro definitions.
	(__USE_SVID): Likewise.
	(_BSD_SOURCE): Likewise.
	(_SVID_SOURCE): Likewise.
	[!defined _BSD_SOURCE && !defined _SVID_SOURCE]: Remove condition
	from definition of _DEFAULT_SOURCE.
	[_BSD_SOURCE || _SVID_SOURCE]: Change condition to
	[_DEFAULT_SOURCE].
	* bits/fcntl.h [__USE_BSD]: Change condition to [__USE_MISC].
	* bits/mman.h [__USE_BSD]: Likewise.
	* bits/termios.h [__USE_BSD]: Likewise.
	* bits/waitstatus.h [__USE_BSD]: Likewise.
	* ctype/ctype.h [__USE_SVID]: Likewise.
	* dirent/dirent.h [__USE_BSD]: Likewise.
	* grp/grp.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* inet/netinet/igmp.h [__USE_BSD]: Likewise.
	* io/fcntl.h [__USE_BSD]: Likewise.
	* io/ftw.h [__USE_BSD]: Likewise.
	* io/sys/stat.h [__USE_BSD]: Likewise.
	* libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise.
	* libio/bits/stdio2.h [__USE_BSD]: Likewise.
	* libio/stdio.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* math/math.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* misc/bits/syslog-ldbl.h [__USE_BSD]: Likewise.
	* misc/bits/syslog.h [__USE_BSD]: Likewise.
	* misc/search.h [__USE_SVID]: Likewise.
	* misc/sys/mman.h [__USE_BSD]: Likewise.
	* misc/sys/syslog.h [__USE_BSD]: Likewise.
	* misc/sys/uio.h [__USE_BSD]: Likewise.
	* posix/bits/unistd.h [__USE_BSD]: Likewise.
	* posix/glob.h [__USE_BSD]: Likewise.
	* posix/regex.h [__USE_BSD]: Likewise.
	* posix/sys/types.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* posix/sys/utsname.h [__USE_SVID]: Likewise.
	* posix/sys/wait.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* posix/unistd.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* pwd/pwd.h [__USE_SVID]: Likewise.
	* resolv/netdb.h [__USE_BSD]: Likewise.
	* setjmp/setjmp.h [__USE_BSD]: Likewise.
	* signal/signal.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* socket/sys/socket.h [__USE_BSD]: Likewise.
	* stdlib/fmtmsg.h [__USE_SVID]: Likewise.
	* stdlib/stdlib.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* string/bits/string2.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* string/bits/string3.h [__USE_BSD]: Likewise.
	* string/endian.h [__USE_BSD]: Likewise.
	* string/string.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* string/strings.h [__USE_BSD]: Likewise.
	* sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise.
	* sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise.
	* sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Likewise.
	* sysdeps/mach/hurd/bits/stat.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/termios.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_ether.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_fddi.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_tr.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/x86/bits/string.h [__USE_BSD]: Likewise.
	* sysvipc/sys/ipc.h [__USE_SVID]: Likewise.
	* termios/termios.h [__USE_BSD]: Likewise.
	* time/sys/time.h [__USE_BSD]: Likewise.
	* time/time.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.

	* sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]: Change
	condition to [__USE_MISC].
Diffstat (limited to 'posix')
-rw-r--r--posix/bits/unistd.h8
-rw-r--r--posix/glob.h2
-rw-r--r--posix/regex.h2
-rw-r--r--posix/sys/types.h10
-rw-r--r--posix/sys/utsname.h2
-rw-r--r--posix/sys/wait.h14
-rw-r--r--posix/unistd.h44
7 files changed, 41 insertions, 41 deletions
diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h
index 336b928b40..d377d28f8b 100644
--- a/posix/bits/unistd.h
+++ b/posix/bits/unistd.h
@@ -119,7 +119,7 @@ pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
 # endif
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 extern ssize_t __readlink_chk (const char *__restrict __path,
 			       char *__restrict __buf, size_t __len,
 			       size_t __buflen)
@@ -210,7 +210,7 @@ __NTH (getcwd (char *__buf, size_t __size))
   return __getcwd_alias (__buf, __size);
 }
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 extern char *__getwd_chk (char *__buf, size_t buflen)
      __THROW __nonnull ((1)) __wur;
 extern char *__REDIRECT_NTH (__getwd_warn, (char *__buf), getwd)
@@ -329,7 +329,7 @@ getlogin_r (char *__buf, size_t __buflen)
 #endif
 
 
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_MISC || defined __USE_UNIX98
 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal)
      __THROW __nonnull ((1));
 extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen),
@@ -356,7 +356,7 @@ __NTH (gethostname (char *__buf, size_t __buflen))
 #endif
 
 
-#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98)
 extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal)
      __THROW __nonnull ((1)) __wur;
 extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf,
diff --git a/posix/glob.h b/posix/glob.h
index 9c5f37fc87..c0036433e5 100644
--- a/posix/glob.h
+++ b/posix/glob.h
@@ -45,7 +45,7 @@ typedef __SIZE_TYPE__ size_t;
 #define	GLOB_NOESCAPE	(1 << 6)/* Backslashes don't quote metacharacters.  */
 #define	GLOB_PERIOD	(1 << 7)/* Leading `.' can be matched by metachars.  */
 
-#if !defined __USE_POSIX2 || defined __USE_BSD || defined __USE_GNU
+#if !defined __USE_POSIX2 || defined __USE_MISC || defined __USE_GNU
 # define GLOB_MAGCHAR	 (1 << 8)/* Set in gl_flags if any metachars seen.  */
 # define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions.  */
 # define GLOB_BRACE	 (1 << 10)/* Expand "{a,b}" to "a" "b".  */
diff --git a/posix/regex.h b/posix/regex.h
index bb18d64a85..35de759dae 100644
--- a/posix/regex.h
+++ b/posix/regex.h
@@ -529,7 +529,7 @@ extern void re_set_registers (struct re_pattern_buffer *__buffer,
 			      regoff_t *__starts, regoff_t *__ends);
 #endif	/* Use GNU */
 
-#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_BSD)
+#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC)
 # ifndef _CRAY
 /* 4.2 bsd compatibility.  */
 extern char *re_comp (const char *);
diff --git a/posix/sys/types.h b/posix/sys/types.h
index 0d51ae8a67..3681813579 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -28,7 +28,7 @@ __BEGIN_DECLS
 
 #include <bits/types.h>
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # ifndef __u_char_defined
 typedef __u_char u_char;
 typedef __u_short u_short;
@@ -99,7 +99,7 @@ typedef __pid_t pid_t;
 # define __pid_t_defined
 #endif
 
-#if (defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8) \
+#if (defined __USE_MISC || defined __USE_XOPEN || defined __USE_XOPEN2K8) \
     && !defined __id_t_defined
 typedef __id_t id_t;
 # define __id_t_defined
@@ -110,7 +110,7 @@ typedef __ssize_t ssize_t;
 # define __ssize_t_defined
 #endif
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # ifndef __daddr_t_defined
 typedef __daddr_t daddr_t;
 typedef __caddr_t caddr_t;
@@ -118,7 +118,7 @@ typedef __caddr_t caddr_t;
 # endif
 #endif
 
-#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __key_t_defined
+#if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined
 typedef __key_t key_t;
 # define __key_t_defined
 #endif
@@ -211,7 +211,7 @@ typedef int register_t __attribute__ ((__mode__ (__word__)));
 #define __BIT_TYPES_DEFINED__	1
 
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* In BSD <sys/types.h> is expected to define BYTE_ORDER.  */
 # include <endian.h>
 
diff --git a/posix/sys/utsname.h b/posix/sys/utsname.h
index 32e3ba66be..a30d9c5fdb 100644
--- a/posix/sys/utsname.h
+++ b/posix/sys/utsname.h
@@ -71,7 +71,7 @@ struct utsname
 #endif
   };
 
-#ifdef __USE_SVID
+#ifdef __USE_MISC
 /* Note that SVID assumes all members have the same size.  */
 # define SYS_NMLN  _UTSNAME_LENGTH
 #endif
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index 72983865e5..e243db3374 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -34,7 +34,7 @@ __BEGIN_DECLS
    bits to `waitpid', `wait3', and `wait4'.  */
 # include <bits/waitflags.h>
 
-# ifdef	__USE_BSD
+# ifdef	__USE_MISC
 
 /* Lots of hair to allow traditional BSD use of `union wait'
    as well as POSIX.1 use of `int' for the status word.  */
@@ -87,7 +87,7 @@ typedef union
 # endif
 #endif	/* <stdlib.h> not included.  */
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 # define WCOREFLAG		__WCOREFLAG
 # define WCOREDUMP(status)	__WCOREDUMP (__WAIT_INT (status))
 # define W_EXITCODE(ret, sig)	__W_EXITCODE (ret, sig)
@@ -95,7 +95,7 @@ typedef union
 #endif
 
 /* The following values are used by the `waitid' function.  */
-#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_XOPEN2K8
 typedef enum
 {
   P_ALL,		/* Wait for any child.  */
@@ -112,7 +112,7 @@ typedef enum
    __THROW.  */
 extern __pid_t wait (__WAIT_STATUS __stat_loc);
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* Special values for the PID argument to `waitpid' and `wait4'.  */
 # define WAIT_ANY	(-1)	/* Any process.  */
 # define WAIT_MYPGRP	0	/* Any process in my process group.  */
@@ -135,7 +135,7 @@ extern __pid_t wait (__WAIT_STATUS __stat_loc);
    __THROW.  */
 extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
 
-#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_XOPEN2K8
 # ifndef __id_t_defined
 #  include <bits/types.h>
 typedef __id_t id_t;
@@ -160,7 +160,7 @@ extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
 		   int __options);
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* This being here makes the prototypes valid whether or not
    we have already included <sys/resource.h> to define `struct rusage'.  */
 struct rusage;
@@ -174,7 +174,7 @@ extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
 		      struct rusage * __usage) __THROWNL;
 #endif
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 /* PID is like waitpid.  Other args are like wait3.  */
 extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
 		      struct rusage *__usage) __THROWNL;
diff --git a/posix/unistd.h b/posix/unistd.h
index 64734b0f9b..b9ff6e453d 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -269,7 +269,7 @@ typedef __intptr_t intptr_t;
 # endif
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
 # ifndef __socklen_t_defined
 typedef __socklen_t socklen_t;
 #  define __socklen_t_defined
@@ -317,7 +317,7 @@ extern int faccessat (int __fd, const char *__file, int __type, int __flag)
 # endif
 #endif
 
-#if defined __USE_BSD && !defined L_SET
+#if defined __USE_MISC && !defined L_SET
 /* Old BSD names for the same constants; just for compatibility.  */
 # define L_SET		SEEK_SET
 # define L_INCR		SEEK_CUR
@@ -444,7 +444,7 @@ extern unsigned int alarm (unsigned int __seconds) __THROW;
 extern unsigned int sleep (unsigned int __seconds);
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
-    || defined __USE_BSD
+    || defined __USE_MISC
 /* Set an alarm to go off (generating a SIGALRM signal) in VALUE
    microseconds.  If INTERVAL is nonzero, when the alarm goes off, the
    timer is reset to go off every INTERVAL microseconds thereafter.
@@ -473,7 +473,7 @@ extern int pause (void);
 extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
      __THROW __nonnull ((1)) __wur;
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* Change the owner and group of the file that FD is open on.  */
 extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur;
 
@@ -496,7 +496,7 @@ extern int fchownat (int __fd, const char *__file, __uid_t __owner,
 /* Change the process's working directory to PATH.  */
 extern int chdir (const char *__path) __THROW __nonnull ((1)) __wur;
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* Change the process's working directory to the one FD is open on.  */
 extern int fchdir (int __fd) __THROW __wur;
 #endif
@@ -518,7 +518,7 @@ extern char *get_current_dir_name (void) __THROW;
 #endif
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
-    || defined __USE_BSD
+    || defined __USE_MISC
 /* Put the absolute pathname of the current working directory in BUF.
    If successful, return BUF.  If not, put an error message in
    BUF and return NULL.  BUF should be at least PATH_MAX bytes long.  */
@@ -645,7 +645,7 @@ extern __pid_t getpgid (__pid_t __pid) __THROW;
    If PGID is zero, the process ID of the process is used.  */
 extern int setpgid (__pid_t __pid, __pid_t __pgid) __THROW;
 
-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Both System V and BSD have `setpgrp' functions, but with different
    calling conventions.  The BSD function is the same as POSIX.1 `setpgid'
    (above).  The System V function takes no arguments and puts the calling
@@ -699,13 +699,13 @@ extern int group_member (__gid_t __gid) __THROW;
    if not, the effective user ID is set to UID.  */
 extern int setuid (__uid_t __uid) __THROW __wur;
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Set the real user ID of the calling process to RUID,
    and the effective user ID of the calling process to EUID.  */
 extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW __wur;
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN2K
 /* Set the effective user ID of the calling process to UID.  */
 extern int seteuid (__uid_t __uid) __THROW __wur;
 #endif /* Use BSD.  */
@@ -716,13 +716,13 @@ extern int seteuid (__uid_t __uid) __THROW __wur;
    if not, the effective group ID is set to GID.  */
 extern int setgid (__gid_t __gid) __THROW __wur;
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 /* Set the real group ID of the calling process to RGID,
    and the effective group ID of the calling process to EGID.  */
 extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW __wur;
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN2K
 /* Set the effective group ID of the calling process to GID.  */
 extern int setegid (__gid_t __gid) __THROW __wur;
 #endif /* Use BSD.  */
@@ -756,7 +756,7 @@ extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
 extern __pid_t fork (void) __THROWNL;
 
 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
-    || defined __USE_BSD
+    || defined __USE_MISC
 /* Clone the calling process, but without copying the whole address space.
    The calling process is suspended until the new process exits or is
    replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
@@ -778,7 +778,7 @@ extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
    with a terminal, zero if not.  */
 extern int isatty (int __fd) __THROW;
 
-#if defined __USE_BSD \
+#if defined __USE_MISC \
     || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98)
 /* Return the index into the active-logins file (utmp) for
    the controlling terminal.  */
@@ -798,7 +798,7 @@ extern int linkat (int __fromfd, const char *__from, int __tofd,
      __THROW __nonnull ((2, 4)) __wur;
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 /* Make a symbolic link to FROM named TO.  */
 extern int symlink (const char *__from, const char *__to)
      __THROW __nonnull ((1, 2)) __wur;
@@ -857,7 +857,7 @@ extern char *getlogin (void);
 extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
 #endif
 
-#ifdef	__USE_BSD
+#ifdef	__USE_MISC
 /* Set the login name returned by `getlogin'.  */
 extern int setlogin (const char *__name) __THROW __nonnull ((1));
 #endif
@@ -872,7 +872,7 @@ extern int setlogin (const char *__name) __THROW __nonnull ((1));
 #endif
 
 
-#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K
+#if defined __USE_MISC || defined __USE_UNIX98 || defined __USE_XOPEN2K
 /* Put the name of the current host in no more than LEN bytes of NAME.
    The result is null-terminated if LEN is large enough for the full
    name and the terminator.  */
@@ -880,7 +880,7 @@ extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1));
 #endif
 
 
-#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98)
 /* Set the name of the current host to NAME, which is LEN bytes long.
    This call is restricted to the super-user.  */
 extern int sethostname (const char *__name, size_t __len)
@@ -938,7 +938,7 @@ extern int daemon (int __nochdir, int __noclose) __THROW __wur;
 #endif /* Use BSD || X/Open.  */
 
 
-#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
 /* Make PATH be the root directory (the starting point for absolute paths).
    This call is restricted to the super-user.  */
 extern int chroot (const char *__path) __THROW __nonnull ((1)) __wur;
@@ -963,7 +963,7 @@ extern int syncfs (int __fd) __THROW;
 #endif
 
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 
 /* Return identifier for the current host.  */
 extern long int gethostid (void);
@@ -972,7 +972,7 @@ extern long int gethostid (void);
 extern void sync (void) __THROW;
 
 
-# if defined __USE_BSD || !defined __USE_XOPEN2K
+# if defined __USE_MISC || !defined __USE_XOPEN2K
 /* Return the number of bytes in a page.  This is the system's page size,
    which is not necessarily the same as the hardware page size.  */
 extern int getpagesize (void)  __THROW __attribute__ ((__const__));
@@ -986,7 +986,7 @@ extern int getdtablesize (void) __THROW;
 #endif /* Use BSD || X/Open Unix.  */
 
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 
 /* Truncate FILE to LENGTH bytes.  */
 # ifndef __USE_FILE_OFFSET64
@@ -1008,7 +1008,7 @@ extern int truncate64 (const char *__file, __off64_t __length)
 
 #endif /* Use BSD || X/Open Unix || POSIX 2008.  */
 
-#if defined __USE_BSD || defined __USE_POSIX199309 \
+#if defined __USE_MISC || defined __USE_POSIX199309 \
     || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 
 /* Truncate the file FD is open on to LENGTH bytes.  */