@@ -1,16 +1,12 @@
 #ifndef _STDLIB_H
Â
-#ifdef __need_malloc_and_calloc
-#define __Need_M_And_C
-#endif
-
 #ifndef _ISOMAC
 # include <stddef.h>
 #endif
 #include <stdlib/stdlib.h>
Â
 /* Now define the internal interfaces. */
-#if !defined __Need_M_And_C && !defined _ISOMAC
+#if !defined _ISOMAC
 # include <sys/stat.h>
Â
 __BEGIN_DECLS
@@ -269,6 +265,4 @@ __END_DECLS
Â
 #endif
Â
-#undef __Need_M_And_C
-
 #endif /* include/stdlib.h */
@@ -25,16 +25,13 @@
 #include <bits/libc-header-start.h>
Â
 /* Get size_t, wchar_t and NULL from <stddef.h>. */
-#define               __need_size_t
-#ifndef __need_malloc_and_calloc
-# define      __need_wchar_t
-# define      __need_NULL
-#endif
+#define __need_size_t
+#define __need_wchar_t
+#define __need_NULL
 #include <stddef.h>
Â
 __BEGIN_DECLS
Â
-#ifndef __need_malloc_and_calloc
 #define _STDLIB_H      1
Â
 #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H
@@ -434,10 +431,6 @@ extern int lcong48_r (unsigned short int __param[7],
 # endif /* Use misc. */
 #endif /* Use misc or X/Open. */
Â
-#endif /* don't just need malloc and calloc */
-
-#ifndef __malloc_and_calloc_defined
-# define __malloc_and_calloc_defined
 __BEGIN_NAMESPACE_STD
 /* Allocate SIZE bytes of memory. */
 extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
@@ -445,9 +438,7 @@ extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
 extern void *calloc (size_t __nmemb, size_t __size)
     __THROW __attribute_malloc__ __wur;
 __END_NAMESPACE_STD
-#endif
Â
-#ifndef __need_malloc_and_calloc
 __BEGIN_NAMESPACE_STD
 /* Re-allocate the previously allocated block
   in PTR, making the new block SIZE bytes long. */
@@ -944,9 +935,6 @@ extern int ttyslot (void) __THROW;
 # include <bits/stdlib-ldbl.h>
 #endif
Â
-#endif /* don't just need malloc and calloc */
-#undef __need_malloc_and_calloc
-
 __END_DECLS
Â
 #endif /* stdlib.h */
@@ -180,65 +180,6 @@ extern void *__rawmemchr (const void *__s, int __c);
 #endif
Â
Â
-/* We need the memory allocation functions for inline strdup().
-Â Â Referring to stdlib.h (even minimally) is not allowed
-  in any of the tight standards compliant modes. */
-#ifdef __USE_MISC
-
-# if !defined _HAVE_STRING_ARCH_strdup || !defined _HAVE_STRING_ARCH_strndup
-#Â define __need_malloc_and_calloc
-#Â include <stdlib.h>
-# endif
-
-# ifndef _HAVE_STRING_ARCH_strdup
-
-extern char *__strdup (const char *__string) __THROW __attribute_malloc__;
-#Â define __strdup(s) \
-Â (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ? (((const char *) (s))[0] == '\0'Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ? (char *) calloc ((size_t) 1, (size_t) 1)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â : ({ size_t __len = strlen (s) + 1;Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â char *__retval = (char *) malloc (__len);Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (__retval != NULL)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __retval = (char *) memcpy (__retval, s, __len);Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __retval; }))Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â : __strdup (s)))
-
-#Â if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-#Â Â define strdup(s) __strdup (s)
-#Â endif
-# endif
-
-# ifndef _HAVE_STRING_ARCH_strndup
-
-extern char *__strndup (const char *__string, size_t __n)
-Â Â Â Â __THROW __attribute_malloc__;
-#Â define __strndup(s, n) \
-Â (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ? (((const char *) (s))[0] == '\0'Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ? (char *) calloc ((size_t) 1, (size_t) 1)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â : ({ size_t __len = strlen (s) + 1;Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â size_t __n = (n);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â char *__retval;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (__n < __len)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __len = __n + 1;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __retval = (char *) malloc (__len);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (__retval != NULL)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __retval[__len - 1] = '\0';Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-                            __retval = (char *) memcpy (__retval, s,        \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __len - 1);Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â }Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __retval; }))Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â : __strndup (s, n)))
-
-#Â ifdef __USE_XOPEN2K8
-#Â Â define strndup(s, n) __strndup (s, n)
-#Â endif
-# endif
-
-#endif /* Use misc. or use GNU. */
-
 #ifndef _FORCE_INLINES
 # undef __STRING_INLINE
 #endif
@@ -302,7 +302,7 @@ _dl_load_cache_lookup (const char *name)
  char *temp;
  temp = alloca (strlen (best) + 1);
  strcpy (temp, best);
-Â return strdup (temp);
+Â return __strdup (temp);
 }
Â
 #ifndef MAP_COPY
@@ -149,7 +149,7 @@ rcmd_af (char **ahost, u_short rport, const char *locuser, const char *remuser,
Â
        if (res->ai_canonname){
                free (ahostbuf);
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â ahostbuf = strdup (res->ai_canonname);
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â ahostbuf = __strdup (res->ai_canonname);
                if (ahostbuf == NULL) {
                        __fxprintf(NULL, "%s",
                                   _("rcmd: Cannot allocate memory\n"));
@@ -73,7 +73,7 @@ rexec_af (char **ahost, int rport, const char *name, const char *pass,
Â
        if (res0->ai_canonname){
                free (ahostbuf);
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â ahostbuf = strdup (res0->ai_canonname);
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â ahostbuf = __strdup (res0->ai_canonname);
                if (ahostbuf == NULL) {
                        perror ("rexec: strdup");
                        return (-1);
@@ -131,6 +131,9 @@ extern int errno;
 /* Rename the non ANSI C functions. This is required by the standard
   because some ANSI C functions will require linking with this object
   file and the name space must not be polluted. */
+# ifndef strdup
+#Â define strdup __strdup
+# endif
 # define getcwd __getcwd
 # ifndef stpcpy
 # define stpcpy __stpcpy
@@ -124,18 +124,12 @@ _nl_find_domain (const char *dirname, char *locale,
  alias_value = _nl_expand_alias (locale);
  if (alias_value != NULL)
    {
-#if defined _LIBC || defined HAVE_STRDUP
-Â Â Â Â Â locale = strdup (alias_value);
-Â Â Â Â Â if (locale == NULL)
-Â Â Â Â Â Â return NULL;
-#else
      size_t len = strlen (alias_value) + 1;
      locale = (char *) malloc (len);
      if (locale == NULL)
        return NULL;
Â
      memcpy (locale, alias_value, len);
-#endif
    }
Â
  /* Now we determine the single parts of the locale name. First
@@ -462,7 +462,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
  if (__glibc_unlikely (lia == NULL))
    return NULL;
Â
-Â lia->name = strdup (*namep);
+Â lia->name = __strdup (*namep);
  if (__glibc_unlikely (lia->name == NULL))
    {
      free (lia);
@@ -283,7 +283,7 @@ setlocale (int category, const char *locale)
      if (__glibc_unlikely (strchr (locale, ';') != NULL))
        {
          /* This is a composite name. Make a copy and split it up. */
-Â Â Â Â Â Â Â Â locale_copy = strdup (locale);
+Â Â Â Â Â Â Â Â locale_copy = __strdup (locale);
          if (__glibc_unlikely (locale_copy == NULL))
            {
              __libc_rwlock_unlock (__libc_setlocale_lock);
@@ -34,7 +34,7 @@ posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *file_actions,
  if (!__spawn_valid_fd (fd))
    return EBADF;
Â
-Â char *path_copy = strdup (path);
+Â char *path_copy = __strdup (path);
  if (path_copy == NULL)
    return ENOMEM;
Â
@@ -60,7 +60,7 @@ putenv (char *string)
      int use_malloc = !__libc_use_alloca (name_end - string + 1);
      if (__builtin_expect (use_malloc, 0))
        {
-Â Â Â Â Â Â Â Â name = strndup (string, name_end - string);
+Â Â Â Â Â Â Â Â name = __strndup (string, name_end - string);
          if (name == NULL)
            return -1;
        }
@@ -87,7 +87,7 @@ __registerrpc (u_long prognum, u_long versnum, u_long procnum,
      transp = svcudp_create (RPC_ANYSOCK);
      if (transp == NULL)
        {
-Â Â Â Â Â Â Â Â buf = strdup (_("couldn't create an rpc server\n"));
+Â Â Â Â Â Â Â Â buf = __strdup (_("couldn't create an rpc server\n"));
          goto err_out;
        }
    }
@@ -103,7 +103,7 @@ __registerrpc (u_long prognum, u_long versnum, u_long procnum,
  pl = (struct proglst_ *) malloc (sizeof (struct proglst_));
  if (pl == NULL)
    {
-Â Â Â Â Â buf = strdup (_("registerrpc: out of memory\n"));
+Â Â Â Â Â buf = __strdup (_("registerrpc: out of memory\n"));
      goto err_out;
    }
  pl->p_progname = progname;
@@ -536,7 +536,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
                      }
                    else
                      {
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â namebuf = strndup (name, scope_delim - name);
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â namebuf = __strndup (name, scope_delim - name);
                        if (namebuf == NULL)
                          {
                            assert (!malloc_name);
@@ -1141,7 +1141,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
                  malloc_canonbuf = false;
                else
                  {
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â canon = strdup (canon);
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â canon = __strdup (canon);
                    if (canon == NULL)
                      {
                        result = -EAI_MEMORY;