Browse Source

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed

Peter S. Mazinger 19 years ago
parent
commit
af0172162f
100 changed files with 2492 additions and 1993 deletions
  1. 356 256
      include/libc-internal.h
  2. 27 18
      libc/inet/addr.c
  3. 11 8
      libc/inet/ether_addr.c
  4. 63 51
      libc/inet/getaddrinfo.c
  5. 4 4
      libc/inet/getnetbyad.c
  6. 7 6
      libc/inet/getnetbynm.c
  7. 15 10
      libc/inet/getnetent.c
  8. 34 26
      libc/inet/getproto.c
  9. 39 30
      libc/inet/getservice.c
  10. 5 2
      libc/inet/herror.c
  11. 21 11
      libc/inet/hostid.c
  12. 32 25
      libc/inet/if_index.c
  13. 18 13
      libc/inet/ifaddrs.c
  14. 4 2
      libc/inet/in6_addr.c
  15. 4 3
      libc/inet/inet_net.c
  16. 22 15
      libc/inet/ntop.c
  17. 4 2
      libc/inet/opensock.c
  18. 152 163
      libc/inet/resolv.c
  19. 7 6
      libc/inet/rpc/auth_none.c
  20. 29 21
      libc/inet/rpc/auth_unix.c
  21. 10 8
      libc/inet/rpc/authunix_prot.c
  22. 10 7
      libc/inet/rpc/bindresvport.c
  23. 15 15
      libc/inet/rpc/clnt_generic.c
  24. 56 45
      libc/inet/rpc/clnt_perror.c
  25. 10 9
      libc/inet/rpc/clnt_raw.c
  26. 11 7
      libc/inet/rpc/clnt_simple.c
  27. 34 30
      libc/inet/rpc/clnt_tcp.c
  28. 41 38
      libc/inet/rpc/clnt_udp.c
  29. 37 34
      libc/inet/rpc/clnt_unix.c
  30. 4 4
      libc/inet/rpc/create_xid.c
  31. 17 11
      libc/inet/rpc/get_myaddress.c
  32. 54 42
      libc/inet/rpc/getrpcent.c
  33. 5 4
      libc/inet/rpc/getrpcport.c
  34. 30 23
      libc/inet/rpc/pmap_clnt.c
  35. 3 3
      libc/inet/rpc/pmap_getmaps.c
  36. 6 9
      libc/inet/rpc/pmap_getport.c
  37. 1 2
      libc/inet/rpc/pmap_prot.c
  38. 2 3
      libc/inet/rpc/pmap_prot2.c
  39. 41 33
      libc/inet/rpc/pmap_rmt.c
  40. 90 69
      libc/inet/rpc/rcmd.c
  41. 53 42
      libc/inet/rpc/rexec.c
  42. 15 13
      libc/inet/rpc/rpc_callmsg.c
  43. 6 5
      libc/inet/rpc/rpc_dtablesize.c
  44. 1 4
      libc/inet/rpc/rpc_private.h
  45. 29 23
      libc/inet/rpc/rpc_prot.c
  46. 26 22
      libc/inet/rpc/rpc_thread.c
  47. 11 8
      libc/inet/rpc/rtime.c
  48. 68 55
      libc/inet/rpc/ruserpass.c
  49. 72 59
      libc/inet/rpc/svc.c
  50. 4 3
      libc/inet/rpc/svc_auth.c
  51. 7 5
      libc/inet/rpc/svc_auth_unix.c
  52. 4 4
      libc/inet/rpc/svc_raw.c
  53. 8 8
      libc/inet/rpc/svc_run.c
  54. 19 15
      libc/inet/rpc/svc_simple.c
  55. 34 25
      libc/inet/rpc/svc_tcp.c
  56. 44 34
      libc/inet/rpc/svc_udp.c
  57. 40 32
      libc/inet/rpc/svc_unix.c
  58. 76 61
      libc/inet/rpc/xdr.c
  59. 11 8
      libc/inet/rpc/xdr_array.c
  60. 8 5
      libc/inet/rpc/xdr_mem.c
  61. 25 18
      libc/inet/rpc/xdr_rec.c
  62. 12 9
      libc/inet/rpc/xdr_reference.c
  63. 6 6
      libc/inet/rpc/xdr_stdio.c
  64. 53 45
      libc/inet/socketcalls.c
  65. 3 0
      libc/misc/assert/__assert.c
  66. 19 15
      libc/misc/ctype/ctype.c
  67. 3 1
      libc/misc/dirent/alphasort.c
  68. 2 1
      libc/misc/dirent/alphasort64.c
  69. 6 3
      libc/misc/dirent/closedir.c
  70. 9 2
      libc/misc/dirent/dirfd.c
  71. 2 2
      libc/misc/dirent/dirstream.h
  72. 12 7
      libc/misc/dirent/opendir.c
  73. 4 2
      libc/misc/dirent/readdir.c
  74. 4 2
      libc/misc/dirent/readdir64.c
  75. 3 1
      libc/misc/dirent/readdir64_r.c
  76. 3 1
      libc/misc/dirent/readdir_r.c
  77. 2 1
      libc/misc/dirent/rewinddir.c
  78. 13 27
      libc/misc/dirent/scandir.c
  79. 7 6
      libc/misc/dirent/scandir64.c
  80. 3 1
      libc/misc/dirent/seekdir.c
  81. 29 19
      libc/misc/error/err.c
  82. 14 10
      libc/misc/error/error.c
  83. 12 8
      libc/misc/file/lockf.c
  84. 11 10
      libc/misc/file/lockf64.c
  85. 63 55
      libc/misc/fnmatch/fnmatch.c
  86. 3 3
      libc/misc/fnmatch/fnmatch_loop.c
  87. 7 4
      libc/misc/fnmatch/fnmatch_old.c
  88. 37 28
      libc/misc/ftw/ftw.c
  89. 2 2
      libc/misc/ftw/ftw64.c
  90. 32 25
      libc/misc/glob/glob.c
  91. 2 4
      libc/misc/glob/glob64.c
  92. 12 11
      libc/misc/gnu/obstack.c
  93. 28 17
      libc/misc/internals/__uClibc_main.c
  94. 25 18
      libc/misc/internals/tempname.c
  95. 63 56
      libc/misc/locale/locale.c
  96. 25 12
      libc/misc/mntent/mntent.c
  97. 3 2
      libc/misc/regex/regcomp.c
  98. 37 32
      libc/misc/regex/regex.c
  99. 25 24
      libc/misc/regex/regex_old.c
  100. 4 4
      libc/misc/search/hsearch.c

+ 356 - 256
include/libc-internal.h

@@ -119,6 +119,11 @@
 # define IS_IN_libc 1
 # define IS_IN_libc 1
 #endif
 #endif
 
 
+/* need this to unset defaults in libpthread for files that get added to libc */
+#ifdef IS_IN_libc
+# undef NOT_IN_libc
+#endif
+
 /* Prepare for the case that `__builtin_expect' is not available.  */
 /* Prepare for the case that `__builtin_expect' is not available.  */
 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96
 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96
 # define __builtin_expect(x, expected_value) (x)
 # define __builtin_expect(x, expected_value) (x)
@@ -138,306 +143,401 @@
 
 
 #define attribute_unused __attribute__ ((unused))
 #define attribute_unused __attribute__ ((unused))
 
 
-/* Arrange to hide uClibc internals */
+/* The following macros are used for PLT bypassing within libc.so
-#if __GNUC_PREREQ (3, 3)
+   (and if needed other libraries similarly).
-# define attribute_hidden __attribute__ ((visibility ("hidden")))
+   First of all, you need to have the function prototyped somewhere,
-#else
+   say in foo/foo.h:
-# define attribute_hidden
-#endif
 
 
-#ifndef __ASSEMBLER__
+   int foo (int __bar);
-# define hidden_strong_alias(name, aliasname) _hidden_strong_alias(name, aliasname)
-# define _hidden_strong_alias(name, aliasname) \
-  extern __typeof (name) aliasname __attribute__ ((alias (#name))) attribute_hidden;
 
 
-# define hidden_weak_alias(name, aliasname) _hidden_weak_alias (name, aliasname)
+   If calls to foo within libc.so should always go to foo defined in libc.so,
-# define _hidden_weak_alias(name, aliasname) \
+   then in include/foo.h you add:
-  extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) attribute_hidden;
-#else /* __ASSEMBLER__ */
-# define hidden_strong_alias(name, aliasname)				\
-  .global C_SYMBOL_NAME (aliasname) ;					\
-  .hidden C_SYMBOL_NAME (aliasname) ;					\
-  .set C_SYMBOL_NAME(aliasname),C_SYMBOL_NAME(name)
 
 
-# define hidden_weak_alias(name, aliasname)				\
+   libc_hidden_proto (foo)
-  .weak C_SYMBOL_NAME(aliasname) ;					\
-  .hidden C_SYMBOL_NAME(aliasname) ;					\
-  C_SYMBOL_NAME(aliasname) = C_SYMBOL_NAME(name)
-#endif /* __ASSEMBLER__ */
 
 
-#ifdef __UCLIBC_BUILD_RELRO__
+   line and after the foo function definition:
-# define attribute_relro __attribute__ ((section (".data.rel.ro")))
-#else
-# define attribute_relro
-#endif
 
 
-#ifdef __GNUC__
+   int foo (int __bar)
-# define attribute_noreturn __attribute__ ((__noreturn__))
+   {
-#else
+     return __bar;
-# define attribute_noreturn
+   }
-#endif
+   libc_hidden_def (foo)
 
 
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+   or
-# define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec")))
-#endif
 
 
-/* Pull in things like __attribute_used__ */
+   int foo (int __bar)
-#include <sys/cdefs.h>
+   {
+     return __bar;
+   }
+   libc_hidden_weak (foo)
 
 
-/* --- this is added to integrate linuxthreads */
+   Simularly for global data. If references to foo within libc.so should
-#define __USE_UNIX98            1
+   always go to foo defined in libc.so, then in include/foo.h you add:
 
 
-#ifndef __ASSEMBLER__
+   libc_hidden_proto (foo)
-# ifdef IS_IN_libc
 
 
-#  define __UC(N) __ ## N
+   line and after foo's definition:
-#  define __UC_ALIAS(N) strong_alias( __ ## N , N )
-#  if defined __UCLIBC_HAS_XLOCALE__ && defined __UCLIBC_DO_XLOCALE
-#   define __UCXL(N) __ ## N ## _l
-#   define __UCXL_ALIAS(N) strong_alias ( __ ## N ## _l , N ## _l )
-#  else
-#   define __UCXL(N) __UC(N)
-#   define __UCXL_ALIAS(N) __UC_ALIAS(N)
-#  endif
 
 
-#  define __need_size_t
+   int foo = INITIAL_FOO_VALUE;
-#  ifdef __UCLIBC_HAS_WCHAR__
+   libc_hidden_data_def (foo)
-#   define __need_wchar_t
-#   define __need_wint_t
-#  endif
-#  include <stddef.h>
 
 
-#  include <bits/types.h>
+   or
 
 
-#  ifndef __ssize_t_defined
+   int foo = INITIAL_FOO_VALUE;
-typedef __ssize_t ssize_t;
+   libc_hidden_data_weak (foo)
-#   define __ssize_t_defined
-#  endif
 
 
-#  include <bits/sigset.h>
+   If foo is normally just an alias (strong or weak) of some other function,
+   you should use the normal strong_alias first, then add libc_hidden_def
+   or libc_hidden_weak:
 
 
-/* prototypes for internal use, please keep these in sync w/ updated headers */
+   int baz (int __bar)
-/* #include <fcntl.h> */
+   {
-#ifndef __USE_FILE_OFFSET64
+     return __bar;
-extern int __open (__const char *__file, int __oflag, ...) __nonnull ((1)) attribute_hidden;
+   }
-extern int __fcntl (int __fd, int __cmd, ...) attribute_hidden;
+   strong_alias (baz, foo)
-#else
+   libc_hidden_weak (foo)
-# ifdef __REDIRECT
-extern int __REDIRECT (__open, (__const char *__file, int __oflag, ...), __open64)
-     __nonnull ((1)) attribute_hidden;
-extern int __REDIRECT (__fcntl, (int __fd, int __cmd, ...), __fcntl64) attribute_hidden;
-# else
-#  define __open __open64
-#  define __fcntl __fcntl64
-# endif
-#endif
-#ifdef __USE_LARGEFILE64
-extern int __open64 (__const char *__file, int __oflag, ...) __nonnull ((1)) attribute_hidden;
-extern int __fcntl64 (int __fd, int __cmd, ...) attribute_hidden;
-#endif
 
 
-/* #include <string.h> */
+   If the function should be internal to multiple objects, say ld.so and
-extern int __memcmp (__const void *__s1, __const void *__s2, size_t __n) attribute_hidden;
+   libc.so, the best way is to use:
-extern void *__memcpy (void *__restrict __dest,
-		     __const void *__restrict __src, size_t __n) attribute_hidden;
-extern void *__memmove (void *__dest, __const void *__src, size_t __n) attribute_hidden;
-extern void *__memset (void *__s, int __c, size_t __n) attribute_hidden;
-extern char *__strcpy (char *__restrict __dest, __const char *__restrict __src) attribute_hidden;
-extern size_t __strlen (__const char *__s) attribute_hidden;
-extern int __strcmp (__const char *__s1, __const char *__s2) attribute_hidden;
-extern char *__strcat (char *__restrict __dest, __const char *__restrict __src) attribute_hidden;
-extern char *__strncpy (char *__restrict __dest,
-		      __const char *__restrict __src, size_t __n) attribute_hidden;
-extern char *__strchr (__const char *__s, int __c) attribute_hidden;
-extern char *__strrchr (__const char *__s, int __c) attribute_hidden;
-extern int __strncmp (__const char *__s1, __const char *__s2, size_t __n) attribute_hidden;
-extern char *__strdup (__const char *__s) attribute_hidden;
-extern int __strcasecmp (__const char *__s1, __const char *__s2) attribute_hidden;
-extern int __strncasecmp (__const char *__s1, __const char *__s2, size_t __n) attribute_hidden;
-extern void *__rawmemchr (__const void *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)) attribute_hidden;
-extern size_t __strspn (__const char *__s, __const char *__accept)
-     __THROW __attribute_pure__ __nonnull ((1, 2)) attribute_hidden;
-extern char *__strpbrk (__const char *__s, __const char *__accept)
-     __THROW __attribute_pure__ __nonnull ((1, 2)) attribute_hidden;
-extern size_t __strnlen (__const char *__string, size_t __maxlen)
-     __THROW __attribute_pure__ __nonnull ((1)) attribute_hidden;
-extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim,
-		       char **__restrict __save_ptr) __THROW __nonnull ((2, 3)) attribute_hidden;
 
 
-/* sources are built w/ _GNU_SOURCE, this gets undefined */
+   #if !defined NOT_IN_libc || defined IS_IN_rtld
-extern int __xpg_strerror_r_internal (int __errnum, char *__buf, size_t __buflen) attribute_hidden;
+   hidden_proto (foo)
-extern char *__glibc_strerror_r_internal (int __errnum, char *__buf, size_t __buflen) attribute_hidden;
+   #endif
-
+
-/* ctype.h */
+   in include/foo.h and the normal macros at all function definitions
-extern int __tolower (int __c) __THROW attribute_hidden;
+   depending on what DSO they belong to.
-extern int __toupper (int __c) __THROW attribute_hidden;
+
-
+   If versioned_symbol macro is used to define foo,
-#ifdef __UCLIBC_HAS_WCHAR__
+   libc_hidden_ver macro should be used, as in:
-/* wchar.h */
-extern size_t __wcslen (__const wchar_t *__s) __THROW __attribute_pure__ attribute_hidden;
-extern wchar_t *__wcscpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src) __THROW attribute_hidden;
-extern size_t __wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept)
-     __THROW __attribute_pure__ attribute_hidden;
-extern wchar_t *__wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept)
-     __THROW __attribute_pure__ attribute_hidden;
-/* wctype.h */
-extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden;
-#endif
 
 
-/* #include <unistd.h> */
+   int __real_foo (int __bar)
-extern ssize_t __read(int __fd, void *__buf, size_t __nbytes) attribute_hidden;
+   {
-extern ssize_t __write(int __fd, __const void *__buf, size_t __n) attribute_hidden;
+     return __bar;
-extern int __close(int __fd) attribute_hidden;
+   }
-extern __pid_t __getpid (void) attribute_hidden;
+   versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
-extern void _exit_internal (int __status) __attribute__ ((__noreturn__)) attribute_hidden;
+   libc_hidden_ver (__real_foo, foo)  */
-#ifndef __USE_FILE_OFFSET64
+
-extern int __lockf (int __fd, int __cmd, __off_t __len) attribute_hidden;
+/* uClibc specific (the above comment was copied from glibc):
-extern __off_t __lseek (int __fd, __off_t __offset, int __whence) __THROW attribute_hidden;
+ * a. when ppc64 will be supported, we need changes to support:
+ * strong_data_alias (used by asm hidden_data_def) / HAVE_ASM_GLOBAL_DOT_NAME
+ * b. libc_hidden_proto(foo) should be added after the header having foo's prototype
+ * or after extern foo... to all source files that should use the internal version
+ * of foo within libc, even to the file defining foo itself, libc_hidden_def does
+ * not hide __GI_foo itself, although the name suggests it (hiding is done exclusively
+ * by libc_hidden_proto). The reasoning to have it after the header w/ foo's prototype is
+ * to get first the __REDIRECT from original header and then create the __GI_foo alias
+ * c. no versioning support, hidden[_data]_ver are noop */
+
+/* Arrange to hide uClibc internals */
+#if __GNUC_PREREQ (3, 3)
+# define attribute_hidden __attribute__ ((visibility ("hidden")))
+# define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
 #else
 #else
-# ifdef __REDIRECT
+# define attribute_hidden
-extern int __REDIRECT (__lockf, (int __fd, int __cmd, __off64_t __len),
+# define __hidden_proto_hiddenattr(attrs...)
-		       __lockf64) attribute_hidden;
+#endif
-extern __off64_t __REDIRECT (__lseek,
+
-				 (int __fd, __off64_t __offset, int __whence),
+/* if ppc64 will be supported, this section needs adapting due to HAVE_ASM_GLOBAL_DOT_NAME */
-				 __lseek64) attribute_hidden;
+#if 1 /* SHARED */
+# ifndef __ASSEMBLER__
+#  define hidden_strong_alias(name, aliasname) _hidden_strong_alias(name, aliasname)
+#  define _hidden_strong_alias(name, aliasname) \
+   extern __typeof (name) aliasname __attribute__ ((alias (#name))) attribute_hidden;
+
+#  define hidden_weak_alias(name, aliasname) _hidden_weak_alias (name, aliasname)
+#  define _hidden_weak_alias(name, aliasname) \
+   extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) attribute_hidden;
+
+#  define hidden_proto(name, attrs...) __hidden_proto (name, __GI_##name, ##attrs)
+#  define __hidden_proto(name, internal, attrs...) \
+   extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
+   __hidden_proto_hiddenattr (attrs);
+#  define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
+#  define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
+#  define __hidden_asmname2(prefix, name) #prefix name
+#  define __hidden_ver1(local, internal, name) \
+   extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
+   extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname (#local))))
+#  define hidden_def(name)		__hidden_ver1(__GI_##name, name, name);
+#  define hidden_data_def(name)		hidden_def(name)
+#  define hidden_weak(name)		__hidden_ver1(__GI_##name, name, name) __attribute__((weak));
+#  define hidden_data_weak(name)	hidden_weak(name)
+
+# else /* __ASSEMBLER__ */
+#  define hidden_strong_alias(name, aliasname)				\
+   .global C_SYMBOL_NAME (aliasname) ;					\
+   .hidden C_SYMBOL_NAME (aliasname) ;					\
+   .set C_SYMBOL_NAME(aliasname),C_SYMBOL_NAME(name)
+
+#  define hidden_weak_alias(name, aliasname)				\
+   .weak C_SYMBOL_NAME(aliasname) ;					\
+   .hidden C_SYMBOL_NAME(aliasname) ;					\
+   C_SYMBOL_NAME(aliasname) = C_SYMBOL_NAME(name)
+
+/* For assembly, we need to do the opposite of what we do in C:
+   in assembly gcc __REDIRECT stuff is not in place, so functions
+   are defined by its normal name and we need to create the
+   __GI_* alias to it, in C __REDIRECT causes the function definition
+   to use __GI_* name and we need to add alias to the real name.
+   There is no reason to use hidden_weak over hidden_def in assembly,
+   but we provide it for consistency with the C usage.
+   hidden_proto doesn't make sense for assembly but the equivalent
+   is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET.  */
+#  define hidden_def(name)	hidden_strong_alias (name, __GI_##name)
+#  define hidden_data_def(name)	hidden_strong_alias (name, __GI_##name)
+#  define hidden_weak(name)	hidden_def (name)
+#  define hidden_data_weak(name)	hidden_data_def (name)
+#  define HIDDEN_JUMPTARGET(name) __GI_##name
+# endif /* __ASSEMBLER__ */
+#else /* SHARED */
+# define hidden_strong_alias(name, aliasname)
+# define hidden_weak_alias(name, aliasname)
+
+# ifndef __ASSEMBLER__
+#  define hidden_proto(name, attrs...)
 # else
 # else
-#  define __lockf __lockf64
+#  define HIDDEN_JUMPTARGET(name) name
-#  define __lseek __lseek64
 # endif
 # endif
+# define hidden_def(name)
+# define hidden_data_def(name)
+# define hidden_weak(name)
+# define hidden_data_weak(name)
+#endif /* SHARED */
+
+/* uClibc does not support versioning yet. */
+#define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */
+#define hidden_ver(local, name) /* strong_alias(local, __GI_##name) */
+#define hidden_data_ver(local, name) /* strong_alias(local,__GI_##name) */
+
+#if !defined NOT_IN_libc
+# define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libc_hidden_def(name) hidden_def (name)
+# define libc_hidden_weak(name) hidden_weak (name)
+# define libc_hidden_ver(local, name) hidden_ver (local, name)
+# define libc_hidden_data_def(name) hidden_data_def (name)
+# define libc_hidden_data_weak(name) hidden_data_weak (name)
+# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libc_hidden_proto(name, attrs...)
+# define libc_hidden_def(name)
+# define libc_hidden_weak(name)
+# define libc_hidden_ver(local, name)
+# define libc_hidden_data_def(name)
+# define libc_hidden_data_weak(name)
+# define libc_hidden_data_ver(local, name)
 #endif
 #endif
-#ifdef __USE_LARGEFILE64
+
-extern int __lockf64 (int __fd, int __cmd, __off64_t __len) attribute_hidden;
+#if defined NOT_IN_libc && defined IS_IN_rtld
-extern __off64_t __lseek64 (int __fd, __off64_t __offset, int __whence) __THROW attribute_hidden;
+# define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define rtld_hidden_def(name) hidden_def (name)
+# define rtld_hidden_weak(name) hidden_weak (name)
+# define rtld_hidden_ver(local, name) hidden_ver (local, name)
+# define rtld_hidden_data_def(name) hidden_data_def (name)
+# define rtld_hidden_data_weak(name) hidden_data_weak (name)
+# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define rtld_hidden_proto(name, attrs...)
+# define rtld_hidden_def(name)
+# define rtld_hidden_weak(name)
+# define rtld_hidden_ver(local, name)
+# define rtld_hidden_data_def(name)
+# define rtld_hidden_data_weak(name)
+# define rtld_hidden_data_ver(local, name)
 #endif
 #endif
 
 
-/* #include <stdio.h> */
+#if defined NOT_IN_libc && defined IS_IN_libm
-extern void __perror (__const char *__s) attribute_hidden;
+# define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
-extern int __printf (__const char *__restrict __format, ...) attribute_hidden;
+# define libm_hidden_def(name) hidden_def (name)
-extern int __sprintf (char *__restrict __s,
+# define libm_hidden_weak(name) hidden_weak (name)
-		    __const char *__restrict __format, ...) attribute_hidden;
+# define libm_hidden_ver(local, name) hidden_ver (local, name)
-
+# define libm_hidden_data_def(name) hidden_data_def (name)
-/* hack */
+# define libm_hidden_data_weak(name) hidden_data_weak (name)
-#define abort __abort
+# define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
-#define fprintf __fprintf
-#define fclose __fclose
-#ifndef __USE_FILE_OFFSET64
-#define fopen __fopen
 #else
 #else
-#define fopen __fopen64
+# define libm_hidden_proto(name, attrs...)
+# define libm_hidden_def(name)
+# define libm_hidden_weak(name)
+# define libm_hidden_ver(local, name)
+# define libm_hidden_data_def(name)
+# define libm_hidden_data_weak(name)
+# define libm_hidden_data_ver(local, name)
 #endif
 #endif
-#ifdef __USE_LARGEFILE64
+
-#define fopen64 __fopen64
+#if defined NOT_IN_libc && defined IS_IN_libresolv
+# define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libresolv_hidden_def(name) hidden_def (name)
+# define libresolv_hidden_weak(name) hidden_weak (name)
+# define libresolv_hidden_ver(local, name) hidden_ver (local, name)
+# define libresolv_hidden_data_def(name) hidden_data_def (name)
+# define libresolv_hidden_data_weak(name) hidden_data_weak (name)
+# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libresolv_hidden_proto(name, attrs...)
+# define libresolv_hidden_def(name)
+# define libresolv_hidden_weak(name)
+# define libresolv_hidden_ver(local, name)
+# define libresolv_hidden_data_def(name)
+# define libresolv_hidden_data_weak(name)
+# define libresolv_hidden_data_ver(local, name)
 #endif
 #endif
 
 
-/* #include <stdlib.h> */
+#if defined NOT_IN_libc && defined IS_IN_librt
-extern char *__getenv (__const char *__name) attribute_hidden;
+# define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
-extern void __exit (int __status) __THROW __attribute__ ((__noreturn__)) attribute_hidden;
+# define librt_hidden_def(name) hidden_def (name)
+# define librt_hidden_weak(name) hidden_weak (name)
+# define librt_hidden_ver(local, name) hidden_ver (local, name)
+# define librt_hidden_data_def(name) hidden_data_def (name)
+# define librt_hidden_data_weak(name) hidden_data_weak (name)
+# define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define librt_hidden_proto(name, attrs...)
+# define librt_hidden_def(name)
+# define librt_hidden_weak(name)
+# define librt_hidden_ver(local, name)
+# define librt_hidden_data_def(name)
+# define librt_hidden_data_weak(name)
+# define librt_hidden_data_ver(local, name)
+#endif
 
 
-/* #include <signal.h> */
+#if defined NOT_IN_libc && defined IS_IN_libdl
-extern int __sigprocmask (int __how, __const __sigset_t *__restrict __set,
+# define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
-			__sigset_t *__restrict __oset) attribute_hidden;
+# define libdl_hidden_def(name) hidden_def (name)
+# define libdl_hidden_weak(name) hidden_weak (name)
+# define libdl_hidden_ver(local, name) hidden_ver (local, name)
+# define libdl_hidden_data_def(name) hidden_data_def (name)
+# define libdl_hidden_data_weak(name) hidden_data_weak (name)
+# define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libdl_hidden_proto(name, attrs...)
+# define libdl_hidden_def(name)
+# define libdl_hidden_weak(name)
+# define libdl_hidden_ver(local, name)
+# define libdl_hidden_data_def(name)
+# define libdl_hidden_data_weak(name)
+# define libdl_hidden_data_ver(local, name)
+#endif
 
 
-/* #include <sys/ioctl.h> */
+#if defined NOT_IN_libc && defined IS_IN_libintl
-extern int __ioctl (int __fd, unsigned long int __request, ...) attribute_hidden;
+# define libintl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libintl_hidden_def(name) hidden_def (name)
+# define libintl_hidden_weak(name) hidden_weak (name)
+# define libintl_hidden_ver(local, name) hidden_ver (local, name)
+# define libintl_hidden_data_def(name) hidden_data_def (name)
+# define libintl_hidden_data_weak(name) hidden_data_weak (name)
+# define libintl_hidden_data_ver(local, name) hidden_data_ver(local, name)
+#else
+# define libintl_hidden_proto(name, attrs...)
+# define libintl_hidden_def(name)
+# define libintl_hidden_weak(name)
+# define libintl_hidden_ver(local, name)
+# define libintl_hidden_data_def(name)
+# define libintl_hidden_data_weak(name)
+# define libintl_hidden_data_ver(local, name)
+#endif
 
 
-/* #include <sys/socket.h> */
+#if defined NOT_IN_libc && defined IS_IN_libnsl
-extern int __socket (int __domain, int __type, int __protocol) attribute_hidden;
+# define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libnsl_hidden_def(name) hidden_def (name)
+# define libnsl_hidden_weak(name) hidden_weak (name)
+# define libnsl_hidden_ver(local, name) hidden_ver (local, name)
+# define libnsl_hidden_data_def(name) hidden_data_def (name)
+# define libnsl_hidden_data_weak(name) hidden_data_weak (name)
+# define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libnsl_hidden_proto(name, attrs...)
+# define libnsl_hidden_def(name)
+# define libnsl_hidden_weak(name)
+# define libnsl_hidden_ver(local, name)
+# define libnsl_hidden_data_def(name)
+# define libnsl_hidden_data_weak(name)
+# define libnsl_hidden_data_ver(local, name)
+#endif
 
 
-/* #include <sys/stat.h> */
+#if defined NOT_IN_libc && defined IS_IN_libutil
-#ifndef __USE_FILE_OFFSET64
+# define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
-struct stat;
+# define libutil_hidden_def(name) hidden_def (name)
-extern int __stat (__const char *__restrict __file,
+# define libutil_hidden_weak(name) hidden_weak (name)
-		 struct stat *__restrict __buf) __THROW __nonnull ((1, 2)) attribute_hidden;
+# define libutil_hidden_ver(local, name) hidden_ver (local, name)
-extern int __fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)) attribute_hidden;
+# define libutil_hidden_data_def(name) hidden_data_def (name)
-extern int __lstat (__const char *__restrict __file,
+# define libutil_hidden_data_weak(name) hidden_data_weak (name)
-		  struct stat *__restrict __buf) __THROW __nonnull ((1, 2)) attribute_hidden;
+# define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
 #else
 #else
-# ifdef __REDIRECT_NTH
+# define libutil_hidden_proto(name, attrs...)
-extern int __REDIRECT_NTH (__stat, (__const char *__restrict __file,
+# define libutil_hidden_def(name)
-				  struct stat *__restrict __buf), __stat64)
+# define libutil_hidden_weak(name)
-     __nonnull ((1, 2)) attribute_hidden;
+# define libutil_hidden_ver(local, name)
-extern int __REDIRECT_NTH (__fstat, (int __fd, struct stat *__buf), __fstat64)
+# define libutil_hidden_data_def(name)
-     __nonnull ((2)) attribute_hidden;
+# define libutil_hidden_data_weak(name)
-extern int __REDIRECT_NTH (__lstat,
+# define libutil_hidden_data_ver(local, name)
-			   (__const char *__restrict __file,
-			    struct stat *__restrict __buf), __lstat64)
-     __nonnull ((1, 2)) attribute_hidden;
-# else
-#  define __stat __stat64
-#  define __fstat __fstat64
-#   define __lstat __lstat64
-# endif
 #endif
 #endif
-#ifdef __USE_LARGEFILE64
+
-struct stat64;
+#if defined NOT_IN_libc && defined IS_IN_libcrypt
-extern int __stat64 (__const char *__restrict __file,
+# define libcrypt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
-		   struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)) attribute_hidden;
+# define libcrypt_hidden_def(name) hidden_def (name)
-extern int __fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)) attribute_hidden;
+# define libcrypt_hidden_weak(name) hidden_weak (name)
-extern int __lstat64 (__const char *__restrict __file,
+# define libcrypt_hidden_ver(local, name) hidden_ver (local, name)
-		    struct stat64 *__restrict __buf)
+# define libcrypt_hidden_data_def(name) hidden_data_def (name)
-     __THROW __nonnull ((1, 2)) attribute_hidden;
+# define libcrypt_hidden_data_weak(name) hidden_data_weak (name)
+# define libcrypt_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libcrypt_hidden_proto(name, attrs...)
+# define libcrypt_hidden_def(name)
+# define libcrypt_hidden_weak(name)
+# define libcrypt_hidden_ver(local, name)
+# define libcrypt_hidden_data_def(name)
+# define libcrypt_hidden_data_weak(name)
+# define libcrypt_hidden_data_ver(local, name)
 #endif
 #endif
 
 
-/* #include <sys/statfs.h> */
+#if defined NOT_IN_libc && defined IS_IN_libpthread
-#ifndef __USE_FILE_OFFSET64
+# define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
-struct statfs;
+# define libpthread_hidden_def(name) hidden_def (name)
-extern int __statfs (__const char *__file, struct statfs *__buf)
+# define libpthread_hidden_weak(name) hidden_weak (name)
-     __THROW __nonnull ((1, 2)) attribute_hidden;
+# define libpthread_hidden_ver(local, name) hidden_ver (local, name)
-extern int __fstatfs (int __fildes, struct statfs *__buf)
+# define libpthread_hidden_data_def(name) hidden_data_def (name)
-     __THROW __nonnull ((2)) attribute_hidden;
+# define libpthread_hidden_data_weak(name) hidden_data_weak (name)
+# define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
 #else
 #else
-# ifdef __REDIRECT
+# define libpthread_hidden_proto(name, attrs...)
-extern int __REDIRECT (__statfs,
+# define libpthread_hidden_def(name)
-			   (__const char *__file, struct statfs *__buf),
+# define libpthread_hidden_weak(name)
-			   __statfs64) __nonnull ((1, 2)) attribute_hidden;
+# define libpthread_hidden_ver(local, name)
-extern int __REDIRECT (__fstatfs, (int __fildes, struct statfs *__buf),
+# define libpthread_hidden_data_def(name)
-			   __fstatfs64) __nonnull ((2)) attribute_hidden;
+# define libpthread_hidden_data_weak(name)
-# else
+# define libpthread_hidden_data_ver(local, name)
-#  define __statfs __statfs64
-# endif
 #endif
 #endif
-#ifdef __USE_LARGEFILE64
+
-struct statfs64;
+#ifdef __UCLIBC_BUILD_RELRO__
-extern int __statfs64 (__const char *__file, struct statfs64 *__buf)
+# define attribute_relro __attribute__ ((section (".data.rel.ro")))
-     __THROW __nonnull ((1, 2)) attribute_hidden;
+#else
-extern int __fstatfs64 (int __fildes, struct statfs64 *__buf)
+# define attribute_relro
-     __THROW __nonnull ((2)) attribute_hidden;
 #endif
 #endif
 
 
-#  if 0 /* undoable here */
+#ifdef __GNUC__
-/* #include <dirent.h> */
+# define attribute_noreturn __attribute__ ((__noreturn__))
-typedef struct __dirstream DIR;
-extern DIR *__opendir (__const char *__name) attribute_hidden;
-extern int __closedir (DIR *__dirp) attribute_hidden;
-
-/* #include <stdio.h> */
-extern int __vfprintf (FILE *__restrict __s, __const char *__restrict __format,
-		     __gnuc_va_list __arg) attribute_hidden;
-extern int __fprintf (FILE *__restrict __stream,
-		    __const char *__restrict __format, ...) attribute_hidden;
-extern int __fclose (FILE *__stream) attribute_hidden;
-
-#ifndef __USE_FILE_OFFSET64
-extern FILE *__fopen (__const char *__restrict __filename,
-		    __const char *__restrict __modes) attribute_hidden;
 #else
 #else
-# ifdef __REDIRECT
+# define attribute_noreturn
-extern FILE *__REDIRECT (__fopen, (__const char *__restrict __filename,
-				 __const char *__restrict __modes), __fopen64) attribute_hidden;
-# else
-#  define __fopen __fopen64
-# endif
 #endif
 #endif
-#ifdef __USE_LARGEFILE64
+
-extern FILE *__fopen64 (__const char *__restrict __filename,
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-		      __const char *__restrict __modes) attribute_hidden;
+# define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec")))
 #endif
 #endif
 
 
-/* #include <sys/time.h> */
+/* Pull in things like __attribute_used__ */
-#   define __need_timeval
+#include <sys/cdefs.h>
-#   include <bits/time.h>
+
-extern int __gettimeofday(struct timeval *__restrict __tv, *__restrict __timezone__ptr_t __tz) attribute_hidden;
+/* --- this is added to integrate linuxthreads */
-#  endif
+#define __USE_UNIX98            1
+
+#ifndef __ASSEMBLER__
+# ifdef IS_IN_libc
+
+#  define __need_size_t
+#  include <stddef.h>
+
+/* sources are built w/ _GNU_SOURCE, this gets undefined */
+extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen);
+//extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen);
 
 
 /* #include <pthread.h> */
 /* #include <pthread.h> */
 #  ifndef __UCLIBC_HAS_THREADS__
 #  ifndef __UCLIBC_HAS_THREADS__

+ 27 - 18
libc/inet/addr.c

@@ -42,7 +42,7 @@
  * leading 0   -> octal
  * leading 0   -> octal
  * all else    -> decimal
  * all else    -> decimal
  */
  */
-int attribute_hidden __inet_aton(const char *cp, struct in_addr *addrptr)
+int inet_aton(const char *cp, struct in_addr *addrptr)
 {
 {
 	in_addr_t addr;
 	in_addr_t addr;
 	int value;
 	int value;
@@ -88,29 +88,32 @@ int attribute_hidden __inet_aton(const char *cp, struct in_addr *addrptr)
 
 
 	return 1;
 	return 1;
 }
 }
-strong_alias(__inet_aton,inet_aton)
+libc_hidden_proto(inet_aton)
+libc_hidden_def(inet_aton)
 #endif
 #endif
 
 
 #ifdef L_inet_addr
 #ifdef L_inet_addr
-extern int __inet_aton (__const char *__cp, struct in_addr *__inp) __THROW attribute_hidden;
+#include <arpa/inet.h>
+libc_hidden_proto(inet_aton)
 
 
-in_addr_t attribute_hidden __inet_addr(const char *cp)
+in_addr_t inet_addr(const char *cp)
 {
 {
 	struct in_addr a;
 	struct in_addr a;
 
 
-	if (!__inet_aton(cp, &a))
+	if (!inet_aton(cp, &a))
 		return INADDR_NONE;
 		return INADDR_NONE;
 	else
 	else
 		return a.s_addr;
 		return a.s_addr;
 }
 }
-strong_alias(__inet_addr,inet_addr)
+libc_hidden_proto(inet_addr)
+libc_hidden_def(inet_addr)
 #endif
 #endif
 
 
 #ifdef L_inet_ntoa
 #ifdef L_inet_ntoa
 
 
 #define INET_NTOA_MAX_LEN	16	/* max 12 digits + 3 '.'s + 1 nul */
 #define INET_NTOA_MAX_LEN	16	/* max 12 digits + 3 '.'s + 1 nul */
 
 
-char attribute_hidden *__inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN])
+char *inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN])
 {
 {
 	in_addr_t addr = ntohl(in.s_addr);
 	in_addr_t addr = ntohl(in.s_addr);
 	int i;
 	int i;
@@ -129,22 +132,28 @@ char attribute_hidden *__inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_L
 
 
 	return p+1;
 	return p+1;
 }
 }
-strong_alias(__inet_ntoa_r,inet_ntoa_r)
+libc_hidden_proto(inet_ntoa_r)
+libc_hidden_def(inet_ntoa_r)
 
 
-char attribute_hidden *__inet_ntoa(struct in_addr in)
+char *inet_ntoa(struct in_addr in)
 {
 {
 	static char buf[INET_NTOA_MAX_LEN];
 	static char buf[INET_NTOA_MAX_LEN];
-	return(__inet_ntoa_r(in, buf));
+	return(inet_ntoa_r(in, buf));
 }
 }
-strong_alias(__inet_ntoa,inet_ntoa)
+libc_hidden_proto(inet_ntoa)
+libc_hidden_def(inet_ntoa)
 #endif
 #endif
 
 
 #ifdef L_inet_makeaddr
 #ifdef L_inet_makeaddr
+
+/* for some reason it does not remove the jump relocation */
+libc_hidden_proto(memmove)
+
 /*
 /*
  * Formulate an Internet address from network + host.  Used in
  * Formulate an Internet address from network + host.  Used in
  * building addresses stored in the ifnet structure.
  * building addresses stored in the ifnet structure.
  */
  */
-struct in_addr attribute_hidden __inet_makeaddr(in_addr_t net, in_addr_t host)
+struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host)
 {
 {
 	in_addr_t addr;
 	in_addr_t addr;
 
 
@@ -159,8 +168,8 @@ struct in_addr attribute_hidden __inet_makeaddr(in_addr_t net, in_addr_t host)
 	addr = htonl(addr);
 	addr = htonl(addr);
 	return (*(struct in_addr *)&addr);
 	return (*(struct in_addr *)&addr);
 }
 }
-strong_alias(__inet_makeaddr,inet_makeaddr)
+libc_hidden_proto(inet_makeaddr)
-
+libc_hidden_def(inet_makeaddr)
 #endif
 #endif
 
 
 #ifdef L_inet_lnaof
 #ifdef L_inet_lnaof
@@ -188,8 +197,8 @@ in_addr_t inet_lnaof(struct in_addr in)
  * Return the network number from an internet
  * Return the network number from an internet
  * address; handles class a/b/c network #'s.
  * address; handles class a/b/c network #'s.
  */
  */
-in_addr_t attribute_hidden
+in_addr_t
-__inet_netof(struct in_addr in)
+inet_netof(struct in_addr in)
 {
 {
 	in_addr_t i = ntohl(in.s_addr);
 	in_addr_t i = ntohl(in.s_addr);
 
 
@@ -200,6 +209,6 @@ __inet_netof(struct in_addr in)
 	else
 	else
 	return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
 	return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
 }
 }
-strong_alias(__inet_netof,inet_netof)
+libc_hidden_proto(inet_netof)
-
+libc_hidden_def(inet_netof)
 #endif
 #endif

+ 11 - 8
libc/inet/ether_addr.c

@@ -23,7 +23,6 @@
  * 	- initial uClibc port
  * 	- initial uClibc port
  */
  */
 
 
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <ctype.h>
 #include <ctype.h>
@@ -32,7 +31,11 @@
 #include <netinet/ether.h>
 #include <netinet/ether.h>
 #include <netinet/if_ether.h>
 #include <netinet/if_ether.h>
 
 
-struct ether_addr attribute_hidden *__ether_aton_r(const char *asc, struct ether_addr *addr)
+libc_hidden_proto(ether_aton_r)
+libc_hidden_proto(ether_ntoa_r)
+libc_hidden_proto(sprintf)
+
+struct ether_addr *ether_aton_r(const char *asc, struct ether_addr *addr)
 {
 {
 	size_t cnt;
 	size_t cnt;
 
 
@@ -68,28 +71,28 @@ struct ether_addr attribute_hidden *__ether_aton_r(const char *asc, struct ether
 
 
 	return addr;
 	return addr;
 }
 }
-strong_alias(__ether_aton_r,ether_aton_r)
+libc_hidden_def(ether_aton_r)
 
 
 struct ether_addr *ether_aton(const char *asc)
 struct ether_addr *ether_aton(const char *asc)
 {
 {
 	static struct ether_addr result;
 	static struct ether_addr result;
 
 
-	return __ether_aton_r(asc, &result);
+	return ether_aton_r(asc, &result);
 }
 }
 
 
-char attribute_hidden *__ether_ntoa_r(const struct ether_addr *addr, char *buf)
+char *ether_ntoa_r(const struct ether_addr *addr, char *buf)
 {
 {
-	__sprintf(buf, "%x:%x:%x:%x:%x:%x",
+	sprintf(buf, "%x:%x:%x:%x:%x:%x",
 			addr->ether_addr_octet[0], addr->ether_addr_octet[1],
 			addr->ether_addr_octet[0], addr->ether_addr_octet[1],
 			addr->ether_addr_octet[2], addr->ether_addr_octet[3],
 			addr->ether_addr_octet[2], addr->ether_addr_octet[3],
 			addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
 			addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
 	return buf;
 	return buf;
 }
 }
-strong_alias(__ether_ntoa_r,ether_ntoa_r)
+libc_hidden_def(ether_ntoa_r)
 
 
 char *ether_ntoa(const struct ether_addr *addr)
 char *ether_ntoa(const struct ether_addr *addr)
 {
 {
 	static char asc[18];
 	static char asc[18];
 
 
-	return __ether_ntoa_r(addr, asc);
+	return ether_ntoa_r(addr, asc);
 }
 }

+ 63 - 51
libc/inet/getaddrinfo.c

@@ -1,3 +1,10 @@
+/*
+ * Copyright 1996 by Craig Metz 
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
 /* $USAGI: getaddrinfo.c,v 1.16 2001/10/04 09:52:03 sekiya Exp $ */
 /* $USAGI: getaddrinfo.c,v 1.16 2001/10/04 09:52:03 sekiya Exp $ */
 
 
 /* The Inner Net License, Version 2.00
 /* The Inner Net License, Version 2.00
@@ -42,24 +49,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
   If these license terms cause you a real problem, contact the author.  */
   If these license terms cause you a real problem, contact the author.  */
 
 
-/* This software is Copyright 1996 by Craig Metz, All Rights Reserved.  */
-
-#define getservbyname_r __getservbyname_r
-#define gethostbyname_r __gethostbyname_r
-#define gethostbyname2_r __gethostbyname2_r
-#define gethostbyaddr_r __gethostbyaddr_r
-#define inet_pton __inet_pton
-#define inet_ntop __inet_ntop
-#define strtoul __strtoul
-#define if_nametoindex __if_nametoindex
-#if 0
-#define uname __uname
-#define stpcpy __stpcpy
-/* strdupa is using these */
-#define memcpy __memcpy
-#define strlen __strlen
-#endif
-
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
@@ -79,6 +68,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <sys/utsname.h>
 #include <sys/utsname.h>
 #include <net/if.h>
 #include <net/if.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+/* libc_hidden_proto(strcmp) */
+/* libc_hidden_proto(stpcpy) */
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strlen)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(getservbyname_r)
+libc_hidden_proto(gethostbyname_r)
+libc_hidden_proto(gethostbyname2_r)
+libc_hidden_proto(gethostbyaddr_r)
+libc_hidden_proto(inet_pton)
+libc_hidden_proto(inet_ntop)
+libc_hidden_proto(strtoul)
+libc_hidden_proto(if_nametoindex)
+/* libc_hidden_proto(uname) */
+#ifdef __UCLIBC_HAS_IPV6__
+libc_hidden_proto(in6addr_loopback)
+#endif
+
 /* The following declarations and definitions have been removed from
 /* The following declarations and definitions have been removed from
  *    the public header since we don't want people to use them.  */
  *    the public header since we don't want people to use them.  */
 #define AI_V4MAPPED     0x0008  /* IPv4-mapped addresses are acceptable.  */
 #define AI_V4MAPPED     0x0008  /* IPv4-mapped addresses are acceptable.  */
@@ -160,12 +171,12 @@ static int addrconfig (sa_family_t af)
     int s;
     int s;
     int ret;
     int ret;
     int saved_errno = errno;
     int saved_errno = errno;
-    s = __socket(af, SOCK_DGRAM, 0);
+    s = socket(af, SOCK_DGRAM, 0);
     if (s < 0)
     if (s < 0)
 	ret = (errno == EMFILE) ? 1 : 0;
 	ret = (errno == EMFILE) ? 1 : 0;
     else
     else
     {
     {
-	__close(s);
+	close(s);
 	ret = 1;
 	ret = 1;
     }
     }
     __set_errno (saved_errno);
     __set_errno (saved_errno);
@@ -189,10 +200,10 @@ gaih_local (const char *name, const struct gaih_service *service,
 
 
     if (name != NULL)
     if (name != NULL)
     {
     {
-	if (__strcmp(name, "localhost") &&
+	if (strcmp(name, "localhost") &&
-	    __strcmp(name, "local") &&
+	    strcmp(name, "local") &&
-	    __strcmp(name, "unix") &&
+	    strcmp(name, "unix") &&
-	    __strcmp(name, utsname.nodename))
+	    strcmp(name, utsname.nodename))
 	    return GAIH_OKIFUNSPEC | -EAI_NONAME;
 	    return GAIH_OKIFUNSPEC | -EAI_NONAME;
     }
     }
 
 
@@ -219,7 +230,7 @@ gaih_local (const char *name, const struct gaih_service *service,
 
 
     *pai = malloc (sizeof (struct addrinfo) + sizeof (struct sockaddr_un)
     *pai = malloc (sizeof (struct addrinfo) + sizeof (struct sockaddr_un)
 		   + ((req->ai_flags & AI_CANONNAME)
 		   + ((req->ai_flags & AI_CANONNAME)
-		      ? (__strlen(utsname.nodename) + 1): 0));
+		      ? (strlen(utsname.nodename) + 1): 0));
     if (*pai == NULL)
     if (*pai == NULL)
 	return -EAI_MEMORY;
 	return -EAI_MEMORY;
 
 
@@ -237,22 +248,22 @@ gaih_local (const char *name, const struct gaih_service *service,
 #endif /* SALEN */
 #endif /* SALEN */
 
 
     ((struct sockaddr_un *)(*pai)->ai_addr)->sun_family = AF_LOCAL;
     ((struct sockaddr_un *)(*pai)->ai_addr)->sun_family = AF_LOCAL;
-    __memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX);
+    memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX);
 
 
     if (service)
     if (service)
     {
     {
 	struct sockaddr_un *sunp = (struct sockaddr_un *) (*pai)->ai_addr;
 	struct sockaddr_un *sunp = (struct sockaddr_un *) (*pai)->ai_addr;
 
 
-	if (__strchr (service->name, '/') != NULL)
+	if (strchr (service->name, '/') != NULL)
 	{
 	{
-	    if (__strlen (service->name) >= sizeof (sunp->sun_path))
+	    if (strlen (service->name) >= sizeof (sunp->sun_path))
 		return GAIH_OKIFUNSPEC | -EAI_SERVICE;
 		return GAIH_OKIFUNSPEC | -EAI_SERVICE;
 
 
-	    __strcpy (sunp->sun_path, service->name);
+	    strcpy (sunp->sun_path, service->name);
 	}
 	}
 	else
 	else
 	{
 	{
-	    if (__strlen (P_tmpdir "/") + 1 + __strlen (service->name) >=
+	    if (strlen (P_tmpdir "/") + 1 + strlen (service->name) >=
 		sizeof (sunp->sun_path))
 		sizeof (sunp->sun_path))
 		return GAIH_OKIFUNSPEC | -EAI_SERVICE;
 		return GAIH_OKIFUNSPEC | -EAI_SERVICE;
 
 
@@ -274,7 +285,7 @@ gaih_local (const char *name, const struct gaih_service *service,
     }
     }
 
 
     if (req->ai_flags & AI_CANONNAME)
     if (req->ai_flags & AI_CANONNAME)
-	(*pai)->ai_canonname = __strcpy ((char *) *pai + sizeof (struct addrinfo)
+	(*pai)->ai_canonname = strcpy ((char *) *pai + sizeof (struct addrinfo)
 				       + sizeof (struct sockaddr_un),
 				       + sizeof (struct sockaddr_un),
 				       utsname.nodename);
 				       utsname.nodename);
     else
     else
@@ -354,7 +365,7 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
 	    }								\
 	    }								\
 	    (*pat)->next = NULL;					\
 	    (*pat)->next = NULL;					\
 		(*pat)->family = _family;				\
 		(*pat)->family = _family;				\
-		__memcpy ((*pat)->addr, h->h_addr_list[i],		\
+		memcpy ((*pat)->addr, h->h_addr_list[i],		\
 			sizeof(_type));					\
 			sizeof(_type));					\
 		pat = &((*pat)->next);					\
 		pat = &((*pat)->next);					\
 	}								\
 	}								\
@@ -505,7 +516,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	    char *namebuf = strdupa (name);
 	    char *namebuf = strdupa (name);
 	    char *scope_delim;
 	    char *scope_delim;
 
 
-	    scope_delim = __strchr (namebuf, SCOPE_DELIMITER);
+	    scope_delim = strchr (namebuf, SCOPE_DELIMITER);
 	    if (scope_delim != NULL)
 	    if (scope_delim != NULL)
 		*scope_delim = '\0';
 		*scope_delim = '\0';
 
 
@@ -588,21 +599,20 @@ gaih_inet (const char *name, const struct gaih_service *service,
     {
     {
 	struct gaih_addrtuple *atr;
 	struct gaih_addrtuple *atr;
 	atr = at = alloca (sizeof (struct gaih_addrtuple));
 	atr = at = alloca (sizeof (struct gaih_addrtuple));
-	__memset (at, '\0', sizeof (struct gaih_addrtuple));
+	memset (at, '\0', sizeof (struct gaih_addrtuple));
 
 
 	if (req->ai_family == 0)
 	if (req->ai_family == 0)
 	{
 	{
 	    at->next = alloca (sizeof (struct gaih_addrtuple));
 	    at->next = alloca (sizeof (struct gaih_addrtuple));
-	    __memset (at->next, '\0', sizeof (struct gaih_addrtuple));
+	    memset (at->next, '\0', sizeof (struct gaih_addrtuple));
 	}
 	}
 
 
 #if __UCLIBC_HAS_IPV6__
 #if __UCLIBC_HAS_IPV6__
 	if (req->ai_family == 0 || req->ai_family == AF_INET6)
 	if (req->ai_family == 0 || req->ai_family == AF_INET6)
 	{
 	{
-	    extern const struct in6_addr __in6addr_loopback attribute_hidden;
 	    at->family = AF_INET6;
 	    at->family = AF_INET6;
 	    if ((req->ai_flags & AI_PASSIVE) == 0)
 	    if ((req->ai_flags & AI_PASSIVE) == 0)
-		__memcpy (at->addr, &__in6addr_loopback, sizeof (struct in6_addr));
+		memcpy (at->addr, &in6addr_loopback, sizeof (struct in6_addr));
 	    atr = at->next;
 	    atr = at->next;
 	}
 	}
 #endif
 #endif
@@ -674,7 +684,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		if (c == NULL)
 		if (c == NULL)
 		    return GAIH_OKIFUNSPEC | -EAI_NONAME;
 		    return GAIH_OKIFUNSPEC | -EAI_NONAME;
 
 
-		namelen = __strlen (c) + 1;
+		namelen = strlen (c) + 1;
 	    }
 	    }
 	    else
 	    else
 		namelen = 0;
 		namelen = 0;
@@ -718,7 +728,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    sin6p->sin6_flowinfo = 0;
 		    sin6p->sin6_flowinfo = 0;
 		    if (at2->family == AF_INET6)
 		    if (at2->family == AF_INET6)
 		    {
 		    {
-			__memcpy (&sin6p->sin6_addr,
+			memcpy (&sin6p->sin6_addr,
 				at2->addr, sizeof (struct in6_addr));
 				at2->addr, sizeof (struct in6_addr));
 		    }
 		    }
 		    else
 		    else
@@ -726,7 +736,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 			sin6p->sin6_addr.s6_addr32[0] = 0;
 			sin6p->sin6_addr.s6_addr32[0] = 0;
 			sin6p->sin6_addr.s6_addr32[1] = 0;
 			sin6p->sin6_addr.s6_addr32[1] = 0;
 			sin6p->sin6_addr.s6_addr32[2] = htonl(0x0000ffff);
 			sin6p->sin6_addr.s6_addr32[2] = htonl(0x0000ffff);
-			__memcpy(&sin6p->sin6_addr.s6_addr32[3], 
+			memcpy(&sin6p->sin6_addr.s6_addr32[3], 
 			       at2->addr, sizeof (sin6p->sin6_addr.s6_addr32[3]));
 			       at2->addr, sizeof (sin6p->sin6_addr.s6_addr32[3]));
 		    }
 		    }
 		    sin6p->sin6_port = st2->port;
 		    sin6p->sin6_port = st2->port;
@@ -738,17 +748,17 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    struct sockaddr_in *sinp =
 		    struct sockaddr_in *sinp =
 			(struct sockaddr_in *) (*pai)->ai_addr;
 			(struct sockaddr_in *) (*pai)->ai_addr;
 
 
-		    __memcpy (&sinp->sin_addr,
+		    memcpy (&sinp->sin_addr,
 			    at2->addr, sizeof (struct in_addr));
 			    at2->addr, sizeof (struct in_addr));
 		    sinp->sin_port = st2->port;
 		    sinp->sin_port = st2->port;
-		    __memset (sinp->sin_zero, '\0', sizeof (sinp->sin_zero));
+		    memset (sinp->sin_zero, '\0', sizeof (sinp->sin_zero));
 		}
 		}
 
 
 		if (c)
 		if (c)
 		{
 		{
 		    (*pai)->ai_canonname = ((void *) (*pai) +
 		    (*pai)->ai_canonname = ((void *) (*pai) +
 					    sizeof (struct addrinfo) + socklen);
 					    sizeof (struct addrinfo) + socklen);
-		    __strcpy ((*pai)->ai_canonname, c);
+		    strcpy ((*pai)->ai_canonname, c);
 		}
 		}
 		else
 		else
 		    (*pai)->ai_canonname = NULL;
 		    (*pai)->ai_canonname = NULL;
@@ -775,8 +785,8 @@ static struct gaih gaih[] =
     { PF_UNSPEC, NULL }
     { PF_UNSPEC, NULL }
 };
 };
 
 
-void attribute_hidden
+void
-__freeaddrinfo (struct addrinfo *ai)
+freeaddrinfo (struct addrinfo *ai)
 {
 {
     struct addrinfo *p;
     struct addrinfo *p;
 
 
@@ -787,10 +797,11 @@ __freeaddrinfo (struct addrinfo *ai)
 	free (p);
 	free (p);
     }
     }
 }
 }
-strong_alias(__freeaddrinfo,freeaddrinfo)
+libc_hidden_proto(freeaddrinfo)
+libc_hidden_def(freeaddrinfo)
 
 
-int attribute_hidden
+int
-__getaddrinfo (const char *name, const char *service,
+getaddrinfo (const char *name, const char *service,
 	     const struct addrinfo *hints, struct addrinfo **pai)
 	     const struct addrinfo *hints, struct addrinfo **pai)
 {
 {
     int i = 0, j = 0, last_i = 0;
     int i = 0, j = 0, last_i = 0;
@@ -860,7 +871,7 @@ __getaddrinfo (const char *name, const char *service,
 			continue;
 			continue;
 
 
 		    if (p)
 		    if (p)
-			__freeaddrinfo (p);
+			freeaddrinfo (p);
 
 
 		    return -(i & GAIH_EAI);
 		    return -(i & GAIH_EAI);
 		}
 		}
@@ -884,8 +895,9 @@ __getaddrinfo (const char *name, const char *service,
 	return 0;
 	return 0;
 
 
     if (p)
     if (p)
-	__freeaddrinfo (p);
+	freeaddrinfo (p);
 
 
     return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME;
     return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME;
 }
 }
-strong_alias(__getaddrinfo,getaddrinfo)
+libc_hidden_proto(getaddrinfo)
+libc_hidden_def(getaddrinfo)

+ 4 - 4
libc/inet/getnetbyad.c

@@ -15,14 +15,14 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
  */
 
 
-#define setnetent __setnetent
-#define getnetent __getnetent
-#define endnetent __endnetent
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <netdb.h>
 #include <netdb.h>
 
 
+libc_hidden_proto(setnetent)
+libc_hidden_proto(getnetent)
+libc_hidden_proto(endnetent)
+
 extern int _net_stayopen attribute_hidden;
 extern int _net_stayopen attribute_hidden;
 
 
 struct netent *getnetbyaddr (uint32_t net, int type)
 struct netent *getnetbyaddr (uint32_t net, int type)

+ 7 - 6
libc/inet/getnetbynm.c

@@ -15,15 +15,16 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
  */
 
 
-#define setnetent __setnetent
-#define getnetent __getnetent
-#define endnetent __endnetent
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <netdb.h>
 #include <netdb.h>
 #include <string.h>
 #include <string.h>
 
 
+libc_hidden_proto(strcmp)
+libc_hidden_proto(setnetent)
+libc_hidden_proto(getnetent)
+libc_hidden_proto(endnetent)
+
 extern int _net_stayopen attribute_hidden;
 extern int _net_stayopen attribute_hidden;
 
 
 struct netent *
 struct netent *
@@ -34,10 +35,10 @@ getnetbyname(const char *name)
 
 
 	setnetent(_net_stayopen);
 	setnetent(_net_stayopen);
 	while ((p = getnetent())) {
 	while ((p = getnetent())) {
-		if (__strcmp(p->n_name, name) == 0)
+		if (strcmp(p->n_name, name) == 0)
 			break;
 			break;
 		for (cp = p->n_aliases; *cp != 0; cp++)
 		for (cp = p->n_aliases; *cp != 0; cp++)
-			if (__strcmp(*cp, name) == 0)
+			if (strcmp(*cp, name) == 0)
 				goto found;
 				goto found;
 	}
 	}
 found:
 found:

+ 15 - 10
libc/inet/getnetent.c

@@ -15,10 +15,6 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
  */
 
 
-#define inet_network __inet_network
-#define rewind __rewind
-#define fgets __fgets
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -26,6 +22,12 @@
 #include <netdb.h>
 #include <netdb.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 
 
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(inet_network)
+libc_hidden_proto(rewind)
+libc_hidden_proto(fgets)
+libc_hidden_proto(abort)
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 # include <pthread.h>
 # include <pthread.h>
@@ -45,7 +47,7 @@ static char *net_aliases[MAXALIASES];
 
 
 int _net_stayopen attribute_hidden;
 int _net_stayopen attribute_hidden;
 
 
-void attribute_hidden __setnetent(int f)
+void setnetent(int f)
 {
 {
     LOCK;
     LOCK;
     if (netf == NULL)
     if (netf == NULL)
@@ -56,9 +58,10 @@ void attribute_hidden __setnetent(int f)
     UNLOCK;
     UNLOCK;
     return;
     return;
 }
 }
-strong_alias(__setnetent,setnetent)
+libc_hidden_proto(setnetent)
+libc_hidden_def(setnetent)
 
 
-void attribute_hidden __endnetent(void)
+void endnetent(void)
 {
 {
     LOCK;
     LOCK;
     if (netf) {
     if (netf) {
@@ -68,7 +71,8 @@ void attribute_hidden __endnetent(void)
     _net_stayopen = 0;
     _net_stayopen = 0;
     UNLOCK;
     UNLOCK;
 }
 }
-strong_alias(__endnetent,endnetent)
+libc_hidden_proto(endnetent)
+libc_hidden_def(endnetent)
 
 
 static char * any(register char *cp, char *match)
 static char * any(register char *cp, char *match)
 {
 {
@@ -83,7 +87,7 @@ static char * any(register char *cp, char *match)
     return ((char *)0);
     return ((char *)0);
 }
 }
 
 
-struct netent attribute_hidden * __getnetent(void)
+struct netent *getnetent(void)
 {
 {
     char *p;
     char *p;
     register char *cp, **q;
     register char *cp, **q;
@@ -142,4 +146,5 @@ again:
     UNLOCK;
     UNLOCK;
     return (&net);
     return (&net);
 }
 }
-strong_alias(__getnetent,getnetent)
+libc_hidden_proto(getnetent)
+libc_hidden_def(getnetent)

+ 34 - 26
libc/inet/getproto.c

@@ -51,11 +51,6 @@
 ** SUCH DAMAGE.
 ** SUCH DAMAGE.
 */
 */
 
 
-#define strpbrk __strpbrk
-#define atoi __atoi
-#define rewind __rewind
-#define fgets __fgets
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -67,6 +62,14 @@
 #include <string.h>
 #include <string.h>
 #include <errno.h>
 #include <errno.h>
 
 
+libc_hidden_proto(fopen)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strpbrk)
+libc_hidden_proto(atoi)
+libc_hidden_proto(rewind)
+libc_hidden_proto(fgets)
+libc_hidden_proto(fclose)
+libc_hidden_proto(abort)
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 # include <pthread.h>
 # include <pthread.h>
@@ -94,7 +97,7 @@ static void __initbuf(void)
     }
     }
 }
 }
 
 
-void attribute_hidden __setprotoent(int f)
+void setprotoent(int f)
 {
 {
     LOCK;
     LOCK;
     if (protof == NULL)
     if (protof == NULL)
@@ -104,9 +107,10 @@ void attribute_hidden __setprotoent(int f)
     proto_stayopen |= f;
     proto_stayopen |= f;
     UNLOCK;
     UNLOCK;
 }
 }
-strong_alias(__setprotoent,setprotoent)
+libc_hidden_proto(setprotoent)
+libc_hidden_def(setprotoent)
 
 
-void attribute_hidden __endprotoent(void)
+void endprotoent(void)
 {
 {
     LOCK;
     LOCK;
     if (protof) {
     if (protof) {
@@ -116,9 +120,10 @@ void attribute_hidden __endprotoent(void)
     proto_stayopen = 0;
     proto_stayopen = 0;
     UNLOCK;
     UNLOCK;
 }
 }
-strong_alias(__endprotoent,endprotoent)
+libc_hidden_proto(endprotoent)
+libc_hidden_def(endprotoent)
 
 
-int attribute_hidden __getprotoent_r(struct protoent *result_buf,
+int getprotoent_r(struct protoent *result_buf,
 		  char *buf, size_t buflen,
 		  char *buf, size_t buflen,
 		  struct protoent **result)
 		  struct protoent **result)
 {
 {
@@ -194,19 +199,20 @@ again:
     UNLOCK;
     UNLOCK;
     return 0;
     return 0;
 }
 }
-strong_alias(__getprotoent_r,getprotoent_r)
+libc_hidden_proto(getprotoent_r)
+libc_hidden_def(getprotoent_r)
 
 
 struct protoent * getprotoent(void)
 struct protoent * getprotoent(void)
 {
 {
     struct protoent *result;
     struct protoent *result;
 
 
     __initbuf();
     __initbuf();
-    __getprotoent_r(&proto, static_aliases, SBUFSIZE, &result);
+    getprotoent_r(&proto, static_aliases, SBUFSIZE, &result);
     return result;
     return result;
 }
 }
 
 
 
 
-int attribute_hidden __getprotobyname_r(const char *name,
+int getprotobyname_r(const char *name,
 		    struct protoent *result_buf,
 		    struct protoent *result_buf,
 		    char *buf, size_t buflen,
 		    char *buf, size_t buflen,
 		    struct protoent **result)
 		    struct protoent **result)
@@ -215,21 +221,22 @@ int attribute_hidden __getprotobyname_r(const char *name,
     int ret;
     int ret;
 
 
     LOCK;
     LOCK;
-    __setprotoent(proto_stayopen);
+    setprotoent(proto_stayopen);
-    while (!(ret=__getprotoent_r(result_buf, buf, buflen, result))) {
+    while (!(ret=getprotoent_r(result_buf, buf, buflen, result))) {
-	if (__strcmp(result_buf->p_name, name) == 0)
+	if (strcmp(result_buf->p_name, name) == 0)
 	    break;
 	    break;
 	for (cp = result_buf->p_aliases; *cp != 0; cp++)
 	for (cp = result_buf->p_aliases; *cp != 0; cp++)
-	    if (__strcmp(*cp, name) == 0)
+	    if (strcmp(*cp, name) == 0)
 		goto found;
 		goto found;
     }
     }
 found:
 found:
     if (!proto_stayopen)
     if (!proto_stayopen)
-	__endprotoent();
+	endprotoent();
     UNLOCK;
     UNLOCK;
     return *result?0:ret;
     return *result?0:ret;
 }
 }
-strong_alias(__getprotobyname_r,getprotobyname_r)
+libc_hidden_proto(getprotobyname_r)
+libc_hidden_def(getprotobyname_r)
 
 
 
 
 struct protoent * getprotobyname(const char *name)
 struct protoent * getprotobyname(const char *name)
@@ -237,12 +244,12 @@ struct protoent * getprotobyname(const char *name)
     struct protoent *result;
     struct protoent *result;
 
 
     __initbuf();
     __initbuf();
-    __getprotobyname_r(name, &proto, static_aliases, SBUFSIZE, &result);
+    getprotobyname_r(name, &proto, static_aliases, SBUFSIZE, &result);
     return result;
     return result;
 }
 }
 
 
 
 
-int attribute_hidden __getprotobynumber_r (int proto_num,
+int getprotobynumber_r (int proto_num,
 			struct protoent *result_buf,
 			struct protoent *result_buf,
 			char *buf, size_t buflen,
 			char *buf, size_t buflen,
 			struct protoent **result)
 			struct protoent **result)
@@ -250,23 +257,24 @@ int attribute_hidden __getprotobynumber_r (int proto_num,
     int ret;
     int ret;
 
 
     LOCK;
     LOCK;
-    __setprotoent(proto_stayopen);
+    setprotoent(proto_stayopen);
-    while (!(ret=__getprotoent_r(result_buf, buf, buflen, result)))
+    while (!(ret=getprotoent_r(result_buf, buf, buflen, result)))
 	if (result_buf->p_proto == proto_num)
 	if (result_buf->p_proto == proto_num)
 	    break;
 	    break;
     if (!proto_stayopen)
     if (!proto_stayopen)
-	__endprotoent();
+	endprotoent();
     UNLOCK;
     UNLOCK;
     return *result?0:ret;
     return *result?0:ret;
 }
 }
-strong_alias(__getprotobynumber_r,getprotobynumber_r)
+libc_hidden_proto(getprotobynumber_r)
+libc_hidden_def(getprotobynumber_r)
 
 
 struct protoent * getprotobynumber(int proto_num)
 struct protoent * getprotobynumber(int proto_num)
 {
 {
     struct protoent *result;
     struct protoent *result;
 
 
     __initbuf();
     __initbuf();
-    __getprotobynumber_r(proto_num, &proto, static_aliases,
+    getprotobynumber_r(proto_num, &proto, static_aliases,
                        SBUFSIZE, &result);
                        SBUFSIZE, &result);
     return result;
     return result;
 }
 }

+ 39 - 30
libc/inet/getservice.c

@@ -51,11 +51,6 @@
 ** SUCH DAMAGE.
 ** SUCH DAMAGE.
 */
 */
 
 
-#define strpbrk __strpbrk
-#define atoi __atoi
-#define rewind __rewind
-#define fgets __fgets
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -69,6 +64,14 @@
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 #include <errno.h>
 #include <errno.h>
 
 
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strpbrk)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(atoi)
+libc_hidden_proto(rewind)
+libc_hidden_proto(fgets)
+libc_hidden_proto(abort)
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 # include <pthread.h>
 # include <pthread.h>
@@ -97,7 +100,7 @@ static void __initbuf(void)
     }
     }
 }
 }
 
 
-extern void attribute_hidden __setservent(int f)
+void setservent(int f)
 {
 {
     LOCK;
     LOCK;
     if (servf == NULL)
     if (servf == NULL)
@@ -107,9 +110,10 @@ extern void attribute_hidden __setservent(int f)
     serv_stayopen |= f;
     serv_stayopen |= f;
     UNLOCK;
     UNLOCK;
 }
 }
-strong_alias(__setservent,setservent)
+libc_hidden_proto(setservent)
+libc_hidden_def(setservent)
 
 
-extern void attribute_hidden __endservent(void)
+void endservent(void)
 {
 {
     LOCK;
     LOCK;
     if (servf) {
     if (servf) {
@@ -119,9 +123,10 @@ extern void attribute_hidden __endservent(void)
     serv_stayopen = 0;
     serv_stayopen = 0;
     UNLOCK;
     UNLOCK;
 }
 }
-strong_alias(__endservent,endservent)
+libc_hidden_proto(endservent)
+libc_hidden_def(endservent)
 
 
-extern int attribute_hidden __getservent_r(struct servent * result_buf,
+int getservent_r(struct servent * result_buf,
 		 char * buf, size_t buflen,
 		 char * buf, size_t buflen,
 		 struct servent ** result)
 		 struct servent ** result)
 {
 {
@@ -200,18 +205,19 @@ again:
     UNLOCK;
     UNLOCK;
     return 0;
     return 0;
 }
 }
-strong_alias(__getservent_r,getservent_r)
+libc_hidden_proto(getservent_r)
+libc_hidden_def(getservent_r)
 
 
 struct servent * getservent(void)
 struct servent * getservent(void)
 {
 {
     struct servent *result;
     struct servent *result;
 
 
     __initbuf();
     __initbuf();
-    __getservent_r(&serv, servbuf, SBUFSIZE, &result);
+    getservent_r(&serv, servbuf, SBUFSIZE, &result);
     return result;
     return result;
 }
 }
 
 
-extern int attribute_hidden __getservbyname_r(const char *name, const char *proto,
+int getservbyname_r(const char *name, const char *proto,
 	struct servent * result_buf, char * buf, size_t buflen,
 	struct servent * result_buf, char * buf, size_t buflen,
 	struct servent ** result)
 	struct servent ** result)
 {
 {
@@ -219,62 +225,65 @@ extern int attribute_hidden __getservbyname_r(const char *name, const char *prot
     int ret;
     int ret;
 
 
     LOCK;
     LOCK;
-    __setservent(serv_stayopen);
+    setservent(serv_stayopen);
-    while (!(ret=__getservent_r(result_buf, buf, buflen, result))) {
+    while (!(ret=getservent_r(result_buf, buf, buflen, result))) {
-	if (__strcmp(name, result_buf->s_name) == 0)
+	if (strcmp(name, result_buf->s_name) == 0)
 	    goto gotname;
 	    goto gotname;
 	for (cp = result_buf->s_aliases; *cp; cp++)
 	for (cp = result_buf->s_aliases; *cp; cp++)
-	    if (__strcmp(name, *cp) == 0)
+	    if (strcmp(name, *cp) == 0)
 		goto gotname;
 		goto gotname;
 	continue;
 	continue;
 gotname:
 gotname:
-	if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0)
+	if (proto == 0 || strcmp(result_buf->s_proto, proto) == 0)
 	    break;
 	    break;
     }
     }
     if (!serv_stayopen)
     if (!serv_stayopen)
-	__endservent();
+	endservent();
     UNLOCK;
     UNLOCK;
     return *result?0:ret;
     return *result?0:ret;
 }
 }
-strong_alias(__getservbyname_r,getservbyname_r)
+libc_hidden_proto(getservbyname_r)
+libc_hidden_def(getservbyname_r)
 
 
 struct servent *getservbyname(const char *name, const char *proto)
 struct servent *getservbyname(const char *name, const char *proto)
 {
 {
     struct servent *result;
     struct servent *result;
 
 
     __initbuf();
     __initbuf();
-    __getservbyname_r(name, proto, &serv, servbuf, SBUFSIZE, &result);
+    getservbyname_r(name, proto, &serv, servbuf, SBUFSIZE, &result);
     return result;
     return result;
 }
 }
 
 
 
 
-extern int attribute_hidden __getservbyport_r(int port, const char *proto,
+int getservbyport_r(int port, const char *proto,
 	struct servent * result_buf, char * buf,
 	struct servent * result_buf, char * buf,
 	size_t buflen, struct servent ** result)
 	size_t buflen, struct servent ** result)
 {
 {
     int ret;
     int ret;
 
 
     LOCK;
     LOCK;
-    __setservent(serv_stayopen);
+    setservent(serv_stayopen);
-    while (!(ret=__getservent_r(result_buf, buf, buflen, result))) {
+    while (!(ret=getservent_r(result_buf, buf, buflen, result))) {
 	if (result_buf->s_port != port)
 	if (result_buf->s_port != port)
 	    continue;
 	    continue;
-	if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0)
+	if (proto == 0 || strcmp(result_buf->s_proto, proto) == 0)
 	    break;
 	    break;
     }
     }
     if (!serv_stayopen)
     if (!serv_stayopen)
-	__endservent();
+	endservent();
     UNLOCK;
     UNLOCK;
     return *result?0:ret;
     return *result?0:ret;
 }
 }
-strong_alias(__getservbyport_r,getservbyport_r)
+libc_hidden_proto(getservbyport_r)
+libc_hidden_def(getservbyport_r)
 
 
-struct servent attribute_hidden * __getservbyport(int port, const char *proto)
+struct servent * getservbyport(int port, const char *proto)
 {
 {
     struct servent *result;
     struct servent *result;
 
 
     __initbuf();
     __initbuf();
-    __getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result);
+    getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result);
     return result;
     return result;
 }
 }
-strong_alias(__getservbyport,getservbyport)
+libc_hidden_proto(getservbyport)
+libc_hidden_def(getservbyport)

+ 5 - 2
libc/inet/herror.c

@@ -23,6 +23,8 @@
 #include <string.h>
 #include <string.h>
 #include <netdb.h>
 #include <netdb.h>
 
 
+libc_hidden_proto(fprintf)
+
 static const char *error_msg = "Resolver error";
 static const char *error_msg = "Resolver error";
 static const char *const h_errlist[] = {
 static const char *const h_errlist[] = {
 	"Error 0",
 	"Error 0",
@@ -36,7 +38,7 @@ static const int h_nerr = { sizeof(h_errlist)/sizeof(h_errlist[0]) };
 /*
 /*
  * herror -- print the error indicated by the h_errno value.
  * herror -- print the error indicated by the h_errno value.
  */
  */
-void attribute_hidden __herror(const char *s)
+void herror(const char *s)
 {
 {
 	static const char colon_space[] = ": ";
 	static const char colon_space[] = ": ";
 	const char *p;
 	const char *p;
@@ -52,7 +54,8 @@ void attribute_hidden __herror(const char *s)
 	}
 	}
 	fprintf(stderr, "%s%s%s\n", s, c, p);
 	fprintf(stderr, "%s%s%s\n", s, c, p);
 }
 }
-strong_alias(__herror,herror)
+libc_hidden_proto(herror)
+libc_hidden_def(herror)
 
 
 
 
 const char *hstrerror(int err)
 const char *hstrerror(int err)

+ 21 - 11
libc/inet/hostid.c

@@ -1,7 +1,8 @@
-#define geteuid __geteuid
+/*
-#define getuid __getuid
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-#define gethostbyname __gethostbyname
+ *
-#define gethostname __gethostname
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
@@ -14,6 +15,15 @@
 #include <fcntl.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <unistd.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(open)
+libc_hidden_proto(close)
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(getuid)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(gethostbyname)
+libc_hidden_proto(gethostname)
 
 
 #define HOSTID "/etc/hostid"
 #define HOSTID "/etc/hostid"
 
 
@@ -23,10 +33,10 @@ int sethostid(long int new_id)
 	int ret;
 	int ret;
 
 
 	if (geteuid() || getuid()) return __set_errno(EPERM);
 	if (geteuid() || getuid()) return __set_errno(EPERM);
-	if ((fd=__open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1;
+	if ((fd=open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1;
-	ret = __write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id)
+	ret = write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id)
 		? 0 : -1;
 		? 0 : -1;
-	__close (fd);
+	close (fd);
 	return ret;
 	return ret;
 }
 }
 
 
@@ -39,12 +49,12 @@ long int gethostid(void)
 	 * It is not an error if we cannot read this file. It is not even an
 	 * It is not an error if we cannot read this file. It is not even an
 	 * error if we cannot read all the bytes, we just carry on trying...
 	 * error if we cannot read all the bytes, we just carry on trying...
 	 */
 	 */
-	if ((fd=__open(HOSTID,O_RDONLY))>=0 && __read(fd,(void *)&id,sizeof(id)))
+	if ((fd=open(HOSTID,O_RDONLY))>=0 && read(fd,(void *)&id,sizeof(id)))
 	{
 	{
-		__close (fd);
+		close (fd);
 		return id;
 		return id;
 	}
 	}
-	if (fd >= 0) __close (fd);
+	if (fd >= 0) close (fd);
 
 
 	/* Try some methods of returning a unique 32 bit id. Clearly IP
 	/* Try some methods of returning a unique 32 bit id. Clearly IP
 	 * numbers, if on the internet, will have a unique address. If they
 	 * numbers, if on the internet, will have a unique address. If they
@@ -70,7 +80,7 @@ long int gethostid(void)
 		 */
 		 */
 			return 0;
 			return 0;
 		else {
 		else {
-			__memcpy((char *) &in, (char *) hp->h_addr, hp->h_length);
+			memcpy((char *) &in, (char *) hp->h_addr, hp->h_length);
 
 
 			/* Just so it doesn't look exactly like the IP addr */
 			/* Just so it doesn't look exactly like the IP addr */
 			return(in.s_addr<<16|in.s_addr>>16);
 			return(in.s_addr<<16|in.s_addr>>16);

+ 32 - 25
libc/inet/if_index.c

@@ -20,8 +20,6 @@
    Reworked Dec 2002 by Erik Andersen <andersen@codepoet.org>
    Reworked Dec 2002 by Erik Andersen <andersen@codepoet.org>
  */
  */
 
 
-#define strndup __strndup
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #define __USE_GNU
 #define __USE_GNU
@@ -38,6 +36,12 @@
 
 
 #include "netlinkaccess.h"
 #include "netlinkaccess.h"
 
 
+libc_hidden_proto(strndup)
+libc_hidden_proto(strncpy)
+libc_hidden_proto(strdup)
+libc_hidden_proto(ioctl)
+libc_hidden_proto(close)
+
 extern int __opensock(void) attribute_hidden;
 extern int __opensock(void) attribute_hidden;
 
 
 unsigned int
 unsigned int
@@ -53,21 +57,22 @@ if_nametoindex(const char* ifname)
   if (fd < 0)
   if (fd < 0)
     return 0;
     return 0;
 
 
-  __strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+  strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
-  if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+  if (ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
     {
     {
       int saved_errno = errno;
       int saved_errno = errno;
-      __close(fd);
+      close(fd);
       if (saved_errno == EINVAL)
       if (saved_errno == EINVAL)
 	__set_errno(ENOSYS);
 	__set_errno(ENOSYS);
       return 0;
       return 0;
     }
     }
 
 
-  __close(fd);
+  close(fd);
   return ifr.ifr_ifindex;
   return ifr.ifr_ifindex;
 #endif
 #endif
 }
 }
-hidden_strong_alias(if_nametoindex,__if_nametoindex)
+libc_hidden_proto(if_nametoindex)
+libc_hidden_def(if_nametoindex)
 
 
 void
 void
 if_freenameindex (struct if_nameindex *ifn)
 if_freenameindex (struct if_nameindex *ifn)
@@ -80,7 +85,8 @@ if_freenameindex (struct if_nameindex *ifn)
     }
     }
   free (ifn);
   free (ifn);
 }
 }
-hidden_strong_alias(if_freenameindex,__if_freenameindex)
+libc_hidden_proto(if_freenameindex)
+libc_hidden_def(if_freenameindex)
 
 
 #if !__ASSUME_NETLINK_SUPPORT
 #if !__ASSUME_NETLINK_SUPPORT
 struct if_nameindex *
 struct if_nameindex *
@@ -112,9 +118,9 @@ if_nameindex (void)
       ifc.ifc_buf = extend_alloca (ifc.ifc_buf, rq_len, 2 * rq_len);
       ifc.ifc_buf = extend_alloca (ifc.ifc_buf, rq_len, 2 * rq_len);
       ifc.ifc_len = rq_len;
       ifc.ifc_len = rq_len;
 
 
-      if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0)
+      if (ioctl (fd, SIOCGIFCONF, &ifc) < 0)
 	{
 	{
-	  __close (fd);
+	  close (fd);
 	  return NULL;
 	  return NULL;
 	}
 	}
     }
     }
@@ -125,7 +131,7 @@ if_nameindex (void)
   idx = malloc ((nifs + 1) * sizeof (struct if_nameindex));
   idx = malloc ((nifs + 1) * sizeof (struct if_nameindex));
   if (idx == NULL)
   if (idx == NULL)
     {
     {
-      __close(fd);
+      close(fd);
       __set_errno(ENOBUFS);
       __set_errno(ENOBUFS);
       return NULL;
       return NULL;
     }
     }
@@ -133,9 +139,9 @@ if_nameindex (void)
   for (i = 0; i < nifs; ++i)
   for (i = 0; i < nifs; ++i)
     {
     {
       struct ifreq *ifr = &ifc.ifc_req[i];
       struct ifreq *ifr = &ifc.ifc_req[i];
-      idx[i].if_name = __strdup (ifr->ifr_name);
+      idx[i].if_name = strdup (ifr->ifr_name);
       if (idx[i].if_name == NULL
       if (idx[i].if_name == NULL
-	  || __ioctl (fd, SIOCGIFINDEX, ifr) < 0)
+	  || ioctl (fd, SIOCGIFINDEX, ifr) < 0)
 	{
 	{
 	  int saved_errno = errno;
 	  int saved_errno = errno;
 	  unsigned int j;
 	  unsigned int j;
@@ -143,7 +149,7 @@ if_nameindex (void)
 	  for (j =  0; j < i; ++j)
 	  for (j =  0; j < i; ++j)
 	    free (idx[j].if_name);
 	    free (idx[j].if_name);
 	  free(idx);
 	  free(idx);
-	  __close(fd);
+	  close(fd);
 	  if (saved_errno == EINVAL)
 	  if (saved_errno == EINVAL)
 	    saved_errno = ENOSYS;
 	    saved_errno = ENOSYS;
 	  else if (saved_errno == ENOMEM)
 	  else if (saved_errno == ENOMEM)
@@ -157,7 +163,7 @@ if_nameindex (void)
   idx[i].if_index = 0;
   idx[i].if_index = 0;
   idx[i].if_name = NULL;
   idx[i].if_name = NULL;
 
 
-  __close(fd);
+  close(fd);
   return idx;
   return idx;
 #endif
 #endif
 }
 }
@@ -248,11 +254,11 @@ if_nameindex (void)
 
 
 		  if (rta->rta_type == IFLA_IFNAME)
 		  if (rta->rta_type == IFLA_IFNAME)
 		    {
 		    {
-		      idx[nifs].if_name = __strndup (rta_data, rta_payload);
+		      idx[nifs].if_name = strndup (rta_data, rta_payload);
 		      if (idx[nifs].if_name == NULL)
 		      if (idx[nifs].if_name == NULL)
 			{
 			{
 			  idx[nifs].if_index = 0;
 			  idx[nifs].if_index = 0;
-			  __if_freenameindex (idx);
+			  if_freenameindex (idx);
 			  idx = NULL;
 			  idx = NULL;
 			  goto nomem;
 			  goto nomem;
 			}
 			}
@@ -277,7 +283,8 @@ if_nameindex (void)
   return idx;
   return idx;
 }
 }
 #endif
 #endif
-hidden_strong_alias(if_nameindex,__if_nameindex)
+libc_hidden_proto(if_nameindex)
+libc_hidden_def(if_nameindex)
 
 
 #if 0
 #if 0
 struct if_nameindex *
 struct if_nameindex *
@@ -305,36 +312,36 @@ if_indextoname (unsigned int ifindex, char *ifname)
     return NULL;
     return NULL;
 
 
   ifr.ifr_ifindex = ifindex;
   ifr.ifr_ifindex = ifindex;
-  if (__ioctl (fd, SIOCGIFNAME, &ifr) < 0)
+  if (ioctl (fd, SIOCGIFNAME, &ifr) < 0)
     {
     {
       int serrno = errno;
       int serrno = errno;
-      __close (fd);
+      close (fd);
       if (serrno == ENODEV)
       if (serrno == ENODEV)
 	/* POSIX requires ENXIO.  */
 	/* POSIX requires ENXIO.  */
 	serrno = ENXIO;
 	serrno = ENXIO;
       __set_errno (serrno);
       __set_errno (serrno);
       return NULL;
       return NULL;
   }
   }
-  __close (fd);
+  close (fd);
 
 
-  return __strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
+  return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
 # else
 # else
   struct if_nameindex *idx;
   struct if_nameindex *idx;
   struct if_nameindex *p;
   struct if_nameindex *p;
   char *result = NULL;
   char *result = NULL;
 
 
-  idx = __if_nameindex();
+  idx = if_nameindex();
 
 
   if (idx != NULL)
   if (idx != NULL)
     {
     {
       for (p = idx; p->if_index || p->if_name; ++p)
       for (p = idx; p->if_index || p->if_name; ++p)
 	if (p->if_index == ifindex)
 	if (p->if_index == ifindex)
 	  {
 	  {
-	    result = __strncpy (ifname, p->if_name, IFNAMSIZ);
+	    result = strncpy (ifname, p->if_name, IFNAMSIZ);
 	    break;
 	    break;
 	  }
 	  }
 
 
-      __if_freenameindex (idx);
+      if_freenameindex (idx);
 
 
       if (result == NULL)
       if (result == NULL)
 	__set_errno (ENXIO);
 	__set_errno (ENXIO);

+ 18 - 13
libc/inet/ifaddrs.c

@@ -17,13 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define time __time
-#define sendto __sendto
-#define recvmsg __recvmsg
-#define bind __bind
-#define mempcpy __mempcpy
-#define getsockname __getsockname
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #define __USE_GNU
 #define __USE_GNU
@@ -37,6 +30,7 @@
 #include <stdbool.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/socket.h>
@@ -46,6 +40,17 @@
 
 
 #include "netlinkaccess.h"
 #include "netlinkaccess.h"
 
 
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(time)
+libc_hidden_proto(sendto)
+libc_hidden_proto(recvmsg)
+libc_hidden_proto(bind)
+libc_hidden_proto(memset)
+libc_hidden_proto(mempcpy)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(fclose)
+libc_hidden_proto(abort)
 
 
 #ifndef __libc_use_alloca
 #ifndef __libc_use_alloca
 # define __libc_use_alloca(x) (x < __MAX_ALLOCA_CUTOFF)
 # define __libc_use_alloca(x) (x < __MAX_ALLOCA_CUTOFF)
@@ -116,7 +121,7 @@ __netlink_sendreq (struct netlink_handle *h, int type)
   memset (&nladdr, '\0', sizeof (nladdr));
   memset (&nladdr, '\0', sizeof (nladdr));
   nladdr.nl_family = AF_NETLINK;
   nladdr.nl_family = AF_NETLINK;
 
 
-  return TEMP_FAILURE_RETRY (__sendto (h->fd, (void *) &req, sizeof (req), 0,
+  return TEMP_FAILURE_RETRY (sendto (h->fd, (void *) &req, sizeof (req), 0,
 				       (struct sockaddr *) &nladdr,
 				       (struct sockaddr *) &nladdr,
 				       sizeof (nladdr)));
 				       sizeof (nladdr)));
 }
 }
@@ -167,7 +172,7 @@ __netlink_request (struct netlink_handle *h, int type)
 	  0
 	  0
 	};
 	};
 
 
-      read_len = TEMP_FAILURE_RETRY (__recvmsg (h->fd, &msg, 0));
+      read_len = TEMP_FAILURE_RETRY (recvmsg (h->fd, &msg, 0));
       if (read_len < 0)
       if (read_len < 0)
 	goto out_fail;
 	goto out_fail;
 
 
@@ -282,7 +287,7 @@ __netlink_close (struct netlink_handle *h)
 {
 {
   /* Don't modify errno.  */
   /* Don't modify errno.  */
   int serrno = errno;
   int serrno = errno;
-  __close(h->fd);
+  close(h->fd);
   __set_errno(serrno);
   __set_errno(serrno);
 }
 }
 
 
@@ -293,13 +298,13 @@ __netlink_open (struct netlink_handle *h)
 {
 {
   struct sockaddr_nl nladdr;
   struct sockaddr_nl nladdr;
 
 
-  h->fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+  h->fd = socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
   if (h->fd < 0)
   if (h->fd < 0)
     goto out;
     goto out;
 
 
   memset (&nladdr, '\0', sizeof (nladdr));
   memset (&nladdr, '\0', sizeof (nladdr));
   nladdr.nl_family = AF_NETLINK;
   nladdr.nl_family = AF_NETLINK;
-  if (__bind (h->fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) < 0)
+  if (bind (h->fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) < 0)
     {
     {
     close_and_out:
     close_and_out:
       __netlink_close (h);
       __netlink_close (h);
@@ -313,7 +318,7 @@ __netlink_open (struct netlink_handle *h)
      It is not necessarily the PID if there is more than one socket
      It is not necessarily the PID if there is more than one socket
      open.  */
      open.  */
   socklen_t addr_len = sizeof (nladdr);
   socklen_t addr_len = sizeof (nladdr);
-  if (__getsockname (h->fd, (struct sockaddr *) &nladdr, &addr_len) < 0)
+  if (getsockname (h->fd, (struct sockaddr *) &nladdr, &addr_len) < 0)
     goto close_and_out;
     goto close_and_out;
   h->pid = nladdr.nl_pid;
   h->pid = nladdr.nl_pid;
   return 0;
   return 0;

+ 4 - 2
libc/inet/in6_addr.c

@@ -24,10 +24,12 @@
 #ifdef __UCLIBC_HAS_IPV6__
 #ifdef __UCLIBC_HAS_IPV6__
 const struct in6_addr in6addr_any =
 const struct in6_addr in6addr_any =
 { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
 { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
-hidden_weak_alias (in6addr_any, __in6addr_any)
+//libc_hidden_proto(in6addr_any)
+//libc_hidden_def(in6addr_any)
 const struct in6_addr in6addr_loopback =
 const struct in6_addr in6addr_loopback =
 { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
 { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
-hidden_weak_alias(in6addr_loopback, __in6addr_loopback)
+libc_hidden_proto(in6addr_loopback)
+libc_hidden_def(in6addr_loopback)
 #endif /* __UCLIBC_HAS_IPV6__ */
 #endif /* __UCLIBC_HAS_IPV6__ */
 
 
 
 

+ 4 - 3
libc/inet/inet_net.c

@@ -42,8 +42,8 @@
  * The library routines call this routine to interpret
  * The library routines call this routine to interpret
  * network numbers.
  * network numbers.
  */
  */
-in_addr_t attribute_hidden
+in_addr_t
-__inet_network(const char *cp)
+inet_network(const char *cp)
 {
 {
 	register in_addr_t val, base, n;
 	register in_addr_t val, base, n;
 	register char c;
 	register char c;
@@ -98,4 +98,5 @@ again:
 	}
 	}
 	return (val);
 	return (val);
 }
 }
-strong_alias(__inet_network,inet_network)
+libc_hidden_proto(inet_network)
+libc_hidden_def(inet_network)

+ 22 - 15
libc/inet/ntop.c

@@ -30,6 +30,11 @@
 #include <string.h>
 #include <string.h>
 #include <ctype.h>
 #include <ctype.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strlen)
 
 
 /*
 /*
  * WARNING: Don't even consider trying to compile this on a system where
  * WARNING: Don't even consider trying to compile this on a system where
@@ -76,12 +81,12 @@ inet_ntop4(const u_char *src, char *dst, size_t size)
 	}
 	}
 	tmp[i - 1] = '\0';
 	tmp[i - 1] = '\0';
 
 
-	if (__strlen (tmp) > size) {
+	if (strlen (tmp) > size) {
 		__set_errno (ENOSPC);
 		__set_errno (ENOSPC);
 		return (NULL);
 		return (NULL);
 	}
 	}
 
 
-	return __strcpy(dst, tmp);
+	return strcpy(dst, tmp);
 }
 }
 
 
 
 
@@ -114,7 +119,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
 	 *	Copy the input (bytewise) array into a wordwise array.
 	 *	Copy the input (bytewise) array into a wordwise array.
 	 *	Find the longest run of 0x00's in src[] for :: shorthanding.
 	 *	Find the longest run of 0x00's in src[] for :: shorthanding.
 	 */
 	 */
-	__memset(words, '\0', sizeof words);
+	memset(words, '\0', sizeof words);
 	for (i = 0; i < 16; i += 2)
 	for (i = 0; i < 16; i += 2)
 		words[i / 2] = (src[i] << 8) | src[i + 1];
 		words[i / 2] = (src[i] << 8) | src[i + 1];
 	best.base = -1;
 	best.base = -1;
@@ -160,7 +165,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
 		    (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
 		    (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
 			if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
 			if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
 				return (NULL);
 				return (NULL);
-			tp += __strlen(tp);
+			tp += strlen(tp);
 			break;
 			break;
 		}
 		}
 		tp += __sprintf(tp, "%x", words[i]);
 		tp += __sprintf(tp, "%x", words[i]);
@@ -177,7 +182,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
 		__set_errno (ENOSPC);
 		__set_errno (ENOSPC);
 		return (NULL);
 		return (NULL);
 	}
 	}
-	return __strcpy(dst, tmp);
+	return strcpy(dst, tmp);
 }
 }
 #endif /* __UCLIBC_HAS_IPV6__ */
 #endif /* __UCLIBC_HAS_IPV6__ */
 
 
@@ -224,7 +229,7 @@ inet_pton4(const char *src, u_char *dst)
 	}
 	}
 	if (octets < 4)
 	if (octets < 4)
 		return (0);
 		return (0);
-	__memcpy(dst, tmp, 4);
+	memcpy(dst, tmp, 4);
 	return (1);
 	return (1);
 }
 }
 
 
@@ -261,7 +266,7 @@ inet_pton6(const char *src, u_char *dst)
 	u_int val;
 	u_int val;
 
 
 
 
-	tp = __memset(tmp, '\0', 16);
+	tp = memset(tmp, '\0', 16);
 	endp = tp + 16;
 	endp = tp + 16;
 	colonp = NULL;
 	colonp = NULL;
 	/* Leading :: requires some special handling. */
 	/* Leading :: requires some special handling. */
@@ -274,7 +279,7 @@ inet_pton6(const char *src, u_char *dst)
 	while ((ch = __tolower (*src++)) != '\0') {
 	while ((ch = __tolower (*src++)) != '\0') {
 		const char *pch;
 		const char *pch;
 
 
-		pch = __strchr(xdigits, ch);
+		pch = strchr(xdigits, ch);
 		if (pch != NULL) {
 		if (pch != NULL) {
 			val <<= 4;
 			val <<= 4;
 			val |= (pch - xdigits);
 			val |= (pch - xdigits);
@@ -333,7 +338,7 @@ inet_pton6(const char *src, u_char *dst)
 	}
 	}
 	if (tp != endp)
 	if (tp != endp)
 		return (0);
 		return (0);
-	__memcpy(dst, tmp, 16);
+	memcpy(dst, tmp, 16);
 	return (1);
 	return (1);
 }
 }
 
 
@@ -349,8 +354,8 @@ inet_pton6(const char *src, u_char *dst)
  * author:
  * author:
  *	Paul Vixie, 1996.
  *	Paul Vixie, 1996.
  */
  */
-const char attribute_hidden *
+const char *
-__inet_ntop(int af, const void *src, char *dst, socklen_t size)
+inet_ntop(int af, const void *src, char *dst, socklen_t size)
 {
 {
 	switch (af) {
 	switch (af) {
 	case AF_INET:
 	case AF_INET:
@@ -365,7 +370,8 @@ __inet_ntop(int af, const void *src, char *dst, socklen_t size)
 	}
 	}
 	/* NOTREACHED */
 	/* NOTREACHED */
 }
 }
-strong_alias(__inet_ntop,inet_ntop)
+libc_hidden_proto(inet_ntop)
+libc_hidden_def(inet_ntop)
 
 
 
 
 /* int
 /* int
@@ -379,8 +385,8 @@ strong_alias(__inet_ntop,inet_ntop)
  * author:
  * author:
  *	Paul Vixie, 1996.
  *	Paul Vixie, 1996.
  */
  */
-int attribute_hidden
+int
-__inet_pton(int af, const char *src, void *dst)
+inet_pton(int af, const char *src, void *dst)
 {
 {
 	switch (af) {
 	switch (af) {
 	case AF_INET:
 	case AF_INET:
@@ -395,4 +401,5 @@ __inet_pton(int af, const char *src, void *dst)
 	}
 	}
 	/* NOTREACHED */
 	/* NOTREACHED */
 }
 }
-strong_alias(__inet_pton,inet_pton)
+libc_hidden_proto(inet_pton)
+libc_hidden_def(inet_pton)

+ 4 - 2
libc/inet/opensock.c

@@ -25,6 +25,8 @@
 #include <features.h>
 #include <features.h>
 #include <libc-internal.h>
 #include <libc-internal.h>
 
 
+libc_hidden_proto(socket)
+
 /* Return a socket of any type.  The socket can be used in subsequent
 /* Return a socket of any type.  The socket can be used in subsequent
    ioctl calls to talk to the kernel.  */
    ioctl calls to talk to the kernel.  */
 int attribute_hidden
 int attribute_hidden
@@ -32,9 +34,9 @@ __opensock (void)
 {
 {
   int fd;
   int fd;
 #ifdef __UCLIBC_HAS_IPV6__
 #ifdef __UCLIBC_HAS_IPV6__
-  fd = __socket(AF_INET6, SOCK_DGRAM, 0);
+  fd = socket(AF_INET6, SOCK_DGRAM, 0);
   if (fd<0)
   if (fd<0)
 #endif /* __UCLIBC_HAS_IPV6__ */
 #endif /* __UCLIBC_HAS_IPV6__ */
-    fd = __socket(AF_INET, SOCK_DGRAM, 0);
+    fd = socket(AF_INET, SOCK_DGRAM, 0);
   return(fd);
   return(fd);
 }
 }

+ 152 - 163
libc/inet/resolv.c

@@ -133,24 +133,6 @@
  *
  *
  */
  */
 
 
-#define strnlen __strnlen
-#define strncat __strncat
-#define strstr __strstr
-#define random __random
-#define getservbyport __getservbyport
-#define getdomainname __getdomainname
-#define uname __uname
-#define inet_addr __inet_addr
-#define inet_aton __inet_aton
-#define inet_pton __inet_pton
-#define inet_ntop __inet_ntop
-#define connect __connect
-#define select __select
-#define recv __recv
-#define send __send
-#define snprintf __snprintf
-#define fgets __fgets
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <string.h>
 #include <string.h>
@@ -171,14 +153,53 @@
 #include <sys/utsname.h>
 #include <sys/utsname.h>
 #include <sys/un.h>
 #include <sys/un.h>
 
 
-extern int __gethostbyname_r (__const char *__restrict __name,
+libc_hidden_proto(memcpy)
-			    struct hostent *__restrict __result_buf,
+libc_hidden_proto(memset)
-			    char *__restrict __buf, size_t __buflen,
+libc_hidden_proto(memmove)
-			    struct hostent **__restrict __result,
+libc_hidden_proto(strchr)
-			    int *__restrict __h_errnop) attribute_hidden;
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strdup)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strncat)
+libc_hidden_proto(strncpy)
+/* libc_hidden_proto(strnlen) */
+libc_hidden_proto(strstr)
+libc_hidden_proto(strcasecmp)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(random)
+libc_hidden_proto(getservbyport)
+libc_hidden_proto(getdomainname)
+libc_hidden_proto(uname)
+libc_hidden_proto(inet_addr)
+libc_hidden_proto(inet_aton)
+libc_hidden_proto(inet_pton)
+libc_hidden_proto(inet_ntop)
+libc_hidden_proto(connect)
+libc_hidden_proto(select)
+libc_hidden_proto(recv)
+libc_hidden_proto(send)
+libc_hidden_proto(printf)
+libc_hidden_proto(sprintf)
+libc_hidden_proto(snprintf)
+libc_hidden_proto(fgets)
+libc_hidden_proto(gethostbyname)
+libc_hidden_proto(gethostbyname_r)
+libc_hidden_proto(gethostbyname2_r)
+libc_hidden_proto(gethostbyaddr)
+libc_hidden_proto(gethostbyaddr_r)
+libc_hidden_proto(ns_name_uncompress)
+libc_hidden_proto(ns_name_unpack)
+libc_hidden_proto(ns_name_ntop)
+libc_hidden_proto(res_init)
+libc_hidden_proto(res_query)
+libc_hidden_proto(res_querydomain)
+libc_hidden_proto(gethostent_r)
+libc_hidden_proto(fprintf)
 
 
-extern struct hostent *__gethostbyaddr (__const void *__addr, __socklen_t __len,
-				      int __type) attribute_hidden;
 #define MAX_RECURSE 5
 #define MAX_RECURSE 5
 #define REPLY_TIMEOUT 10
 #define REPLY_TIMEOUT 10
 #define MAX_RETRIES 3
 #define MAX_RETRIES 3
@@ -281,7 +302,7 @@ extern int __decode_header(unsigned char * data, struct resolv_header * h) attri
 extern int __encode_question(struct resolv_question * q,
 extern int __encode_question(struct resolv_question * q,
 	unsigned char * dest, int maxlen) attribute_hidden;
 	unsigned char * dest, int maxlen) attribute_hidden;
 extern int __decode_question(unsigned char * message, int offset,
 extern int __decode_question(unsigned char * message, int offset,
-	struct resolv_question * q);
+	struct resolv_question * q) attribute_hidden;
 extern int __encode_answer(struct resolv_answer * a,
 extern int __encode_answer(struct resolv_answer * a,
 	unsigned char * dest, int maxlen) attribute_hidden;
 	unsigned char * dest, int maxlen) attribute_hidden;
 extern int __decode_answer(unsigned char * message, int offset,
 extern int __decode_answer(unsigned char * message, int offset,
@@ -291,17 +312,6 @@ extern int __open_nameservers(void) attribute_hidden;
 extern void __close_nameservers(void) attribute_hidden;
 extern void __close_nameservers(void) attribute_hidden;
 extern int __dn_expand(const u_char *, const u_char *, const u_char *,
 extern int __dn_expand(const u_char *, const u_char *, const u_char *,
 	char *, int);
 	char *, int);
-extern int __ns_name_uncompress_internal(const u_char *, const u_char *,
-		const u_char *, char *, size_t) attribute_hidden;
-extern int __ns_name_ntop_internal(const u_char *, char *, size_t) attribute_hidden;
-extern int __ns_name_unpack_internal(const u_char *, const u_char *, const u_char *,
-               u_char *, size_t) attribute_hidden;
-
-
-extern int __gethostent_r (struct hostent *__restrict __result_buf,
-			 char *__restrict __buf, size_t __buflen,
-			 struct hostent **__restrict __result,
-			 int *__restrict __h_errnop) attribute_hidden;
 
 
 #ifdef L_encodeh
 #ifdef L_encodeh
 int attribute_hidden __encode_header(struct resolv_header *h, unsigned char *dest, int maxlen)
 int attribute_hidden __encode_header(struct resolv_header *h, unsigned char *dest, int maxlen)
@@ -360,14 +370,14 @@ int attribute_hidden __encode_dotted(const char *dotted, unsigned char *dest, in
 	int used = 0;
 	int used = 0;
 
 
 	while (dotted && *dotted) {
 	while (dotted && *dotted) {
-		char *c = __strchr(dotted, '.');
+		char *c = strchr(dotted, '.');
-		int l = c ? c - dotted : __strlen(dotted);
+		int l = c ? c - dotted : strlen(dotted);
 
 
 		if (l >= (maxlen - used - 1))
 		if (l >= (maxlen - used - 1))
 			return -1;
 			return -1;
 
 
 		dest[used++] = l;
 		dest[used++] = l;
-		__memcpy(dest + used, dotted, l);
+		memcpy(dest + used, dotted, l);
 		used += l;
 		used += l;
 
 
 		if (c)
 		if (c)
@@ -415,7 +425,7 @@ int attribute_hidden __decode_dotted(const unsigned char *data, int offset,
 		if ((used + l + 1) >= maxlen)
 		if ((used + l + 1) >= maxlen)
 			return -1;
 			return -1;
 
 
-		__memcpy(dest + used, data + offset, l);
+		memcpy(dest + used, data + offset, l);
 		offset += l;
 		offset += l;
 		used += l;
 		used += l;
 		if (measure)
 		if (measure)
@@ -439,7 +449,6 @@ int attribute_hidden __decode_dotted(const unsigned char *data, int offset,
 #endif
 #endif
 
 
 #ifdef L_lengthd
 #ifdef L_lengthd
-
 int attribute_hidden __length_dotted(const unsigned char *data, int offset)
 int attribute_hidden __length_dotted(const unsigned char *data, int offset)
 {
 {
 	int orig_offset = offset;
 	int orig_offset = offset;
@@ -488,7 +497,7 @@ int attribute_hidden __encode_question(struct resolv_question *q,
 #endif
 #endif
 
 
 #ifdef L_decodeq
 #ifdef L_decodeq
-int __decode_question(unsigned char *message, int offset,
+int attribute_hidden __decode_question(unsigned char *message, int offset,
 					struct resolv_question *q)
 					struct resolv_question *q)
 {
 {
 	char temp[256];
 	char temp[256];
@@ -500,7 +509,7 @@ int __decode_question(unsigned char *message, int offset,
 
 
 	offset += i;
 	offset += i;
 
 
-	q->dotted = __strdup(temp);
+	q->dotted = strdup(temp);
 	q->qtype = (message[offset + 0] << 8) | message[offset + 1];
 	q->qtype = (message[offset + 0] << 8) | message[offset + 1];
 	q->qclass = (message[offset + 2] << 8) | message[offset + 3];
 	q->qclass = (message[offset + 2] << 8) | message[offset + 3];
 
 
@@ -546,7 +555,7 @@ int attribute_hidden __encode_answer(struct resolv_answer *a, unsigned char *des
 	*dest++ = (a->ttl & 0x000000ff) >> 0;
 	*dest++ = (a->ttl & 0x000000ff) >> 0;
 	*dest++ = (a->rdlength & 0xff00) >> 8;
 	*dest++ = (a->rdlength & 0xff00) >> 8;
 	*dest++ = (a->rdlength & 0x00ff) >> 0;
 	*dest++ = (a->rdlength & 0x00ff) >> 0;
-	__memcpy(dest, a->rdata, a->rdlength);
+	memcpy(dest, a->rdata, a->rdlength);
 
 
 	return i + RRFIXEDSZ + a->rdlength;
 	return i + RRFIXEDSZ + a->rdlength;
 }
 }
@@ -565,7 +574,7 @@ int attribute_hidden __decode_answer(unsigned char *message, int offset,
 
 
 	message += offset + i;
 	message += offset + i;
 
 
-	a->dotted = __strdup(temp);
+	a->dotted = strdup(temp);
 	a->atype = (message[0] << 8) | message[1];
 	a->atype = (message[0] << 8) | message[1];
 	message += 2;
 	message += 2;
 	a->aclass = (message[0] << 8) | message[1];
 	a->aclass = (message[0] << 8) | message[1];
@@ -585,7 +594,7 @@ int attribute_hidden __decode_answer(unsigned char *message, int offset,
 #endif
 #endif
 
 
 #ifdef L_encodep
 #ifdef L_encodep
-int __encode_packet(struct resolv_header *h,
+int attribute_hidden __encode_packet(struct resolv_header *h,
 	struct resolv_question **q,
 	struct resolv_question **q,
 	struct resolv_answer **an,
 	struct resolv_answer **an,
 	struct resolv_answer **ns,
 	struct resolv_answer **ns,
@@ -642,7 +651,7 @@ int __encode_packet(struct resolv_header *h,
 #endif
 #endif
 
 
 #ifdef L_decodep
 #ifdef L_decodep
-int __decode_packet(unsigned char *data, struct resolv_header *h)
+int attribute_hidden __decode_packet(unsigned char *data, struct resolv_header *h)
 {
 {
 	return __decode_header(data, h);
 	return __decode_header(data, h);
 }
 }
@@ -656,7 +665,7 @@ int __form_query(int id, const char *name, int type, unsigned char *packet,
 	struct resolv_question q;
 	struct resolv_question q;
 	int i, j;
 	int i, j;
 
 
-	__memset(&h, 0, sizeof(h));
+	memset(&h, 0, sizeof(h));
 	h.id = id;
 	h.id = id;
 	h.qdcount = 1;
 	h.qdcount = 1;
 
 
@@ -729,11 +738,11 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
 
 
 	while (retries < MAX_RETRIES) {
 	while (retries < MAX_RETRIES) {
 		if (fd != -1)
 		if (fd != -1)
-			__close(fd);
+			close(fd);
 
 
-		__memset(packet, 0, PACKETSZ);
+		memset(packet, 0, PACKETSZ);
 
 
-		__memset(&h, 0, sizeof(h));
+		memset(&h, 0, sizeof(h));
 
 
 		++local_id;
 		++local_id;
 		local_id &= 0xffff;
 		local_id &= 0xffff;
@@ -749,7 +758,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
 		if (i < 0)
 		if (i < 0)
 			goto fail;
 			goto fail;
 
 
-		__strncpy(lookup,name,MAXDNAME);
+		strncpy(lookup,name,MAXDNAME);
 		if (variant >= 0) {
 		if (variant >= 0) {
                         BIGLOCK;
                         BIGLOCK;
                         if (variant < __searchdomains) {
                         if (variant < __searchdomains) {
@@ -774,9 +783,9 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
 
 
 #ifdef __UCLIBC_HAS_IPV6__
 #ifdef __UCLIBC_HAS_IPV6__
 		v6 = inet_pton(AF_INET6, dns, &sa6.sin6_addr) > 0;
 		v6 = inet_pton(AF_INET6, dns, &sa6.sin6_addr) > 0;
-		fd = __socket(v6 ? AF_INET6 : AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+		fd = socket(v6 ? AF_INET6 : AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 #else
 #else
-		fd = __socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+		fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 #endif
 #endif
 		if (fd < 0) {
 		if (fd < 0) {
                     retries++;
                     retries++;
@@ -880,7 +889,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
 			ma.buf = a->buf;
 			ma.buf = a->buf;
 			ma.buflen = a->buflen;
 			ma.buflen = a->buflen;
 			ma.add_count = a->add_count;
 			ma.add_count = a->add_count;
-			__memcpy(a, &ma, sizeof(ma));
+			memcpy(a, &ma, sizeof(ma));
 			if (a->atype != T_SIG && (0 == a->buf || (type != T_A && type != T_AAAA)))
 			if (a->atype != T_SIG && (0 == a->buf || (type != T_A && type != T_AAAA)))
 			{
 			{
 			    break;
 			    break;
@@ -912,7 +921,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
 				    ma.rdlength, a->rdlength);
 				    ma.rdlength, a->rdlength);
 			    goto again;
 			    goto again;
 			}
 			}
-			__memcpy(a->buf + (a->add_count * ma.rdlength), ma.rdata, ma.rdlength);
+			memcpy(a->buf + (a->add_count * ma.rdlength), ma.rdata, ma.rdlength);
 			++a->add_count;
 			++a->add_count;
 		    }
 		    }
 		}
 		}
@@ -920,7 +929,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
 		DPRINTF("Answer name = |%s|\n", a->dotted);
 		DPRINTF("Answer name = |%s|\n", a->dotted);
 		DPRINTF("Answer type = |%d|\n", a->atype);
 		DPRINTF("Answer type = |%d|\n", a->atype);
 
 
-		__close(fd);
+		close(fd);
 
 
 		if (outpacket)
 		if (outpacket)
 			*outpacket = packet;
 			*outpacket = packet;
@@ -972,7 +981,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
 
 
 fail:
 fail:
 	if (fd != -1)
 	if (fd != -1)
-	    __close(fd);
+	    close(fd);
 	if (lookup)
 	if (lookup)
 	    free(lookup);
 	    free(lookup);
 	if (packet)
 	if (packet)
@@ -1038,21 +1047,21 @@ int attribute_hidden __open_nameservers()
 					*p++ = '\0';
 					*p++ = '\0';
 			}
 			}
 
 
-			if (__strcmp(argv[0], "nameserver") == 0) {
+			if (strcmp(argv[0], "nameserver") == 0) {
 				for (i = 1; i < argc && __nameservers < MAX_SERVERS; i++) {
 				for (i = 1; i < argc && __nameservers < MAX_SERVERS; i++) {
-					__nameserver[__nameservers++] = __strdup(argv[i]);
+					__nameserver[__nameservers++] = strdup(argv[i]);
 					DPRINTF("adding nameserver %s\n", argv[i]);
 					DPRINTF("adding nameserver %s\n", argv[i]);
 				}
 				}
 			}
 			}
 
 
 			/* domain and search are mutually exclusive, the last one wins */
 			/* domain and search are mutually exclusive, the last one wins */
-			if (__strcmp(argv[0],"domain")==0 || __strcmp(argv[0],"search")==0) {
+			if (strcmp(argv[0],"domain")==0 || strcmp(argv[0],"search")==0) {
 				while (__searchdomains > 0) {
 				while (__searchdomains > 0) {
 					free(__searchdomain[--__searchdomains]);
 					free(__searchdomain[--__searchdomains]);
 					__searchdomain[__searchdomains] = NULL;
 					__searchdomain[__searchdomains] = NULL;
 				}
 				}
 				for (i=1; i < argc && __searchdomains < MAX_SEARCH; i++) {
 				for (i=1; i < argc && __searchdomains < MAX_SEARCH; i++) {
-					__searchdomain[__searchdomains++] = __strdup(argv[i]);
+					__searchdomain[__searchdomains++] = strdup(argv[i]);
 					DPRINTF("adding search %s\n", argv[i]);
 					DPRINTF("adding search %s\n", argv[i]);
 				}
 				}
 			}
 			}
@@ -1089,7 +1098,7 @@ void attribute_hidden __close_nameservers(void)
 
 
 #ifdef L_gethostbyname
 #ifdef L_gethostbyname
 
 
-struct hostent attribute_hidden *__gethostbyname(const char *name)
+struct hostent *gethostbyname(const char *name)
 {
 {
 	static struct hostent h;
 	static struct hostent h;
 	static char buf[sizeof(struct in_addr) +
 	static char buf[sizeof(struct in_addr) +
@@ -1097,29 +1106,19 @@ struct hostent attribute_hidden *__gethostbyname(const char *name)
 			sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */];
 			sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */];
 	struct hostent *hp;
 	struct hostent *hp;
 
 
-	__gethostbyname_r(name, &h, buf, sizeof(buf), &hp, &h_errno);
+	gethostbyname_r(name, &h, buf, sizeof(buf), &hp, &h_errno);
 
 
 	return hp;
 	return hp;
 }
 }
-strong_alias(__gethostbyname,gethostbyname)
+libc_hidden_def(gethostbyname)
 #endif
 #endif
 
 
 #ifdef L_gethostbyname2
 #ifdef L_gethostbyname2
 
 
-#ifndef __UCLIBC_HAS_IPV6__
-extern struct hostent *__gethostbyname (__const char *__name) attribute_hidden;
-#else
-extern int __gethostbyname2_r (__const char *__restrict __name, int __af,
-			     struct hostent *__restrict __result_buf,
-			     char *__restrict __buf, size_t __buflen,
-			     struct hostent **__restrict __result,
-			     int *__restrict __h_errnop) attribute_hidden;
-#endif
-
 struct hostent *gethostbyname2(const char *name, int family)
 struct hostent *gethostbyname2(const char *name, int family)
 {
 {
 #ifndef __UCLIBC_HAS_IPV6__
 #ifndef __UCLIBC_HAS_IPV6__
-	return family == AF_INET ? __gethostbyname(name) : (struct hostent*)0;
+	return family == AF_INET ? gethostbyname(name) : (struct hostent*)0;
 #else /* __UCLIBC_HAS_IPV6__ */
 #else /* __UCLIBC_HAS_IPV6__ */
 	static struct hostent h;
 	static struct hostent h;
 	static char buf[sizeof(struct in6_addr) +
 	static char buf[sizeof(struct in6_addr) +
@@ -1127,7 +1126,7 @@ struct hostent *gethostbyname2(const char *name, int family)
 			sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */];
 			sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */];
 	struct hostent *hp;
 	struct hostent *hp;
 
 
-	__gethostbyname2_r(name, family, &h, buf, sizeof(buf), &hp, &h_errno);
+	gethostbyname2_r(name, family, &h, buf, sizeof(buf), &hp, &h_errno);
 
 
 	return hp;
 	return hp;
 #endif /* __UCLIBC_HAS_IPV6__ */
 #endif /* __UCLIBC_HAS_IPV6__ */
@@ -1139,7 +1138,7 @@ struct hostent *gethostbyname2(const char *name, int family)
 #ifdef L_res_init
 #ifdef L_res_init
 struct __res_state _res;
 struct __res_state _res;
 
 
-int attribute_hidden __res_init_internal(void)
+int res_init(void)
 {
 {
 	struct __res_state *rp = &(_res);
 	struct __res_state *rp = &(_res);
 
 
@@ -1184,7 +1183,7 @@ int attribute_hidden __res_init_internal(void)
 
 
 	return(0);
 	return(0);
 }
 }
-strong_alias(__res_init_internal,res_init)
+libc_hidden_def(res_init)
 
 
 void res_close( void )
 void res_close( void )
 {
 {
@@ -1200,11 +1199,7 @@ void res_close( void )
 #define MIN(x, y)	((x) < (y) ? (x) : (y))
 #define MIN(x, y)	((x) < (y) ? (x) : (y))
 #endif
 #endif
 
 
-int		__res_init_internal (void) __THROW attribute_hidden;
+int res_query(const char *dname, int class, int type,
-int		__res_querydomain_internal (const char *, const char *, int, int,
-				 u_char *, int) __THROW attribute_hidden;
-
-int attribute_hidden __res_query_internal(const char *dname, int class, int type,
               unsigned char *answer, int anslen)
               unsigned char *answer, int anslen)
 {
 {
 	int i;
 	int i;
@@ -1219,7 +1214,7 @@ int attribute_hidden __res_query_internal(const char *dname, int class, int type
 		return(-1);
 		return(-1);
 	}
 	}
 
 
-	__memset((char *) &a, '\0', sizeof(a));
+	memset((char *) &a, '\0', sizeof(a));
 
 
 	BIGLOCK;
 	BIGLOCK;
 	__nameserversXX=__nameservers;
 	__nameserversXX=__nameservers;
@@ -1236,7 +1231,7 @@ int attribute_hidden __res_query_internal(const char *dname, int class, int type
 
 
 	if (a.atype == type) { /* CNAME*/
 	if (a.atype == type) { /* CNAME*/
 		int len = MIN(anslen, i);
 		int len = MIN(anslen, i);
-		__memcpy(answer, packet, len);
+		memcpy(answer, packet, len);
 		if (packet)
 		if (packet)
 			free(packet);
 			free(packet);
 		return(len);
 		return(len);
@@ -1245,7 +1240,7 @@ int attribute_hidden __res_query_internal(const char *dname, int class, int type
 		free(packet);
 		free(packet);
 	return i;
 	return i;
 }
 }
-strong_alias(__res_query_internal,res_query)
+libc_hidden_def(res_query)
 
 
 /*
 /*
  * Formulate a normal query, send, and retrieve answer in supplied buffer.
  * Formulate a normal query, send, and retrieve answer in supplied buffer.
@@ -1265,7 +1260,7 @@ int res_search(name, class, type, answer, anslen)
 	int trailing_dot, ret, saved_herrno;
 	int trailing_dot, ret, saved_herrno;
 	int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
 	int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
 
 
-	if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && __res_init_internal() == -1)) {
+	if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && res_init() == -1)) {
 		h_errno = NETDB_INTERNAL;
 		h_errno = NETDB_INTERNAL;
 		return (-1);
 		return (-1);
 	}
 	}
@@ -1285,7 +1280,7 @@ int res_search(name, class, type, answer, anslen)
 	 */
 	 */
 	saved_herrno = -1;
 	saved_herrno = -1;
 	if (dots >= _res.ndots) {
 	if (dots >= _res.ndots) {
-		ret = __res_querydomain_internal(name, NULL, class, type, answer, anslen);
+		ret = res_querydomain(name, NULL, class, type, answer, anslen);
 		if (ret > 0)
 		if (ret > 0)
 			return (ret);
 			return (ret);
 		saved_herrno = h_errno;
 		saved_herrno = h_errno;
@@ -1306,7 +1301,7 @@ int res_search(name, class, type, answer, anslen)
 		   *domain && !done;
 		   *domain && !done;
 		   domain++) {
 		   domain++) {
 
 
-			ret = __res_querydomain_internal(name, *domain, class, type,
+			ret = res_querydomain(name, *domain, class, type,
 			    answer, anslen);
 			    answer, anslen);
 			if (ret > 0)
 			if (ret > 0)
 				return (ret);
 				return (ret);
@@ -1362,7 +1357,7 @@ int res_search(name, class, type, answer, anslen)
 	 * name or whether it ends with a dot.
 	 * name or whether it ends with a dot.
 	 */
 	 */
 	if (!tried_as_is) {
 	if (!tried_as_is) {
-		ret = __res_querydomain_internal(name, NULL, class, type, answer, anslen);
+		ret = res_querydomain(name, NULL, class, type, answer, anslen);
 		if (ret > 0)
 		if (ret > 0)
 			return (ret);
 			return (ret);
 	}
 	}
@@ -1388,7 +1383,7 @@ int res_search(name, class, type, answer, anslen)
  * Perform a call on res_query on the concatenation of name and domain,
  * Perform a call on res_query on the concatenation of name and domain,
  * removing a trailing dot from name if domain is NULL.
  * removing a trailing dot from name if domain is NULL.
  */
  */
-int attribute_hidden __res_querydomain_internal(name, domain, class, type, answer, anslen)
+int res_querydomain(name, domain, class, type, answer, anslen)
 	const char *name, *domain;
 	const char *name, *domain;
 	int class, type;	/* class and type of query */
 	int class, type;	/* class and type of query */
 	u_char *answer;		/* buffer to put answer */
 	u_char *answer;		/* buffer to put answer */
@@ -1398,14 +1393,14 @@ int attribute_hidden __res_querydomain_internal(name, domain, class, type, answe
 	const char *longname = nbuf;
 	const char *longname = nbuf;
 	size_t n, d;
 	size_t n, d;
 
 
-	if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && __res_init_internal() == -1)) {
+	if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && res_init() == -1)) {
 		h_errno = NETDB_INTERNAL;
 		h_errno = NETDB_INTERNAL;
 		return (-1);
 		return (-1);
 	}
 	}
 
 
 #ifdef DEBUG
 #ifdef DEBUG
 	if (_res.options & RES_DEBUG)
 	if (_res.options & RES_DEBUG)
-		__printf(";; res_querydomain(%s, %s, %d, %d)\n",
+		printf(";; res_querydomain(%s, %s, %d, %d)\n",
 			name, domain?domain:"<Nil>", class, type);
 			name, domain?domain:"<Nil>", class, type);
 #endif
 #endif
 	if (domain == NULL) {
 	if (domain == NULL) {
@@ -1413,28 +1408,28 @@ int attribute_hidden __res_querydomain_internal(name, domain, class, type, answe
 		 * Check for trailing '.';
 		 * Check for trailing '.';
 		 * copy without '.' if present.
 		 * copy without '.' if present.
 		 */
 		 */
-		n = __strlen(name);
+		n = strlen(name);
 		if (n + 1 > sizeof(nbuf)) {
 		if (n + 1 > sizeof(nbuf)) {
 			h_errno = NO_RECOVERY;
 			h_errno = NO_RECOVERY;
 			return (-1);
 			return (-1);
 		}
 		}
 		if (n > 0 && name[--n] == '.') {
 		if (n > 0 && name[--n] == '.') {
-			__strncpy(nbuf, name, n);
+			strncpy(nbuf, name, n);
 			nbuf[n] = '\0';
 			nbuf[n] = '\0';
 		} else
 		} else
 			longname = name;
 			longname = name;
 	} else {
 	} else {
-		n = __strlen(name);
+		n = strlen(name);
-		d = __strlen(domain);
+		d = strlen(domain);
 		if (n + 1 + d + 1 > sizeof(nbuf)) {
 		if (n + 1 + d + 1 > sizeof(nbuf)) {
 			h_errno = NO_RECOVERY;
 			h_errno = NO_RECOVERY;
 			return (-1);
 			return (-1);
 		}
 		}
 		snprintf(nbuf, sizeof(nbuf), "%s.%s", name, domain);
 		snprintf(nbuf, sizeof(nbuf), "%s.%s", name, domain);
 	}
 	}
-	return (__res_query_internal(longname, class, type, answer, anslen));
+	return (res_query(longname, class, type, answer, anslen));
 }
 }
-strong_alias(__res_querydomain_internal,res_querydomain)
+libc_hidden_def(res_querydomain)
 
 
 /* res_mkquery */
 /* res_mkquery */
 /* res_send */
 /* res_send */
@@ -1443,14 +1438,7 @@ strong_alias(__res_querydomain_internal,res_querydomain)
 #endif
 #endif
 
 
 #ifdef L_gethostbyaddr
 #ifdef L_gethostbyaddr
-extern int __gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
+struct hostent *gethostbyaddr (const void *addr, socklen_t len, int type)
-			    int __type,
-			    struct hostent *__restrict __result_buf,
-			    char *__restrict __buf, size_t __buflen,
-			    struct hostent **__restrict __result,
-			    int *__restrict __h_errnop) attribute_hidden;
-
-struct hostent attribute_hidden *__gethostbyaddr (const void *addr, socklen_t len, int type)
 {
 {
 	static struct hostent h;
 	static struct hostent h;
 	static char buf[
 	static char buf[
@@ -1462,11 +1450,11 @@ struct hostent attribute_hidden *__gethostbyaddr (const void *addr, socklen_t le
 		sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */];
 		sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */];
 	struct hostent *hp;
 	struct hostent *hp;
 
 
-	__gethostbyaddr_r(addr, len, type, &h, buf, sizeof(buf), &hp, &h_errno);
+	gethostbyaddr_r(addr, len, type, &h, buf, sizeof(buf), &hp, &h_errno);
 
 
 	return hp;
 	return hp;
 }
 }
-strong_alias(__gethostbyaddr,gethostbyaddr)
+libc_hidden_def(gethostbyaddr)
 #endif
 #endif
 
 
 
 
@@ -1551,7 +1539,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type,
 
 
 	*h_errnop=HOST_NOT_FOUND;
 	*h_errnop=HOST_NOT_FOUND;
 	while (fgets(buf, buflen, fp)) {
 	while (fgets(buf, buflen, fp)) {
-		if ((cp = __strchr(buf, '#')))
+		if ((cp = strchr(buf, '#')))
 			*cp = '\0';
 			*cp = '\0';
 		DPRINTF("Looking at: %s\n", buf);
 		DPRINTF("Looking at: %s\n", buf);
 		aliases = 0;
 		aliases = 0;
@@ -1576,12 +1564,12 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type,
 			/* Return whatever the next entry happens to be. */
 			/* Return whatever the next entry happens to be. */
 			break;
 			break;
 		} else if (action==GET_HOSTS_BYADDR) {
 		} else if (action==GET_HOSTS_BYADDR) {
-			if (__strcmp(name, alias[0]) != 0)
+			if (strcmp(name, alias[0]) != 0)
 				continue;
 				continue;
 		} else {
 		} else {
 			/* GET_HOSTS_BYNAME */
 			/* GET_HOSTS_BYNAME */
 			for (i = 1; i < aliases; i++)
 			for (i = 1; i < aliases; i++)
-				if (__strcasecmp(name, alias[i]) == 0)
+				if (strcasecmp(name, alias[i]) == 0)
 					break;
 					break;
 			if (i >= aliases)
 			if (i >= aliases)
 				continue;
 				continue;
@@ -1652,7 +1640,7 @@ void sethostent (int stay_open)
     UNLOCK;
     UNLOCK;
 }
 }
 
 
-int attribute_hidden __gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
+int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
 	struct hostent **result, int *h_errnop)
 	struct hostent **result, int *h_errnop)
 {
 {
     int ret;
     int ret;
@@ -1675,7 +1663,7 @@ int attribute_hidden __gethostent_r(struct hostent *result_buf, char *buf, size_
     UNLOCK;
     UNLOCK;
     return(ret);
     return(ret);
 }
 }
-strong_alias(__gethostent_r,gethostent_r)
+libc_hidden_def(gethostent_r)
 
 
 struct hostent *gethostent (void)
 struct hostent *gethostent (void)
 {
 {
@@ -1691,7 +1679,7 @@ struct hostent *gethostent (void)
     struct hostent *host;
     struct hostent *host;
 
 
     LOCK;
     LOCK;
-    __gethostent_r(&h, buf, sizeof(buf), &host, &h_errno);
+    gethostent_r(&h, buf, sizeof(buf), &host, &h_errno);
     UNLOCK;
     UNLOCK;
     return(host);
     return(host);
 }
 }
@@ -1752,7 +1740,7 @@ int attribute_hidden __get_hosts_byaddr_r(const char * addr, int len, int type,
 # define min(x,y) (((x) > (y)) ? (y) : (x))
 # define min(x,y) (((x) > (y)) ? (y) : (x))
 #endif /* min */
 #endif /* min */
 
 
-int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
+int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
 	     socklen_t hostlen, char *serv, socklen_t servlen,
 	     socklen_t hostlen, char *serv, socklen_t servlen,
 	     unsigned int flags)
 	     unsigned int flags)
 {
 {
@@ -1793,12 +1781,12 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 			if (!(flags & NI_NUMERICHOST)) {
 			if (!(flags & NI_NUMERICHOST)) {
 #ifdef __UCLIBC_HAS_IPV6__
 #ifdef __UCLIBC_HAS_IPV6__
 				if (sa->sa_family == AF_INET6)
 				if (sa->sa_family == AF_INET6)
-					h = __gethostbyaddr ((const void *)
+					h = gethostbyaddr ((const void *)
 						&(((const struct sockaddr_in6 *) sa)->sin6_addr),
 						&(((const struct sockaddr_in6 *) sa)->sin6_addr),
 						sizeof(struct in6_addr), AF_INET6);
 						sizeof(struct in6_addr), AF_INET6);
 				else
 				else
 #endif /* __UCLIBC_HAS_IPV6__ */
 #endif /* __UCLIBC_HAS_IPV6__ */
-                    h = __gethostbyaddr ((const void *) &(((const struct sockaddr_in *)sa)->sin_addr),
+                    h = gethostbyaddr ((const void *) &(((const struct sockaddr_in *)sa)->sin_addr),
 					  sizeof(struct in_addr), AF_INET);
 					  sizeof(struct in_addr), AF_INET);
 
 
 				if (h) {
 				if (h) {
@@ -1807,12 +1795,12 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 					    && (getdomainname (domain, sizeof(domain)) == 0)
 					    && (getdomainname (domain, sizeof(domain)) == 0)
 					    && (c = strstr (h->h_name, domain))
 					    && (c = strstr (h->h_name, domain))
 					    && (c != h->h_name) && (*(--c) == '.')) {
 					    && (c != h->h_name) && (*(--c) == '.')) {
-						__strncpy (host, h->h_name,
+						strncpy (host, h->h_name,
 							min(hostlen, (size_t) (c - h->h_name)));
 							min(hostlen, (size_t) (c - h->h_name)));
 						host[min(hostlen - 1, (size_t) (c - h->h_name))] = '\0';
 						host[min(hostlen - 1, (size_t) (c - h->h_name))] = '\0';
 						ok = 1;
 						ok = 1;
 					} else {
 					} else {
-						__strncpy (host, h->h_name, hostlen);
+						strncpy (host, h->h_name, hostlen);
 						ok = 1;
 						ok = 1;
 					}
 					}
 				 }
 				 }
@@ -1841,7 +1829,7 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 							char scopebuf[IFNAMSIZ + 1];
 							char scopebuf[IFNAMSIZ + 1];
 							char *scopeptr;
 							char *scopeptr;
 							int ni_numericscope = 0;
 							int ni_numericscope = 0;
-							size_t real_hostlen = __strnlen (host, hostlen);
+							size_t real_hostlen = strnlen (host, hostlen);
 							size_t scopelen = 0;
 							size_t scopelen = 0;
 
 
 							scopebuf[0] = SCOPE_DELIMITER;
 							scopebuf[0] = SCOPE_DELIMITER;
@@ -1853,7 +1841,7 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 								if (if_indextoname (scopeid, scopeptr) == NULL)
 								if (if_indextoname (scopeid, scopeptr) == NULL)
 									++ni_numericscope;
 									++ni_numericscope;
 								else
 								else
-									scopelen = __strlen (scopebuf);
+									scopelen = strlen (scopebuf);
 							} else {
 							} else {
 								++ni_numericscope;
 								++ni_numericscope;
 							}
 							}
@@ -1867,7 +1855,7 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 
 
 							if (real_hostlen + scopelen + 1 > hostlen)
 							if (real_hostlen + scopelen + 1 > hostlen)
 								return EAI_SYSTEM;
 								return EAI_SYSTEM;
-							__memcpy (host + real_hostlen, scopebuf, scopelen + 1);
+							memcpy (host + real_hostlen, scopebuf, scopelen + 1);
 						}
 						}
 #endif
 #endif
 					} else
 					} else
@@ -1890,7 +1878,7 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 				struct utsname utsname;
 				struct utsname utsname;
 
 
 				if (!uname (&utsname)) {
 				if (!uname (&utsname)) {
-					__strncpy (host, utsname.nodename, hostlen);
+					strncpy (host, utsname.nodename, hostlen);
 					break;
 					break;
 				};
 				};
 			};
 			};
@@ -1900,7 +1888,7 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 				return EAI_NONAME;
 				return EAI_NONAME;
 			}
 			}
 
 
-			__strncpy (host, "localhost", hostlen);
+			strncpy (host, "localhost", hostlen);
 			break;
 			break;
 
 
 		default:
 		default:
@@ -1918,7 +1906,7 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 				s = getservbyport (((const struct sockaddr_in *) sa)->sin_port,
 				s = getservbyport (((const struct sockaddr_in *) sa)->sin_port,
 				      ((flags & NI_DGRAM) ? "udp" : "tcp"));
 				      ((flags & NI_DGRAM) ? "udp" : "tcp"));
 				if (s) {
 				if (s) {
-					__strncpy (serv, s->s_name, servlen);
+					strncpy (serv, s->s_name, servlen);
 					break;
 					break;
 				}
 				}
 			}
 			}
@@ -1927,7 +1915,7 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 			break;
 			break;
 
 
 		case AF_LOCAL:
 		case AF_LOCAL:
-			__strncpy (serv, ((const struct sockaddr_un *) sa)->sun_path, servlen);
+			strncpy (serv, ((const struct sockaddr_un *) sa)->sun_path, servlen);
 			break;
 			break;
 		}
 		}
 	}
 	}
@@ -1938,13 +1926,14 @@ int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen
 	errno = serrno;
 	errno = serrno;
 	return 0;
 	return 0;
 }
 }
-strong_alias(__getnameinfo,getnameinfo)
+libc_hidden_proto(getnameinfo)
+libc_hidden_def(getnameinfo)
 #endif
 #endif
 
 
 
 
 #ifdef L_gethostbyname_r
 #ifdef L_gethostbyname_r
 
 
-int attribute_hidden __gethostbyname_r(const char * name,
+int gethostbyname_r(const char * name,
 			    struct hostent * result_buf,
 			    struct hostent * result_buf,
 			    char * buf, size_t buflen,
 			    char * buf, size_t buflen,
 			    struct hostent ** result,
 			    struct hostent ** result,
@@ -2013,7 +2002,7 @@ int attribute_hidden __gethostbyname_r(const char * name,
 
 
 	if (buflen<256)
 	if (buflen<256)
 		return ERANGE;
 		return ERANGE;
-	__strncpy(buf, name, buflen);
+	strncpy(buf, name, buflen);
 
 
 	alias[0] = buf;
 	alias[0] = buf;
 	alias[1] = NULL;
 	alias[1] = NULL;
@@ -2057,7 +2046,7 @@ int attribute_hidden __gethostbyname_r(const char * name,
 	    }
 	    }
 	    else if(a.add_count > 0)
 	    else if(a.add_count > 0)
 	    {
 	    {
-		__memmove(buf - sizeof(struct in_addr*)*2, buf, a.add_count * a.rdlength);
+		memmove(buf - sizeof(struct in_addr*)*2, buf, a.add_count * a.rdlength);
 		addr_list = (struct in_addr**)(buf + a.add_count * a.rdlength);
 		addr_list = (struct in_addr**)(buf + a.add_count * a.rdlength);
 		addr_list[0] = in;
 		addr_list[0] = in;
 		for (i = a.add_count-1; i>=0; --i)
 		for (i = a.add_count-1; i>=0; --i)
@@ -2067,11 +2056,11 @@ int attribute_hidden __gethostbyname_r(const char * name,
 		buf = (char*)&addr_list[a.add_count + 2];
 		buf = (char*)&addr_list[a.add_count + 2];
 	    }
 	    }
 
 
-	    __strncpy(buf, a.dotted, buflen);
+	    strncpy(buf, a.dotted, buflen);
 	    free(a.dotted);
 	    free(a.dotted);
 
 
 	    if (a.atype == T_A) { /* ADDRESS */
 	    if (a.atype == T_A) { /* ADDRESS */
-		__memcpy(in, a.rdata, sizeof(*in));
+		memcpy(in, a.rdata, sizeof(*in));
 		result_buf->h_name = buf;
 		result_buf->h_name = buf;
 		result_buf->h_addrtype = AF_INET;
 		result_buf->h_addrtype = AF_INET;
 		result_buf->h_length = sizeof(*in);
 		result_buf->h_length = sizeof(*in);
@@ -2093,19 +2082,19 @@ int attribute_hidden __gethostbyname_r(const char * name,
 	*h_errnop = NETDB_SUCCESS;
 	*h_errnop = NETDB_SUCCESS;
 	return NETDB_SUCCESS;
 	return NETDB_SUCCESS;
 }
 }
-strong_alias(__gethostbyname_r,gethostbyname_r)
+libc_hidden_def(gethostbyname_r)
 #endif
 #endif
 
 
 #ifdef L_gethostbyname2_r
 #ifdef L_gethostbyname2_r
 
 
-int attribute_hidden __gethostbyname2_r(const char *name, int family,
+int gethostbyname2_r(const char *name, int family,
 			    struct hostent * result_buf,
 			    struct hostent * result_buf,
 			    char * buf, size_t buflen,
 			    char * buf, size_t buflen,
 			    struct hostent ** result,
 			    struct hostent ** result,
 			    int * h_errnop)
 			    int * h_errnop)
 {
 {
 #ifndef __UCLIBC_HAS_IPV6__
 #ifndef __UCLIBC_HAS_IPV6__
-	return family == (AF_INET)? __gethostbyname_r(name, result_buf,
+	return family == (AF_INET)? gethostbyname_r(name, result_buf,
 		buf, buflen, result, h_errnop) : HOST_NOT_FOUND;
 		buf, buflen, result, h_errnop) : HOST_NOT_FOUND;
 #else /* __UCLIBC_HAS_IPV6__ */
 #else /* __UCLIBC_HAS_IPV6__ */
 	struct in6_addr *in;
 	struct in6_addr *in;
@@ -2118,7 +2107,7 @@ int attribute_hidden __gethostbyname2_r(const char *name, int family,
 	char ** __nameserverXX;
 	char ** __nameserverXX;
 
 
 	if (family == AF_INET)
 	if (family == AF_INET)
-		return __gethostbyname_r(name, result_buf, buf, buflen, result, h_errnop);
+		return gethostbyname_r(name, result_buf, buf, buflen, result, h_errnop);
 
 
 	if (family != AF_INET6)
 	if (family != AF_INET6)
 		return EINVAL;
 		return EINVAL;
@@ -2171,7 +2160,7 @@ int attribute_hidden __gethostbyname2_r(const char *name, int family,
 
 
 	if (buflen<256)
 	if (buflen<256)
 		return ERANGE;
 		return ERANGE;
-	__strncpy(buf, name, buflen);
+	strncpy(buf, name, buflen);
 
 
 	/* First check if this is already an address */
 	/* First check if this is already an address */
 	if (inet_pton(AF_INET6, name, in)) {
 	if (inet_pton(AF_INET6, name, in)) {
@@ -2184,7 +2173,7 @@ int attribute_hidden __gethostbyname2_r(const char *name, int family,
 	    return NETDB_SUCCESS;
 	    return NETDB_SUCCESS;
 	}
 	}
 
 
-	__memset((char *) &a, '\0', sizeof(a));
+	memset((char *) &a, '\0', sizeof(a));
 
 
 	for (;;) {
 	for (;;) {
 	BIGLOCK;
 	BIGLOCK;
@@ -2199,7 +2188,7 @@ int attribute_hidden __gethostbyname2_r(const char *name, int family,
 			return TRY_AGAIN;
 			return TRY_AGAIN;
 		}
 		}
 
 
-		__strncpy(buf, a.dotted, buflen);
+		strncpy(buf, a.dotted, buflen);
 		free(a.dotted);
 		free(a.dotted);
 
 
 		if (a.atype == T_CNAME) {		/* CNAME */
 		if (a.atype == T_CNAME) {		/* CNAME */
@@ -2217,7 +2206,7 @@ int attribute_hidden __gethostbyname2_r(const char *name, int family,
 			}
 			}
 			continue;
 			continue;
 		} else if (a.atype == T_AAAA) {	/* ADDRESS */
 		} else if (a.atype == T_AAAA) {	/* ADDRESS */
-			__memcpy(in, a.rdata, sizeof(*in));
+			memcpy(in, a.rdata, sizeof(*in));
 			result_buf->h_name = buf;
 			result_buf->h_name = buf;
 			result_buf->h_addrtype = AF_INET6;
 			result_buf->h_addrtype = AF_INET6;
 			result_buf->h_length = sizeof(*in);
 			result_buf->h_length = sizeof(*in);
@@ -2236,11 +2225,11 @@ int attribute_hidden __gethostbyname2_r(const char *name, int family,
 	return NETDB_SUCCESS;
 	return NETDB_SUCCESS;
 #endif /* __UCLIBC_HAS_IPV6__ */
 #endif /* __UCLIBC_HAS_IPV6__ */
 }
 }
-strong_alias(__gethostbyname2_r,gethostbyname2_r)
+libc_hidden_def(gethostbyname2_r)
 #endif
 #endif
 
 
 #ifdef L_gethostbyaddr_r
 #ifdef L_gethostbyaddr_r
-int attribute_hidden __gethostbyaddr_r (const void *addr, socklen_t len, int type,
+int gethostbyaddr_r (const void *addr, socklen_t len, int type,
 			    struct hostent * result_buf,
 			    struct hostent * result_buf,
 			    char * buf, size_t buflen,
 			    char * buf, size_t buflen,
 			    struct hostent ** result,
 			    struct hostent ** result,
@@ -2266,7 +2255,7 @@ int attribute_hidden __gethostbyaddr_r (const void *addr, socklen_t len, int typ
 	if (!addr)
 	if (!addr)
 		return EINVAL;
 		return EINVAL;
 
 
-	__memset((char *) &a, '\0', sizeof(a));
+	memset((char *) &a, '\0', sizeof(a));
 
 
 	switch (type) {
 	switch (type) {
 		case AF_INET:
 		case AF_INET:
@@ -2340,24 +2329,24 @@ int attribute_hidden __gethostbyaddr_r (const void *addr, socklen_t len, int typ
 	if(type == AF_INET) {
 	if(type == AF_INET) {
 		unsigned char *tmp_addr = (unsigned char *)addr;
 		unsigned char *tmp_addr = (unsigned char *)addr;
 
 
-		__memcpy(&in->s_addr, addr, len);
+		memcpy(&in->s_addr, addr, len);
 
 
 		addr_list[0] = in;
 		addr_list[0] = in;
 
 
-		__sprintf(buf, "%u.%u.%u.%u.in-addr.arpa",
+		sprintf(buf, "%u.%u.%u.%u.in-addr.arpa",
 			tmp_addr[3], tmp_addr[2], tmp_addr[1], tmp_addr[0]);
 			tmp_addr[3], tmp_addr[2], tmp_addr[1], tmp_addr[0]);
 #ifdef __UCLIBC_HAS_IPV6__
 #ifdef __UCLIBC_HAS_IPV6__
 	} else {
 	} else {
-		__memcpy(in6->s6_addr, addr, len);
+		memcpy(in6->s6_addr, addr, len);
 
 
 		addr_list6[0] = in6;
 		addr_list6[0] = in6;
 		qp = buf;
 		qp = buf;
 
 
 		for (i = len - 1; i >= 0; i--) {
 		for (i = len - 1; i >= 0; i--) {
-			qp += __sprintf(qp, "%x.%x.", in6->s6_addr[i] & 0xf,
+			qp += sprintf(qp, "%x.%x.", in6->s6_addr[i] & 0xf,
 				(in6->s6_addr[i] >> 4) & 0xf);
 				(in6->s6_addr[i] >> 4) & 0xf);
     	}
     	}
-    	__strcpy(qp, "ip6.int");
+    	strcpy(qp, "ip6.int");
 #endif /* __UCLIBC_HAS_IPV6__ */
 #endif /* __UCLIBC_HAS_IPV6__ */
 	}
 	}
 
 
@@ -2376,7 +2365,7 @@ int attribute_hidden __gethostbyaddr_r (const void *addr, socklen_t len, int typ
 			return TRY_AGAIN;
 			return TRY_AGAIN;
 		}
 		}
 
 
-		__strncpy(buf, a.dotted, buflen);
+		strncpy(buf, a.dotted, buflen);
 		free(a.dotted);
 		free(a.dotted);
 
 
 		if (a.atype == T_CNAME) {		/* CNAME */
 		if (a.atype == T_CNAME) {		/* CNAME */
@@ -2421,7 +2410,7 @@ int attribute_hidden __gethostbyaddr_r (const void *addr, socklen_t len, int typ
 	*h_errnop = NETDB_SUCCESS;
 	*h_errnop = NETDB_SUCCESS;
 	return NETDB_SUCCESS;
 	return NETDB_SUCCESS;
 }
 }
-strong_alias(__gethostbyaddr_r,gethostbyaddr_r)
+libc_hidden_def(gethostbyaddr_r)
 #endif
 #endif
 
 
 #ifdef L_res_comp
 #ifdef L_res_comp
@@ -2435,7 +2424,7 @@ strong_alias(__gethostbyaddr_r,gethostbyaddr_r)
 int __dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
 int __dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
           char *dst, int dstsiz)
           char *dst, int dstsiz)
 {
 {
-	int n = __ns_name_uncompress_internal(msg, eom, src, dst, (size_t)dstsiz);
+	int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
 
 
 	if (n > 0 && dst[0] == '.')
 	if (n > 0 && dst[0] == '.')
 		dst[0] = '\0';
 		dst[0] = '\0';
@@ -2487,19 +2476,19 @@ static int special(int ch)
  * note:
  * note:
  *      Root domain returns as "." not "".
  *      Root domain returns as "." not "".
  */
  */
-int attribute_hidden __ns_name_uncompress_internal(const u_char *msg, const u_char *eom,
+int ns_name_uncompress(const u_char *msg, const u_char *eom,
 		const u_char *src, char *dst, size_t dstsiz)
 		const u_char *src, char *dst, size_t dstsiz)
 {
 {
 	u_char tmp[NS_MAXCDNAME];
 	u_char tmp[NS_MAXCDNAME];
 	int n;
 	int n;
 
 
-	if ((n = __ns_name_unpack_internal(msg, eom, src, tmp, sizeof tmp)) == -1)
+	if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
 		return (-1);
 		return (-1);
-	if (__ns_name_ntop_internal(tmp, dst, dstsiz) == -1)
+	if (ns_name_ntop(tmp, dst, dstsiz) == -1)
 		return (-1);
 		return (-1);
 	return (n);
 	return (n);
 }
 }
-strong_alias(__ns_name_uncompress_internal,__ns_name_uncompress)
+libc_hidden_def(ns_name_uncompress)
 
 
 
 
 /*
 /*
@@ -2511,7 +2500,7 @@ strong_alias(__ns_name_uncompress_internal,__ns_name_uncompress)
  *      The root is returned as "."
  *      The root is returned as "."
  *      All other domains are returned in non absolute form
  *      All other domains are returned in non absolute form
  */
  */
-int attribute_hidden __ns_name_ntop_internal(const u_char *src, char *dst, size_t dstsiz) {
+int ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
 	const u_char *cp;
 	const u_char *cp;
 	char *dn, *eom;
 	char *dn, *eom;
 	u_char c;
 	u_char c;
@@ -2580,7 +2569,7 @@ int attribute_hidden __ns_name_ntop_internal(const u_char *src, char *dst, size_
 	*dn++ = '\0';
 	*dn++ = '\0';
         return (dn - dst);
         return (dn - dst);
 }
 }
-strong_alias(__ns_name_ntop_internal,__ns_name_ntop)
+libc_hidden_def(ns_name_ntop)
 
 
 /*
 /*
  * ns_name_unpack(msg, eom, src, dst, dstsiz)
  * ns_name_unpack(msg, eom, src, dst, dstsiz)
@@ -2588,7 +2577,7 @@ strong_alias(__ns_name_ntop_internal,__ns_name_ntop)
  * return:
  * return:
  *      -1 if it fails, or consumed octets if it succeeds.
  *      -1 if it fails, or consumed octets if it succeeds.
  */
  */
-int attribute_hidden __ns_name_unpack_internal(const u_char *msg, const u_char *eom, const u_char *src,
+int ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
                u_char *dst, size_t dstsiz)
                u_char *dst, size_t dstsiz)
 {
 {
 	const u_char *srcp, *dstlim;
 	const u_char *srcp, *dstlim;
@@ -2616,7 +2605,7 @@ int attribute_hidden __ns_name_unpack_internal(const u_char *msg, const u_char *
 			}
 			}
 			checked += n + 1;
 			checked += n + 1;
 			*dstp++ = n;
 			*dstp++ = n;
-			__memcpy(dstp, srcp, n);
+			memcpy(dstp, srcp, n);
 			dstp += n;
 			dstp += n;
 			srcp += n;
 			srcp += n;
 			break;
 			break;
@@ -2655,5 +2644,5 @@ int attribute_hidden __ns_name_unpack_internal(const u_char *msg, const u_char *
 		len = srcp - src;
 		len = srcp - src;
 	return (len);
 	return (len);
 }
 }
-strong_alias(__ns_name_unpack_internal,__ns_name_unpack)
+libc_hidden_def(ns_name_unpack)
 #endif /* L_ns_name */
 #endif /* L_ns_name */

+ 7 - 6
libc/inet/rpc/auth_none.c

@@ -35,13 +35,13 @@
  * credentials and verifiers to remote systems.
  * credentials and verifiers to remote systems.
  */
  */
 
 
-#define xdrmem_create __xdrmem_create
-#define xdr_opaque_auth __xdr_opaque_auth
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include "rpc_private.h"
 #include "rpc_private.h"
 
 
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_opaque_auth)
+
 #define MAX_MARSHEL_SIZE 20
 #define MAX_MARSHEL_SIZE 20
 
 
 /*
 /*
@@ -72,8 +72,8 @@ struct authnone_private_s {
 static struct authnone_private_s *authnone_private;
 static struct authnone_private_s *authnone_private;
 #endif
 #endif
 
 
-AUTH attribute_hidden *
+AUTH *
-__authnone_create (void)
+authnone_create (void)
 {
 {
   struct authnone_private_s *ap;
   struct authnone_private_s *ap;
   XDR xdr_stream;
   XDR xdr_stream;
@@ -101,7 +101,8 @@ __authnone_create (void)
     }
     }
   return (&ap->no_client);
   return (&ap->no_client);
 }
 }
-strong_alias(__authnone_create,authnone_create)
+libc_hidden_proto(authnone_create)
+libc_hidden_def(authnone_create)
 
 
 /*ARGSUSED */
 /*ARGSUSED */
 static bool_t
 static bool_t

+ 29 - 21
libc/inet/rpc/auth_unix.c

@@ -38,17 +38,6 @@
  * for the credentials.
  * for the credentials.
  */
  */
 
 
-#define sysconf __sysconf
-#define getegid __getegid
-#define geteuid __geteuid
-#define getgroups __getgroups
-#define gethostname __gethostname
-#define xdrmem_create __xdrmem_create
-#define xdr_authunix_parms __xdr_authunix_parms
-#define xdr_opaque_auth __xdr_opaque_auth
-#define gettimeofday __gettimeofday
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -67,6 +56,23 @@
 # include <wchar.h>
 # include <wchar.h>
 #endif
 #endif
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(sysconf)
+libc_hidden_proto(getegid)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(getgroups)
+libc_hidden_proto(gethostname)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_authunix_parms)
+libc_hidden_proto(xdr_opaque_auth)
+libc_hidden_proto(gettimeofday)
+libc_hidden_proto(fputs)
+libc_hidden_proto(perror)
+libc_hidden_proto(abort)
+#ifdef USE_IN_LIBIO
+libc_hidden_proto(fwprintf)
+#endif
+
 /*
 /*
  * Unix authenticator operations vector
  * Unix authenticator operations vector
  */
  */
@@ -103,8 +109,8 @@ static bool_t marshal_new_auth (AUTH *) internal_function;
  * Create a unix style authenticator.
  * Create a unix style authenticator.
  * Returns an auth handle with the given stuff in it.
  * Returns an auth handle with the given stuff in it.
  */
  */
-AUTH attribute_hidden *
+AUTH *
-__authunix_create (char *machname, uid_t uid, gid_t gid, int len,
+authunix_create (char *machname, uid_t uid, gid_t gid, int len,
 		 gid_t *aup_gids)
 		 gid_t *aup_gids)
 {
 {
   struct authunix_parms aup;
   struct authunix_parms aup;
@@ -124,7 +130,7 @@ __authunix_create (char *machname, uid_t uid, gid_t gid, int len,
 no_memory:
 no_memory:
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
       if (_IO_fwide (stderr, 0) > 0)
-	(void) __fwprintf (stderr, L"%s",
+	(void) fwprintf (stderr, L"%s",
 			   _("authunix_create: out of memory\n"));
 			   _("authunix_create: out of memory\n"));
       else
       else
 #endif
 #endif
@@ -160,7 +166,7 @@ no_memory:
   au->au_origcred.oa_base = mem_alloc ((u_int) len);
   au->au_origcred.oa_base = mem_alloc ((u_int) len);
   if (au->au_origcred.oa_base == NULL)
   if (au->au_origcred.oa_base == NULL)
     goto no_memory;
     goto no_memory;
-  __memcpy(au->au_origcred.oa_base, mymem, (u_int) len);
+  memcpy(au->au_origcred.oa_base, mymem, (u_int) len);
 
 
   /*
   /*
    * set auth handle to reflect new cred.
    * set auth handle to reflect new cred.
@@ -169,14 +175,15 @@ no_memory:
   marshal_new_auth (auth);
   marshal_new_auth (auth);
   return auth;
   return auth;
 }
 }
-strong_alias(__authunix_create,authunix_create)
+libc_hidden_proto(authunix_create)
+libc_hidden_def(authunix_create)
 
 
 /*
 /*
  * Returns an auth handle with parameters determined by doing lots of
  * Returns an auth handle with parameters determined by doing lots of
  * syscalls.
  * syscalls.
  */
  */
-AUTH attribute_hidden *
+AUTH *
-__authunix_create_default (void)
+authunix_create_default (void)
 {
 {
   int len;
   int len;
   char machname[MAX_MACHINE_NAME + 1];
   char machname[MAX_MACHINE_NAME + 1];
@@ -203,12 +210,13 @@ __authunix_create_default (void)
   /* This braindamaged Sun code forces us here to truncate the
   /* This braindamaged Sun code forces us here to truncate the
      list of groups to NGRPS members since the code in
      list of groups to NGRPS members since the code in
      authuxprot.c transforms a fixed array.  Grrr.  */
      authuxprot.c transforms a fixed array.  Grrr.  */
-  ret_auth = __authunix_create (machname, uid, gid, MIN (NGRPS, len), gids);
+  ret_auth = authunix_create (machname, uid, gid, MIN (NGRPS, len), gids);
   if (gids)
   if (gids)
     free (gids);
     free (gids);
   return ret_auth;
   return ret_auth;
 }
 }
-strong_alias(__authunix_create_default,authunix_create_default)
+libc_hidden_proto(authunix_create_default)
+libc_hidden_def(authunix_create_default)
 
 
 /*
 /*
  * authunix operations
  * authunix operations
@@ -338,7 +346,7 @@ marshal_new_auth (AUTH *auth)
   xdrmem_create (xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE);
   xdrmem_create (xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE);
   if ((!xdr_opaque_auth (xdrs, &(auth->ah_cred))) ||
   if ((!xdr_opaque_auth (xdrs, &(auth->ah_cred))) ||
       (!xdr_opaque_auth (xdrs, &(auth->ah_verf))))
       (!xdr_opaque_auth (xdrs, &(auth->ah_verf))))
-    __perror (_("auth_none.c - Fatal marshalling problem"));
+    perror (_("auth_none.c - Fatal marshalling problem"));
   else
   else
     au->au_mpos = XDR_GETPOS (xdrs);
     au->au_mpos = XDR_GETPOS (xdrs);
 
 

+ 10 - 8
libc/inet/rpc/authunix_prot.c

@@ -34,22 +34,23 @@
  * XDR for UNIX style authentication parameters for RPC
  * XDR for UNIX style authentication parameters for RPC
  */
  */
 
 
-#define xdr_string __xdr_string
-#define xdr_u_int __xdr_u_int
-#define xdr_array __xdr_array
-#define xdr_u_long __xdr_u_long
-
 #include <rpc/types.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
 #include <rpc/xdr.h>
 #include <rpc/auth.h>
 #include <rpc/auth.h>
 #include <rpc/auth_unix.h>
 #include <rpc/auth_unix.h>
 
 
+libc_hidden_proto(xdr_string)
+libc_hidden_def(xdr_string)
+libc_hidden_proto(xdr_u_int)
+libc_hidden_proto(xdr_array)
+libc_hidden_proto(xdr_u_long)
+
 /*
 /*
  * XDR for unix authentication parameters.
  * XDR for unix authentication parameters.
  * Unfortunately, none of these can be declared const.
  * Unfortunately, none of these can be declared const.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_authunix_parms (XDR * xdrs, struct authunix_parms *p)
+xdr_authunix_parms (XDR * xdrs, struct authunix_parms *p)
 {
 {
   if (xdr_u_long (xdrs, &(p->aup_time))
   if (xdr_u_long (xdrs, &(p->aup_time))
       && xdr_string (xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
       && xdr_string (xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
@@ -68,4 +69,5 @@ __xdr_authunix_parms (XDR * xdrs, struct authunix_parms *p)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_authunix_parms,xdr_authunix_parms)
+libc_hidden_proto(xdr_authunix_parms)
+libc_hidden_def(xdr_authunix_parms)

+ 10 - 7
libc/inet/rpc/bindresvport.c

@@ -30,8 +30,6 @@
  * Copyright (c) 1987 by Sun Microsystems, Inc.
  * Copyright (c) 1987 by Sun Microsystems, Inc.
  */
  */
 
 
-#define bind __bind
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -42,11 +40,15 @@
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/in.h>
 
 
+libc_hidden_proto(memset)
+libc_hidden_proto(bind)
+libc_hidden_proto(getpid)
+
 /*
 /*
  * Bind a socket to a privileged IP port
  * Bind a socket to a privileged IP port
  */
  */
-int attribute_hidden
+int
-__bindresvport (int sd, struct sockaddr_in *sin)
+bindresvport (int sd, struct sockaddr_in *sin)
 {
 {
   int res;
   int res;
   static short port;
   static short port;
@@ -60,7 +62,7 @@ __bindresvport (int sd, struct sockaddr_in *sin)
   if (sin == (struct sockaddr_in *) 0)
   if (sin == (struct sockaddr_in *) 0)
     {
     {
       sin = &myaddr;
       sin = &myaddr;
-      __memset (sin, 0, sizeof (*sin));
+      memset (sin, 0, sizeof (*sin));
       sin->sin_family = AF_INET;
       sin->sin_family = AF_INET;
     }
     }
   else if (sin->sin_family != AF_INET)
   else if (sin->sin_family != AF_INET)
@@ -71,7 +73,7 @@ __bindresvport (int sd, struct sockaddr_in *sin)
 
 
   if (port == 0)
   if (port == 0)
     {
     {
-      port = (__getpid () % NPORTS) + STARTPORT;
+      port = (getpid () % NPORTS) + STARTPORT;
     }
     }
   res = -1;
   res = -1;
   __set_errno (EADDRINUSE);
   __set_errno (EADDRINUSE);
@@ -88,4 +90,5 @@ __bindresvport (int sd, struct sockaddr_in *sin)
 
 
   return res;
   return res;
 }
 }
-strong_alias(__bindresvport,bindresvport)
+libc_hidden_proto(bindresvport)
+libc_hidden_def(bindresvport)

+ 15 - 15
libc/inet/rpc/clnt_generic.c

@@ -30,12 +30,6 @@
  * Copyright (C) 1987, Sun Microsystems, Inc.
  * Copyright (C) 1987, Sun Microsystems, Inc.
  */
  */
 
 
-#define clnttcp_create __clnttcp_create
-#define clntudp_create __clntudp_create
-#define clntunix_create __clntunix_create
-#define getprotobyname_r __getprotobyname_r
-#define gethostbyname_r __gethostbyname_r
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -46,10 +40,16 @@
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <netdb.h>
 #include <netdb.h>
 
 
-#undef get_rpc_createerr
+libc_hidden_proto(memcpy)
-extern struct rpc_createerr *__rpc_thread_createerr_internal (void)
+libc_hidden_proto(memset)
-     __attribute__ ((__const__)) attribute_hidden;
+libc_hidden_proto(strcmp)
-#define get_rpc_createerr() (*__rpc_thread_createerr_internal ())
+libc_hidden_proto(strcpy)
+libc_hidden_proto(clnttcp_create)
+libc_hidden_proto(clntudp_create)
+libc_hidden_proto(clntunix_create)
+libc_hidden_proto(getprotobyname_r)
+libc_hidden_proto(gethostbyname_r)
+libc_hidden_proto(__rpc_thread_createerr)
 
 
 /*
 /*
  * Generic client creation: takes (hostname, program-number, protocol) and
  * Generic client creation: takes (hostname, program-number, protocol) and
@@ -73,11 +73,11 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
   CLIENT *client;
   CLIENT *client;
   int herr;
   int herr;
 
 
-  if (__strcmp (proto, "unix") == 0)
+  if (strcmp (proto, "unix") == 0)
     {
     {
-      __memset ((char *)&sun, 0, sizeof (sun));
+      memset ((char *)&sun, 0, sizeof (sun));
       sun.sun_family = AF_UNIX;
       sun.sun_family = AF_UNIX;
-      __strcpy (sun.sun_path, hostname);
+      strcpy (sun.sun_path, hostname);
       sock = RPC_ANYSOCK;
       sock = RPC_ANYSOCK;
       client = clntunix_create (&sun, prog, vers, &sock, 0, 0);
       client = clntunix_create (&sun, prog, vers, &sock, 0, 0);
       if (client == NULL)
       if (client == NULL)
@@ -122,8 +122,8 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
     }
     }
   sin.sin_family = h->h_addrtype;
   sin.sin_family = h->h_addrtype;
   sin.sin_port = 0;
   sin.sin_port = 0;
-  __memset (sin.sin_zero, 0, sizeof (sin.sin_zero));
+  memset (sin.sin_zero, 0, sizeof (sin.sin_zero));
-  __memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length);
+  memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length);
 
 
   prtbuflen = 1024;
   prtbuflen = 1024;
   prttmpbuf = alloca (prtbuflen);
   prttmpbuf = alloca (prtbuflen);

+ 56 - 45
libc/inet/rpc/clnt_perror.c

@@ -38,8 +38,6 @@ static char sccsid[] = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro";
  *
  *
  */
  */
 
 
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -53,6 +51,15 @@ static char sccsid[] = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro";
 # define fputs(s, f) _IO_fputs (s, f)
 # define fputs(s, f) _IO_fputs (s, f)
 #endif
 #endif
 
 
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strlen)
+libc_hidden_proto(sprintf)
+libc_hidden_proto(__glibc_strerror_r)
+libc_hidden_proto(fputs)
+#ifdef USE_IN_LIBIO
+libc_hidden_proto(fwprintf)
+#endif
+
 static char *auth_errmsg (enum auth_stat stat) internal_function;
 static char *auth_errmsg (enum auth_stat stat) internal_function;
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
@@ -179,8 +186,8 @@ static const struct rpc_errtab rpc_errlist[] =
 /*
 /*
  * This interface for use by clntrpc
  * This interface for use by clntrpc
  */
  */
-char attribute_hidden *
+char *
-__clnt_sperrno (enum clnt_stat stat)
+clnt_sperrno (enum clnt_stat stat)
 {
 {
   size_t i;
   size_t i;
 
 
@@ -193,24 +200,25 @@ __clnt_sperrno (enum clnt_stat stat)
     }
     }
   return _("RPC: (unknown error code)");
   return _("RPC: (unknown error code)");
 }
 }
-strong_alias(__clnt_sperrno,clnt_sperrno)
+libc_hidden_proto(clnt_sperrno)
+libc_hidden_def(clnt_sperrno)
 
 
 void
 void
 clnt_perrno (enum clnt_stat num)
 clnt_perrno (enum clnt_stat num)
 {
 {
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
   if (_IO_fwide (stderr, 0) > 0)
   if (_IO_fwide (stderr, 0) > 0)
-    (void) __fwprintf (stderr, L"%s", __clnt_sperrno (num));
+    (void) fwprintf (stderr, L"%s", clnt_sperrno (num));
   else
   else
 #endif
 #endif
-    (void) fputs (__clnt_sperrno (num), stderr);
+    (void) fputs (clnt_sperrno (num), stderr);
 }
 }
 
 
 /*
 /*
  * Print reply error info
  * Print reply error info
  */
  */
-char attribute_hidden *
+char *
-__clnt_sperror (CLIENT * rpch, const char *msg)
+clnt_sperror (CLIENT * rpch, const char *msg)
 {
 {
   char chrbuf[1024];
   char chrbuf[1024];
   struct rpc_err e;
   struct rpc_err e;
@@ -223,11 +231,11 @@ __clnt_sperror (CLIENT * rpch, const char *msg)
     return NULL;
     return NULL;
   CLNT_GETERR (rpch, &e);
   CLNT_GETERR (rpch, &e);
 
 
-  len = __sprintf (str, "%s: ", msg);
+  len = sprintf (str, "%s: ", msg);
   str += len;
   str += len;
 
 
-  (void) __strcpy(str, __clnt_sperrno(e.re_status));
+  (void) strcpy(str, clnt_sperrno(e.re_status));
-  str += __strlen(str);
+  str += strlen(str);
 
 
   switch (e.re_status)
   switch (e.re_status)
     {
     {
@@ -248,43 +256,43 @@ __clnt_sperror (CLIENT * rpch, const char *msg)
 
 
     case RPC_CANTSEND:
     case RPC_CANTSEND:
     case RPC_CANTRECV:
     case RPC_CANTRECV:
-      __glibc_strerror_r_internal (e.re_errno, chrbuf, sizeof chrbuf);
+      __glibc_strerror_r (e.re_errno, chrbuf, sizeof chrbuf);
-      len = __sprintf (str, "; errno = %s", chrbuf); 
+      len = sprintf (str, "; errno = %s", chrbuf); 
       str += len;
       str += len;
       break;
       break;
 
 
     case RPC_VERSMISMATCH:
     case RPC_VERSMISMATCH:
-      len= __sprintf (str, _("; low version = %lu, high version = %lu"),
+      len= sprintf (str, _("; low version = %lu, high version = %lu"),
 		    e.re_vers.low, e.re_vers.high);
 		    e.re_vers.low, e.re_vers.high);
       str += len;
       str += len;
       break;
       break;
 
 
     case RPC_AUTHERROR:
     case RPC_AUTHERROR:
       err = auth_errmsg (e.re_why);
       err = auth_errmsg (e.re_why);
-      (void) __strcpy(str, _("; why = "));
+      (void) strcpy(str, _("; why = "));
-      str += __strlen(str);
+      str += strlen(str);
 
 
       if (err != NULL)
       if (err != NULL)
 	{
 	{
-	  (void) __strcpy(str, err);
+	  (void) strcpy(str, err);
-	  str += __strlen(str);
+	  str += strlen(str);
 	}
 	}
       else
       else
 	{
 	{
-	  len = __sprintf (str, _("(unknown authentication error - %d)"),
+	  len = sprintf (str, _("(unknown authentication error - %d)"),
 			 (int) e.re_why);
 			 (int) e.re_why);
 	  str += len;
 	  str += len;
 	}
 	}
       break;
       break;
 
 
     case RPC_PROGVERSMISMATCH:
     case RPC_PROGVERSMISMATCH:
-      len = __sprintf (str, _("; low version = %lu, high version = %lu"),
+      len = sprintf (str, _("; low version = %lu, high version = %lu"),
 		     e.re_vers.low, e.re_vers.high);
 		     e.re_vers.low, e.re_vers.high);
       str += len;
       str += len;
       break;
       break;
 
 
     default:			/* unknown */
     default:			/* unknown */
-      len = __sprintf (str, "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2);
+      len = sprintf (str, "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2);
       str += len;
       str += len;
       break;
       break;
     }
     }
@@ -292,22 +300,24 @@ __clnt_sperror (CLIENT * rpch, const char *msg)
   *++str = '\0';
   *++str = '\0';
   return (strstart);
   return (strstart);
 }
 }
-strong_alias(__clnt_sperror,clnt_sperror)
+libc_hidden_proto(clnt_sperror)
+libc_hidden_def(clnt_sperror)
 
 
-void attribute_hidden
+void
-__clnt_perror (CLIENT * rpch, const char *msg)
+clnt_perror (CLIENT * rpch, const char *msg)
 {
 {
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
   if (_IO_fwide (stderr, 0) > 0)
   if (_IO_fwide (stderr, 0) > 0)
-    (void) __fwprintf (stderr, L"%s", __clnt_sperror (rpch, msg));
+    (void) fwprintf (stderr, L"%s", clnt_sperror (rpch, msg));
   else
   else
 #endif
 #endif
-    (void) fputs (__clnt_sperror (rpch, msg), stderr);
+    (void) fputs (clnt_sperror (rpch, msg), stderr);
 }
 }
-strong_alias(__clnt_perror,clnt_perror)
+libc_hidden_proto(clnt_perror)
+libc_hidden_def(clnt_perror)
 
 
-char attribute_hidden *
+char *
-__clnt_spcreateerror (const char *msg)
+clnt_spcreateerror (const char *msg)
 {
 {
   char chrbuf[1024];
   char chrbuf[1024];
   char *str = _buf ();
   char *str = _buf ();
@@ -318,29 +328,29 @@ __clnt_spcreateerror (const char *msg)
   if (str == NULL)
   if (str == NULL)
     return NULL;
     return NULL;
   ce = &get_rpc_createerr ();
   ce = &get_rpc_createerr ();
-  len = __sprintf (str, "%s: ", msg);
+  len = sprintf (str, "%s: ", msg);
   cp = str + len;
   cp = str + len;
-  (void) __strcpy(cp, __clnt_sperrno (ce->cf_stat));
+  (void) strcpy(cp, clnt_sperrno (ce->cf_stat));
-  cp += __strlen(cp);
+  cp += strlen(cp);
 
 
   switch (ce->cf_stat)
   switch (ce->cf_stat)
     {
     {
     case RPC_PMAPFAILURE:
     case RPC_PMAPFAILURE:
-      (void) __strcpy(cp, " - ");
+      (void) strcpy(cp, " - ");
-      cp += __strlen(cp);
+      cp += strlen(cp);
 
 
-      (void) __strcpy(cp, __clnt_sperrno (ce->cf_error.re_status));
+      (void) strcpy(cp, clnt_sperrno (ce->cf_error.re_status));
-      cp += __strlen(cp);
+      cp += strlen(cp);
 
 
       break;
       break;
 
 
     case RPC_SYSTEMERROR:
     case RPC_SYSTEMERROR:
-      (void) __strcpy(cp, " - ");
+      (void) strcpy(cp, " - ");
-      cp += __strlen(cp);
+      cp += strlen(cp);
 
 
-      __glibc_strerror_r_internal (ce->cf_error.re_errno, chrbuf, sizeof chrbuf);
+      __glibc_strerror_r (ce->cf_error.re_errno, chrbuf, sizeof chrbuf);
-      (void) __strcpy(cp, chrbuf);
+      (void) strcpy(cp, chrbuf);
-      cp += __strlen(cp);
+      cp += strlen(cp);
       break;
       break;
     default:
     default:
       break;
       break;
@@ -349,17 +359,18 @@ __clnt_spcreateerror (const char *msg)
   *++cp = '\0';
   *++cp = '\0';
   return str;
   return str;
 }
 }
-strong_alias(__clnt_spcreateerror,clnt_spcreateerror)
+libc_hidden_proto(clnt_spcreateerror)
+libc_hidden_def(clnt_spcreateerror)
 
 
 void
 void
 clnt_pcreateerror (const char *msg)
 clnt_pcreateerror (const char *msg)
 {
 {
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
   if (_IO_fwide (stderr, 0) > 0)
   if (_IO_fwide (stderr, 0) > 0)
-    (void) __fwprintf (stderr, L"%s", __clnt_spcreateerror (msg));
+    (void) fwprintf (stderr, L"%s", clnt_spcreateerror (msg));
   else
   else
 #endif
 #endif
-    (void) fputs (__clnt_spcreateerror (msg), stderr);
+    (void) fputs (clnt_spcreateerror (msg), stderr);
 }
 }
 
 
 struct auth_errtab
 struct auth_errtab

+ 10 - 9
libc/inet/rpc/clnt_raw.c

@@ -42,20 +42,21 @@ static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
  * any interference from the kernel.
  * any interference from the kernel.
  */
  */
 
 
-#define authnone_create __authnone_create
-#define xdrmem_create __xdrmem_create
-#define xdr_callhdr __xdr_callhdr
-#define xdr_replymsg __xdr_replymsg
-#define xdr_opaque_auth __xdr_opaque_auth
-#define svc_getreq __svc_getreq
-#define _seterr_reply __seterr_reply
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include "rpc_private.h"
 #include "rpc_private.h"
 #include <rpc/svc.h>
 #include <rpc/svc.h>
 #include <rpc/xdr.h>
 #include <rpc/xdr.h>
 
 
+libc_hidden_proto(perror)
+libc_hidden_proto(authnone_create)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_callhdr)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xdr_opaque_auth)
+libc_hidden_proto(svc_getreq)
+libc_hidden_proto(_seterr_reply)
+
 #define MCALL_MSG_SIZE 24
 #define MCALL_MSG_SIZE 24
 
 
 /*
 /*
@@ -121,7 +122,7 @@ clntraw_create (u_long prog, u_long vers)
   xdrmem_create (xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE);
   xdrmem_create (xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE);
   if (!xdr_callhdr (xdrs, &call_msg))
   if (!xdr_callhdr (xdrs, &call_msg))
     {
     {
-      __perror (_ ("clnt_raw.c - Fatal header serialization error."));
+      perror (_ ("clnt_raw.c - Fatal header serialization error."));
     }
     }
   clp->mcnt = XDR_GETPOS (xdrs);
   clp->mcnt = XDR_GETPOS (xdrs);
   XDR_DESTROY (xdrs);
   XDR_DESTROY (xdrs);

+ 11 - 7
libc/inet/rpc/clnt_simple.c

@@ -38,9 +38,6 @@ static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define clntudp_create __clntudp_create
-#define gethostbyname_r __gethostbyname_r
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -53,6 +50,13 @@ static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro";
 #include <netdb.h>
 #include <netdb.h>
 #include <string.h>
 #include <string.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strncpy)
+libc_hidden_proto(close)
+libc_hidden_proto(clntudp_create)
+libc_hidden_proto(gethostbyname_r)
+
 struct callrpc_private_s
 struct callrpc_private_s
   {
   {
     CLIENT *client;
     CLIENT *client;
@@ -90,7 +94,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum,
       crp->socket = RPC_ANYSOCK;
       crp->socket = RPC_ANYSOCK;
     }
     }
   if (crp->valid && crp->oldprognum == prognum && crp->oldversnum == versnum
   if (crp->valid && crp->oldprognum == prognum && crp->oldversnum == versnum
-      && __strcmp (crp->oldhost, host) == 0)
+      && strcmp (crp->oldhost, host) == 0)
     {
     {
       /* reuse old client */
       /* reuse old client */
     }
     }
@@ -103,7 +107,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum,
       crp->valid = 0;
       crp->valid = 0;
       if (crp->socket != RPC_ANYSOCK)
       if (crp->socket != RPC_ANYSOCK)
 	{
 	{
-	  (void) __close (crp->socket);
+	  (void) close (crp->socket);
 	  crp->socket = RPC_ANYSOCK;
 	  crp->socket = RPC_ANYSOCK;
 	}
 	}
       if (crp->client)
       if (crp->client)
@@ -128,7 +132,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum,
 
 
       timeout.tv_usec = 0;
       timeout.tv_usec = 0;
       timeout.tv_sec = 5;
       timeout.tv_sec = 5;
-      __memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length);
+      memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length);
       server_addr.sin_family = AF_INET;
       server_addr.sin_family = AF_INET;
       server_addr.sin_port = 0;
       server_addr.sin_port = 0;
       if ((crp->client = clntudp_create (&server_addr, (u_long) prognum,
       if ((crp->client = clntudp_create (&server_addr, (u_long) prognum,
@@ -137,7 +141,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum,
       crp->valid = 1;
       crp->valid = 1;
       crp->oldprognum = prognum;
       crp->oldprognum = prognum;
       crp->oldversnum = versnum;
       crp->oldversnum = versnum;
-      (void) __strncpy (crp->oldhost, host, 255);
+      (void) strncpy (crp->oldhost, host, 255);
       crp->oldhost[255] = '\0';
       crp->oldhost[255] = '\0';
     }
     }
   tottimeout.tv_sec = 25;
   tottimeout.tv_sec = 25;

+ 34 - 30
libc/inet/rpc/clnt_tcp.c

@@ -50,21 +50,6 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
  * Now go hang yourself.
  * Now go hang yourself.
  */
  */
 
 
-#define authnone_create __authnone_create
-#define xdrrec_create __xdrrec_create
-#define xdrrec_endofrecord __xdrrec_endofrecord
-#define xdrrec_skiprecord __xdrrec_skiprecord
-#define xdr_callhdr __xdr_callhdr
-#define xdr_replymsg __xdr_replymsg
-#define xdr_opaque_auth __xdr_opaque_auth
-#define xdrmem_create __xdrmem_create
-#define pmap_getport __pmap_getport
-#define _seterr_reply __seterr_reply
-#define connect __connect
-#define bindresvport __bindresvport
-#define poll __poll
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -80,12 +65,30 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
 # include <wchar.h>
 # include <wchar.h>
 #endif
 #endif
 
 
-extern u_long _create_xid (void) attribute_hidden;
+libc_hidden_proto(socket)
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(close)
+libc_hidden_proto(authnone_create)
+libc_hidden_proto(xdrrec_create)
+libc_hidden_proto(xdrrec_endofrecord)
+libc_hidden_proto(xdrrec_skiprecord)
+libc_hidden_proto(xdr_callhdr)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xdr_opaque_auth)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(pmap_getport)
+libc_hidden_proto(_seterr_reply)
+libc_hidden_proto(connect)
+libc_hidden_proto(bindresvport)
+libc_hidden_proto(poll)
+libc_hidden_proto(fputs)
+#ifdef USE_IN_LIBIO
+libc_hidden_proto(fwprintf)
+#endif
+libc_hidden_proto(__rpc_thread_createerr)
 
 
-#undef get_rpc_createerr
+extern u_long _create_xid (void) attribute_hidden;
-extern struct rpc_createerr *__rpc_thread_createerr_internal (void)
-     __attribute__ ((__const__)) attribute_hidden;
-#define get_rpc_createerr() (*__rpc_thread_createerr_internal ())
 
 
 #define MCALL_MSG_SIZE 24
 #define MCALL_MSG_SIZE 24
 
 
@@ -137,8 +140,8 @@ static struct clnt_ops tcp_ops =
  * NB: The rpch->cl_auth is set null authentication.  Caller may wish to set this
  * NB: The rpch->cl_auth is set null authentication.  Caller may wish to set this
  * something more useful.
  * something more useful.
  */
  */
-CLIENT attribute_hidden *
+CLIENT *
-__clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
+clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
 		int *sockp, u_int sendsz, u_int recvsz)
 		int *sockp, u_int sendsz, u_int recvsz)
 {
 {
   CLIENT *h;
   CLIENT *h;
@@ -152,7 +155,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
       struct rpc_createerr *ce = &get_rpc_createerr ();
       struct rpc_createerr *ce = &get_rpc_createerr ();
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
       if (_IO_fwide (stderr, 0) > 0)
-	(void) __fwprintf (stderr, L"%s",
+	(void) fwprintf (stderr, L"%s",
 			   _("clnttcp_create: out of memory\n"));
 			   _("clnttcp_create: out of memory\n"));
       else
       else
 #endif
 #endif
@@ -182,7 +185,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
    */
    */
   if (*sockp < 0)
   if (*sockp < 0)
     {
     {
-      *sockp = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+      *sockp = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
       (void) bindresvport (*sockp, (struct sockaddr_in *) 0);
       (void) bindresvport (*sockp, (struct sockaddr_in *) 0);
       if ((*sockp < 0)
       if ((*sockp < 0)
 	  || (connect (*sockp, (struct sockaddr *) raddr,
 	  || (connect (*sockp, (struct sockaddr *) raddr,
@@ -192,7 +195,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
 	  ce->cf_stat = RPC_SYSTEMERROR;
 	  ce->cf_stat = RPC_SYSTEMERROR;
 	  ce->cf_error.re_errno = errno;
 	  ce->cf_error.re_errno = errno;
 	  if (*sockp >= 0)
 	  if (*sockp >= 0)
-	    (void) __close (*sockp);
+	    (void) close (*sockp);
 	  goto fooy;
 	  goto fooy;
 	}
 	}
       ct->ct_closeit = TRUE;
       ct->ct_closeit = TRUE;
@@ -228,7 +231,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
     {
     {
       if (ct->ct_closeit)
       if (ct->ct_closeit)
 	{
 	{
-	  (void) __close (*sockp);
+	  (void) close (*sockp);
 	}
 	}
       goto fooy;
       goto fooy;
     }
     }
@@ -254,7 +257,8 @@ fooy:
   mem_free ((caddr_t) h, sizeof (CLIENT));
   mem_free ((caddr_t) h, sizeof (CLIENT));
   return ((CLIENT *) NULL);
   return ((CLIENT *) NULL);
 }
 }
-strong_alias(__clnttcp_create,clnttcp_create)
+libc_hidden_proto(clnttcp_create)
+libc_hidden_def(clnttcp_create)
 
 
 static enum clnt_stat
 static enum clnt_stat
 clnttcp_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
 clnttcp_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
@@ -482,7 +486,7 @@ clnttcp_destroy (CLIENT *h)
 
 
   if (ct->ct_closeit)
   if (ct->ct_closeit)
     {
     {
-      (void) __close (ct->ct_sock);
+      (void) close (ct->ct_sock);
     }
     }
   XDR_DESTROY (&(ct->ct_xdrs));
   XDR_DESTROY (&(ct->ct_xdrs));
   mem_free ((caddr_t) ct, sizeof (struct ct_data));
   mem_free ((caddr_t) ct, sizeof (struct ct_data));
@@ -524,7 +528,7 @@ readtcp (char *ctptr, char *buf, int len)
 	}
 	}
       break;
       break;
     }
     }
-  switch (len = __read (ct->ct_sock, buf, len))
+  switch (len = read (ct->ct_sock, buf, len))
     {
     {
 
 
     case 0:
     case 0:
@@ -550,7 +554,7 @@ writetcp (char *ctptr, char *buf, int len)
 
 
   for (cnt = len; cnt > 0; cnt -= i, buf += i)
   for (cnt = len; cnt > 0; cnt -= i, buf += i)
     {
     {
-      if ((i = __write (ct->ct_sock, buf, cnt)) == -1)
+      if ((i = write (ct->ct_sock, buf, cnt)) == -1)
 	{
 	{
 	  ct->ct_error.re_errno = errno;
 	  ct->ct_error.re_errno = errno;
 	  ct->ct_error.re_status = RPC_CANTSEND;
 	  ct->ct_error.re_status = RPC_CANTSEND;

+ 41 - 38
libc/inet/rpc/clnt_udp.c

@@ -37,24 +37,6 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-/* CMSG_NXTHDR is using it */
-#define __cmsg_nxthdr __cmsg_nxthdr_internal
-
-#define authnone_create __authnone_create
-#define xdrmem_create __xdrmem_create
-#define xdr_callhdr __xdr_callhdr
-#define xdr_replymsg __xdr_replymsg
-#define xdr_opaque_auth __xdr_opaque_auth
-#define pmap_getport __pmap_getport
-#define _seterr_reply __seterr_reply
-#define setsockopt __setsockopt
-#define bindresvport __bindresvport
-#define recvfrom __recvfrom
-#define sendto __sendto
-#define recvmsg __recvmsg
-#define poll __poll
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -72,6 +54,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
 #include <net/if.h>
 #include <net/if.h>
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
 # include <wchar.h>
 # include <wchar.h>
+libc_hidden_proto(fwprintf)
 #endif
 #endif
 
 
 #ifdef IP_RECVERR
 #ifdef IP_RECVERR
@@ -79,12 +62,30 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
 #include <sys/uio.h>
 #include <sys/uio.h>
 #endif
 #endif
 
 
-extern u_long _create_xid (void) attribute_hidden;
+libc_hidden_proto(memcmp)
+libc_hidden_proto(ioctl)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+/* CMSG_NXTHDR is using it */
+libc_hidden_proto(__cmsg_nxthdr)
+
+libc_hidden_proto(authnone_create)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_callhdr)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xdr_opaque_auth)
+libc_hidden_proto(pmap_getport)
+libc_hidden_proto(_seterr_reply)
+libc_hidden_proto(setsockopt)
+libc_hidden_proto(bindresvport)
+libc_hidden_proto(recvfrom)
+libc_hidden_proto(sendto)
+libc_hidden_proto(recvmsg)
+libc_hidden_proto(poll)
+libc_hidden_proto(fputs)
+libc_hidden_proto(__rpc_thread_createerr)
 
 
-#undef get_rpc_createerr
+extern u_long _create_xid (void) attribute_hidden;
-extern struct rpc_createerr *__rpc_thread_createerr_internal (void)
-     __attribute__ ((__const__)) attribute_hidden;
-#define get_rpc_createerr() (*__rpc_thread_createerr_internal ())
 
 
 /*
 /*
  * UDP bases client side rpc operations
  * UDP bases client side rpc operations
@@ -143,8 +144,8 @@ struct cu_data
  * sendsz and recvsz are the maximum allowable packet sizes that can be
  * sendsz and recvsz are the maximum allowable packet sizes that can be
  * sent and received.
  * sent and received.
  */
  */
-CLIENT attribute_hidden *
+CLIENT *
-__clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
+clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
 		   struct timeval wait, int *sockp, u_int sendsz,
 		   struct timeval wait, int *sockp, u_int sendsz,
 		   u_int recvsz)
 		   u_int recvsz)
 {
 {
@@ -161,7 +162,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
       struct rpc_createerr *ce = &get_rpc_createerr ();
       struct rpc_createerr *ce = &get_rpc_createerr ();
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
       if (_IO_fwide (stderr, 0) > 0)
-	(void) __fwprintf (stderr, L"%s",
+	(void) fwprintf (stderr, L"%s",
 			   _("clntudp_create: out of memory\n"));
 			   _("clntudp_create: out of memory\n"));
       else
       else
 #endif
 #endif
@@ -207,7 +208,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
     {
     {
       int dontblock = 1;
       int dontblock = 1;
 
 
-      *sockp = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+      *sockp = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
       if (*sockp < 0)
       if (*sockp < 0)
 	{
 	{
 	  struct rpc_createerr *ce = &get_rpc_createerr ();
 	  struct rpc_createerr *ce = &get_rpc_createerr ();
@@ -218,7 +219,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
       /* attempt to bind to prov port */
       /* attempt to bind to prov port */
       (void) bindresvport (*sockp, (struct sockaddr_in *) 0);
       (void) bindresvport (*sockp, (struct sockaddr_in *) 0);
       /* the sockets rpc controls are non-blocking */
       /* the sockets rpc controls are non-blocking */
-      (void) __ioctl (*sockp, FIONBIO, (char *) &dontblock);
+      (void) ioctl (*sockp, FIONBIO, (char *) &dontblock);
 #ifdef IP_RECVERR
 #ifdef IP_RECVERR
       {
       {
 	int on = 1;
 	int on = 1;
@@ -241,16 +242,18 @@ fooy:
     mem_free ((caddr_t) cl, sizeof (CLIENT));
     mem_free ((caddr_t) cl, sizeof (CLIENT));
   return (CLIENT *) NULL;
   return (CLIENT *) NULL;
 }
 }
-strong_alias(__clntudp_bufcreate,clntudp_bufcreate)
+libc_hidden_proto(clntudp_bufcreate)
+libc_hidden_def(clntudp_bufcreate)
 
 
-CLIENT attribute_hidden *
+CLIENT *
-__clntudp_create (struct sockaddr_in *raddr, u_long program, u_long version, struct timeval wait, int *sockp)
+clntudp_create (struct sockaddr_in *raddr, u_long program, u_long version, struct timeval wait, int *sockp)
 {
 {
 
 
-  return __clntudp_bufcreate (raddr, program, version, wait, sockp,
+  return clntudp_bufcreate (raddr, program, version, wait, sockp,
 			    UDPMSGSIZE, UDPMSGSIZE);
 			    UDPMSGSIZE, UDPMSGSIZE);
 }
 }
-strong_alias(__clntudp_create,clntudp_create)
+libc_hidden_proto(clntudp_create)
+libc_hidden_def(clntudp_create)
 
 
 static int
 static int
 is_network_up (int sock)
 is_network_up (int sock)
@@ -262,13 +265,13 @@ is_network_up (int sock)
 
 
   ifc.ifc_len = sizeof (buf);
   ifc.ifc_len = sizeof (buf);
   ifc.ifc_buf = buf;
   ifc.ifc_buf = buf;
-  if (__ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0)
+  if (ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0)
     {
     {
       ifr = ifc.ifc_req;
       ifr = ifc.ifc_req;
       for (n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
       for (n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
 	{
 	{
 	  ifreq = *ifr;
 	  ifreq = *ifr;
-	  if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
+	  if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
 	    break;
 	    break;
 
 
 	  if ((ifreq.ifr_flags & IFF_UP)
 	  if ((ifreq.ifr_flags & IFF_UP)
@@ -419,13 +422,13 @@ send_again:
 	  msg.msg_controllen = 256;
 	  msg.msg_controllen = 256;
 	  ret = recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE);
 	  ret = recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE);
 	  if (ret >= 0
 	  if (ret >= 0
-	      && __memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0
+	      && memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0
 	      && (msg.msg_flags & MSG_ERRQUEUE)
 	      && (msg.msg_flags & MSG_ERRQUEUE)
 	      && ((msg.msg_namelen == 0
 	      && ((msg.msg_namelen == 0
 		   && ret >= 12)
 		   && ret >= 12)
 		  || (msg.msg_namelen == sizeof (err_addr)
 		  || (msg.msg_namelen == sizeof (err_addr)
 		      && err_addr.sin_family == AF_INET
 		      && err_addr.sin_family == AF_INET
-		      && __memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr,
+		      && memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr,
 				 sizeof (err_addr.sin_addr)) == 0
 				 sizeof (err_addr.sin_addr)) == 0
 		      && err_addr.sin_port == cu->cu_raddr.sin_port)))
 		      && err_addr.sin_port == cu->cu_raddr.sin_port)))
 	    for (cmsg = CMSG_FIRSTHDR (&msg); cmsg;
 	    for (cmsg = CMSG_FIRSTHDR (&msg); cmsg;
@@ -620,7 +623,7 @@ clntudp_destroy (CLIENT *cl)
 
 
   if (cu->cu_closeit)
   if (cu->cu_closeit)
     {
     {
-      (void) __close (cu->cu_sock);
+      (void) close (cu->cu_sock);
     }
     }
   XDR_DESTROY (&(cu->cu_outxdrs));
   XDR_DESTROY (&(cu->cu_outxdrs));
   mem_free ((caddr_t) cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz));
   mem_free ((caddr_t) cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz));

+ 37 - 34
libc/inet/rpc/clnt_unix.c

@@ -46,24 +46,6 @@
  * Now go hang yourself.
  * Now go hang yourself.
  */
  */
 
 
-#define authnone_create __authnone_create
-#define xdrrec_create __xdrrec_create
-#define xdrrec_endofrecord __xdrrec_endofrecord
-#define xdrrec_skiprecord __xdrrec_skiprecord
-#define xdr_callhdr __xdr_callhdr
-#define xdr_replymsg __xdr_replymsg
-#define xdr_opaque_auth __xdr_opaque_auth
-#define xdrmem_create __xdrmem_create
-#define getegid __getegid
-#define geteuid __geteuid
-#define _seterr_reply __seterr_reply
-#define setsockopt __setsockopt
-#define connect __connect
-#define recvmsg __recvmsg
-#define sendmsg __sendmsg
-#define poll __poll
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -78,14 +60,34 @@
 #include <rpc/pmap_clnt.h>
 #include <rpc/pmap_clnt.h>
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
 # include <wchar.h>
 # include <wchar.h>
+libc_hidden_proto(fwprintf)
 #endif
 #endif
 
 
-extern u_long _create_xid (void) attribute_hidden;
+libc_hidden_proto(strlen)
+libc_hidden_proto(memcpy)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(getpid)
+libc_hidden_proto(authnone_create)
+libc_hidden_proto(xdrrec_create)
+libc_hidden_proto(xdrrec_endofrecord)
+libc_hidden_proto(xdrrec_skiprecord)
+libc_hidden_proto(xdr_callhdr)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xdr_opaque_auth)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(getegid)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(_seterr_reply)
+libc_hidden_proto(setsockopt)
+libc_hidden_proto(connect)
+libc_hidden_proto(recvmsg)
+libc_hidden_proto(sendmsg)
+libc_hidden_proto(poll)
+libc_hidden_proto(fputs)
+libc_hidden_proto(__rpc_thread_createerr)
 
 
-#undef get_rpc_createerr
+extern u_long _create_xid (void) attribute_hidden;
-extern struct rpc_createerr *__rpc_thread_createerr_internal (void)
-     __attribute__ ((__const__)) attribute_hidden;
-#define get_rpc_createerr() (*__rpc_thread_createerr_internal ())
 
 
 #define MCALL_MSG_SIZE 24
 #define MCALL_MSG_SIZE 24
 
 
@@ -137,8 +139,8 @@ static struct clnt_ops unix_ops =
  * NB: The rpch->cl_auth is set null authentication.  Caller may wish to set this
  * NB: The rpch->cl_auth is set null authentication.  Caller may wish to set this
  * something more useful.
  * something more useful.
  */
  */
-CLIENT attribute_hidden *
+CLIENT *
-__clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
+clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
 		 int *sockp, u_int sendsz, u_int recvsz)
 		 int *sockp, u_int sendsz, u_int recvsz)
 {
 {
   CLIENT *h;
   CLIENT *h;
@@ -152,7 +154,7 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
       struct rpc_createerr *ce = &get_rpc_createerr ();
       struct rpc_createerr *ce = &get_rpc_createerr ();
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
       if (_IO_fwide (stderr, 0) > 0)
-	(void) __fwprintf (stderr, L"%s",
+	(void) fwprintf (stderr, L"%s",
 			   _("clntunix_create: out of memory\n"));
 			   _("clntunix_create: out of memory\n"));
       else
       else
 #endif
 #endif
@@ -167,8 +169,8 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
    */
    */
   if (*sockp < 0)
   if (*sockp < 0)
     {
     {
-      *sockp = __socket (AF_UNIX, SOCK_STREAM, 0);
+      *sockp = socket (AF_UNIX, SOCK_STREAM, 0);
-      len = __strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1;
+      len = strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1;
       if (*sockp < 0
       if (*sockp < 0
 	  || connect (*sockp, (struct sockaddr *) raddr, len) < 0)
 	  || connect (*sockp, (struct sockaddr *) raddr, len) < 0)
 	{
 	{
@@ -176,7 +178,7 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
 	  ce->cf_stat = RPC_SYSTEMERROR;
 	  ce->cf_stat = RPC_SYSTEMERROR;
 	  ce->cf_error.re_errno = errno;
 	  ce->cf_error.re_errno = errno;
 	  if (*sockp != -1)
 	  if (*sockp != -1)
-	    __close (*sockp);
+	    close (*sockp);
 	  goto fooy;
 	  goto fooy;
 	}
 	}
       ct->ct_closeit = TRUE;
       ct->ct_closeit = TRUE;
@@ -210,7 +212,7 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
   if (!xdr_callhdr (&(ct->ct_xdrs), &call_msg))
   if (!xdr_callhdr (&(ct->ct_xdrs), &call_msg))
     {
     {
       if (ct->ct_closeit)
       if (ct->ct_closeit)
-	__close (*sockp);
+	close (*sockp);
       goto fooy;
       goto fooy;
     }
     }
   ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs));
   ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs));
@@ -235,7 +237,8 @@ fooy:
   mem_free ((caddr_t) h, sizeof (CLIENT));
   mem_free ((caddr_t) h, sizeof (CLIENT));
   return (CLIENT *) NULL;
   return (CLIENT *) NULL;
 }
 }
-strong_alias(__clntunix_create,clntunix_create)
+libc_hidden_proto(clntunix_create)
+libc_hidden_def(clntunix_create)
 
 
 static enum clnt_stat
 static enum clnt_stat
 clntunix_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
 clntunix_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
@@ -457,7 +460,7 @@ clntunix_destroy (CLIENT *h)
 
 
   if (ct->ct_closeit)
   if (ct->ct_closeit)
     {
     {
-      (void) __close (ct->ct_sock);
+      (void) close (ct->ct_sock);
     }
     }
   XDR_DESTROY (&(ct->ct_xdrs));
   XDR_DESTROY (&(ct->ct_xdrs));
   mem_free ((caddr_t) ct, sizeof (struct ct_data));
   mem_free ((caddr_t) ct, sizeof (struct ct_data));
@@ -526,11 +529,11 @@ __msgwrite (int sock, void *data, size_t cnt)
   /* XXX I'm not sure, if gete?id() is always correct, or if we should use
   /* XXX I'm not sure, if gete?id() is always correct, or if we should use
      get?id(). But since keyserv needs geteuid(), we have no other chance.
      get?id(). But since keyserv needs geteuid(), we have no other chance.
      It would be much better, if the kernel could pass both to the server. */
      It would be much better, if the kernel could pass both to the server. */
-  cred.pid = __getpid ();
+  cred.pid = getpid ();
   cred.uid = geteuid ();
   cred.uid = geteuid ();
   cred.gid = getegid ();
   cred.gid = getegid ();
 
 
-  __memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred));
+  memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred));
   cmsg->cmsg_level = SOL_SOCKET;
   cmsg->cmsg_level = SOL_SOCKET;
   cmsg->cmsg_type = SCM_CREDENTIALS;
   cmsg->cmsg_type = SCM_CREDENTIALS;
   cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct ucred);
   cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct ucred);

+ 4 - 4
libc/inet/rpc/create_xid.c

@@ -17,10 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define lrand48_r __lrand48_r
-#define srand48_r __srand48_r
-#define gettimeofday __gettimeofday
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -29,6 +25,10 @@
 #include <sys/time.h>
 #include <sys/time.h>
 #include <rpc/rpc.h>
 #include <rpc/rpc.h>
 
 
+libc_hidden_proto(lrand48_r)
+libc_hidden_proto(srand48_r)
+libc_hidden_proto(gettimeofday)
+
 /* The RPC code is not threadsafe, but new code should be threadsafe. */
 /* The RPC code is not threadsafe, but new code should be threadsafe. */
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__

+ 17 - 11
libc/inet/rpc/get_myaddress.c

@@ -50,6 +50,12 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 
 
+libc_hidden_proto(ioctl)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(perror)
+libc_hidden_proto(exit)
+
 /*
 /*
  * don't use gethostbyname, which would invoke yellow pages
  * don't use gethostbyname, which would invoke yellow pages
  *
  *
@@ -65,17 +71,17 @@ get_myaddress (struct sockaddr_in *addr)
   struct ifreq ifreq, *ifr;
   struct ifreq ifreq, *ifr;
   int len, loopback = 0;
   int len, loopback = 0;
 
 
-  if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+  if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
     {
     {
-      __perror ("get_myaddress: socket");
+      perror ("get_myaddress: socket");
-      __exit (1);
+      exit (1);
     }
     }
   ifc.ifc_len = sizeof (buf);
   ifc.ifc_len = sizeof (buf);
   ifc.ifc_buf = buf;
   ifc.ifc_buf = buf;
-  if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
+  if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
     {
     {
-      __perror (_("get_myaddress: ioctl (get interface configuration)"));
+      perror (_("get_myaddress: ioctl (get interface configuration)"));
-      __exit (1);
+      exit (1);
     }
     }
 
 
  again:
  again:
@@ -83,10 +89,10 @@ get_myaddress (struct sockaddr_in *addr)
   for (len = ifc.ifc_len; len; len -= sizeof ifreq)
   for (len = ifc.ifc_len; len; len -= sizeof ifreq)
     {
     {
       ifreq = *ifr;
       ifreq = *ifr;
-      if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
+      if (ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
 	{
 	{
-          __perror ("get_myaddress: ioctl");
+          perror ("get_myaddress: ioctl");
-          __exit (1);
+          exit (1);
 	}
 	}
       if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
       if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
 	  && (!(ifreq.ifr_flags & IFF_LOOPBACK) ||
 	  && (!(ifreq.ifr_flags & IFF_LOOPBACK) ||
@@ -94,7 +100,7 @@ get_myaddress (struct sockaddr_in *addr)
 	{
 	{
 	  *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
 	  *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
 	  addr->sin_port = htons (PMAPPORT);
 	  addr->sin_port = htons (PMAPPORT);
-	  __close (s);
+	  close (s);
 	  return;
 	  return;
 	}
 	}
       ifr++;
       ifr++;
@@ -104,5 +110,5 @@ get_myaddress (struct sockaddr_in *addr)
       loopback = 1;
       loopback = 1;
       goto again;
       goto again;
     }
     }
-  __close (s);
+  close (s);
 }
 }

+ 54 - 42
libc/inet/rpc/getrpcent.c

@@ -33,10 +33,6 @@
  * Copyright (c) 1985 by Sun Microsystems, Inc.
  * Copyright (c) 1985 by Sun Microsystems, Inc.
  */
  */
 
 
-#define atoi __atoi
-#define rewind __rewind
-#define fgets __fgets
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -48,6 +44,17 @@
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 #include <errno.h>
 #include <errno.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strlen)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(atoi)
+libc_hidden_proto(rewind)
+libc_hidden_proto(fgets)
+
 /*
 /*
  * Internet version.
  * Internet version.
  */
  */
@@ -77,7 +84,7 @@ static struct rpcdata *_rpcdata(void)
 	return d;
 	return d;
 }
 }
 
 
-void attribute_hidden __endrpcent(void)
+void endrpcent(void)
 {
 {
 	register struct rpcdata *d = _rpcdata();
 	register struct rpcdata *d = _rpcdata();
 
 
@@ -94,9 +101,10 @@ void attribute_hidden __endrpcent(void)
 		d->rpcf = NULL;
 		d->rpcf = NULL;
 	}
 	}
 }
 }
-strong_alias(__endrpcent,endrpcent)
+libc_hidden_proto(endrpcent)
+libc_hidden_def(endrpcent)
 
 
-void attribute_hidden __setrpcent(int f)
+void setrpcent(int f)
 {
 {
 	register struct rpcdata *d = _rpcdata();
 	register struct rpcdata *d = _rpcdata();
 
 
@@ -111,7 +119,8 @@ void attribute_hidden __setrpcent(int f)
 	d->current = NULL;
 	d->current = NULL;
 	d->stayopen |= f;
 	d->stayopen |= f;
 }
 }
-strong_alias(__setrpcent,setrpcent)
+libc_hidden_proto(setrpcent)
+libc_hidden_def(setrpcent)
 
 
 static struct rpcent *interpret(struct rpcdata *);
 static struct rpcent *interpret(struct rpcdata *);
 
 
@@ -122,7 +131,7 @@ static struct rpcent *__get_next_rpcent(struct rpcdata *d)
 	return interpret(d);
 	return interpret(d);
 }
 }
 
 
-struct rpcent attribute_hidden *__getrpcent(void)
+struct rpcent *getrpcent(void)
 {
 {
 	register struct rpcdata *d = _rpcdata();
 	register struct rpcdata *d = _rpcdata();
 
 
@@ -132,51 +141,54 @@ struct rpcent attribute_hidden *__getrpcent(void)
 		return NULL;
 		return NULL;
 	return __get_next_rpcent(d);
 	return __get_next_rpcent(d);
 }
 }
-strong_alias(__getrpcent,getrpcent)
+libc_hidden_proto(getrpcent)
+libc_hidden_def(getrpcent)
 
 
-struct rpcent attribute_hidden *__getrpcbynumber(register int number)
+struct rpcent *getrpcbynumber(register int number)
 {
 {
 	register struct rpcdata *d = _rpcdata();
 	register struct rpcdata *d = _rpcdata();
 	register struct rpcent *rpc;
 	register struct rpcent *rpc;
 
 
 	if (d == NULL)
 	if (d == NULL)
 		return NULL;
 		return NULL;
-	__setrpcent(0);
+	setrpcent(0);
-	while ((rpc = __getrpcent())) {
+	while ((rpc = getrpcent())) {
 		if (rpc->r_number == number)
 		if (rpc->r_number == number)
 			break;
 			break;
 	}
 	}
-	__endrpcent();
+	endrpcent();
 	return rpc;
 	return rpc;
 }
 }
-strong_alias(__getrpcbynumber,getrpcbynumber)
+libc_hidden_proto(getrpcbynumber)
+libc_hidden_def(getrpcbynumber)
 
 
-struct rpcent attribute_hidden *__getrpcbyname(const char *name)
+struct rpcent *getrpcbyname(const char *name)
 {
 {
 	struct rpcent *rpc;
 	struct rpcent *rpc;
 	char **rp;
 	char **rp;
 
 
-	__setrpcent(0);
+	setrpcent(0);
-	while ((rpc = __getrpcent())) {
+	while ((rpc = getrpcent())) {
-		if (__strcmp(rpc->r_name, name) == 0)
+		if (strcmp(rpc->r_name, name) == 0)
 			return rpc;
 			return rpc;
 		for (rp = rpc->r_aliases; *rp != NULL; rp++) {
 		for (rp = rpc->r_aliases; *rp != NULL; rp++) {
-			if (__strcmp(*rp, name) == 0)
+			if (strcmp(*rp, name) == 0)
 				return rpc;
 				return rpc;
 		}
 		}
 	}
 	}
-	__endrpcent();
+	endrpcent();
 	return NULL;
 	return NULL;
 }
 }
-strong_alias(__getrpcbyname,getrpcbyname)
+libc_hidden_proto(getrpcbyname)
+libc_hidden_def(getrpcbyname)
 
 
 #ifdef __linux__
 #ifdef __linux__
 static char *firstwhite(char *s)
 static char *firstwhite(char *s)
 {
 {
 	char *s1, *s2;
 	char *s1, *s2;
 
 
-	s1 = __strchr(s, ' ');
+	s1 = strchr(s, ' ');
-	s2 = __strchr(s, '\t');
+	s2 = strchr(s, '\t');
 	if (s1) {
 	if (s1) {
 		if (s2)
 		if (s2)
 			return (s1 < s2) ? s1 : s2;
 			return (s1 < s2) ? s1 : s2;
@@ -193,12 +205,12 @@ static struct rpcent *interpret(register struct rpcdata *d)
 	register char *cp, **q;
 	register char *cp, **q;
 
 
 	p = d->line;
 	p = d->line;
-	d->line[__strlen(p)-1] = '\n';
+	d->line[strlen(p)-1] = '\n';
 	if (*p == '#')
 	if (*p == '#')
 		return __get_next_rpcent(d);
 		return __get_next_rpcent(d);
-	cp = __strchr(p, '#');
+	cp = strchr(p, '#');
 	if (cp == NULL) {
 	if (cp == NULL) {
-		cp = __strchr(p, '\n');
+		cp = strchr(p, '\n');
 		if (cp == NULL)
 		if (cp == NULL)
 			return __get_next_rpcent(d);
 			return __get_next_rpcent(d);
 	}
 	}
@@ -209,9 +221,9 @@ static struct rpcent *interpret(register struct rpcdata *d)
 	else
 	else
 		return __get_next_rpcent(d);
 		return __get_next_rpcent(d);
 #else
 #else
-	cp = __strchr(p, ' ');
+	cp = strchr(p, ' ');
 	if (cp == NULL) {
 	if (cp == NULL) {
-		cp = __strchr(p, '\t');
+		cp = strchr(p, '\t');
 		if (cp == NULL)
 		if (cp == NULL)
 			return __get_next_rpcent(d);
 			return __get_next_rpcent(d);
 	}
 	}
@@ -227,11 +239,11 @@ static struct rpcent *interpret(register struct rpcdata *d)
 	if ((cp = firstwhite(cp)))
 	if ((cp = firstwhite(cp)))
 		*cp++ = '\0';
 		*cp++ = '\0';
 #else
 #else
-	cp = __strchr(p, ' ');
+	cp = strchr(p, ' ');
 	if (cp != NULL)
 	if (cp != NULL)
 		*cp++ = '\0';
 		*cp++ = '\0';
 	else {
 	else {
-		cp = __strchr(p, '\t');
+		cp = strchr(p, '\t');
 		if (cp != NULL)
 		if (cp != NULL)
 			*cp++ = '\0';
 			*cp++ = '\0';
 	}
 	}
@@ -247,11 +259,11 @@ static struct rpcent *interpret(register struct rpcdata *d)
 		if ((cp = firstwhite(cp)))
 		if ((cp = firstwhite(cp)))
 			*cp++ = '\0';
 			*cp++ = '\0';
 #else
 #else
-		cp = __strchr(p, ' ');
+		cp = strchr(p, ' ');
 		if (cp != NULL)
 		if (cp != NULL)
 			*cp++ = '\0';
 			*cp++ = '\0';
 		else {
 		else {
-			cp = __strchr(p, '\t');
+			cp = strchr(p, '\t');
 			if (cp != NULL)
 			if (cp != NULL)
 				*cp++ = '\0';
 				*cp++ = '\0';
 		}
 		}
@@ -281,8 +293,8 @@ static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buff
 		return ENOENT;
 		return ENOENT;
 
 
 	/* copy the struct from the shared mem */
 	/* copy the struct from the shared mem */
-	__memset(result_buf, 0x00, sizeof(*result_buf));
+	memset(result_buf, 0x00, sizeof(*result_buf));
-	__memset(buffer, 0x00, buflen);
+	memset(buffer, 0x00, buflen);
 
 
 	result_buf->r_number = r->r_number;
 	result_buf->r_number = r->r_number;
 
 
@@ -299,21 +311,21 @@ static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buff
 	buflen -= s;
 	buflen -= s;
 
 
 	while (i-- > 0) {
 	while (i-- > 0) {
-		s = __strlen(r->r_aliases[i]) + 1;
+		s = strlen(r->r_aliases[i]) + 1;
 		if (buflen < s)
 		if (buflen < s)
 			goto err_out;
 			goto err_out;
 		result_buf->r_aliases[i] = buffer;
 		result_buf->r_aliases[i] = buffer;
 		buffer += s;
 		buffer += s;
 		buflen -= s;
 		buflen -= s;
-		__memcpy(result_buf->r_aliases[i], r->r_aliases[i], s);
+		memcpy(result_buf->r_aliases[i], r->r_aliases[i], s);
 	}
 	}
 
 
 	/* copy the name */
 	/* copy the name */
-	i = __strlen(r->r_name);
+	i = strlen(r->r_name);
 	if (buflen <= i)
 	if (buflen <= i)
 		goto err_out;
 		goto err_out;
 	result_buf->r_name = buffer;
 	result_buf->r_name = buffer;
-	__memcpy(result_buf->r_name, r->r_name, i);
+	memcpy(result_buf->r_name, r->r_name, i);
 
 
 	/* that was a hoot eh ? */
 	/* that was a hoot eh ? */
 	*result = result_buf;
 	*result = result_buf;
@@ -328,7 +340,7 @@ int getrpcbynumber_r(int number, struct rpcent *result_buf, char *buffer,
 {
 {
 	int ret;
 	int ret;
 	LOCK;
 	LOCK;
-	ret = __copy_rpcent(__getrpcbynumber(number), result_buf, buffer, buflen, result);
+	ret = __copy_rpcent(getrpcbynumber(number), result_buf, buffer, buflen, result);
 	UNLOCK;
 	UNLOCK;
 	return ret;
 	return ret;
 }
 }
@@ -338,7 +350,7 @@ int getrpcbyname_r(const char *name, struct rpcent *result_buf, char *buffer,
 {
 {
 	int ret;
 	int ret;
 	LOCK;
 	LOCK;
-	ret = __copy_rpcent(__getrpcbyname(name), result_buf, buffer, buflen, result);
+	ret = __copy_rpcent(getrpcbyname(name), result_buf, buffer, buflen, result);
 	UNLOCK;
 	UNLOCK;
 	return ret;
 	return ret;
 }
 }
@@ -348,7 +360,7 @@ int getrpcent_r(struct rpcent *result_buf, char *buffer,
 {
 {
 	int ret;
 	int ret;
 	LOCK;
 	LOCK;
-	ret = __copy_rpcent(__getrpcent(), result_buf, buffer, buflen, result);
+	ret = __copy_rpcent(getrpcent(), result_buf, buffer, buflen, result);
 	UNLOCK;
 	UNLOCK;
 	return ret;
 	return ret;
 }
 }

+ 5 - 4
libc/inet/rpc/getrpcport.c

@@ -35,9 +35,6 @@ static  char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI";
  * Copyright (c) 1985 by Sun Microsystems, Inc.
  * Copyright (c) 1985 by Sun Microsystems, Inc.
  */
  */
 
 
-#define pmap_getport __pmap_getport
-#define gethostbyname_r __gethostbyname_r
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -51,6 +48,10 @@ static  char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI";
 #include <rpc/pmap_clnt.h>
 #include <rpc/pmap_clnt.h>
 #include <sys/socket.h>
 #include <sys/socket.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(pmap_getport)
+libc_hidden_proto(gethostbyname_r)
+
 int
 int
 getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto)
 getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto)
 {
 {
@@ -73,7 +74,7 @@ getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto)
 	buffer = alloca (buflen);
 	buffer = alloca (buflen);
       }
       }
 
 
-  __memcpy ((char *) &addr.sin_addr, hp->h_addr, hp->h_length);
+  memcpy ((char *) &addr.sin_addr, hp->h_addr, hp->h_length);
   addr.sin_family = AF_INET;
   addr.sin_family = AF_INET;
   addr.sin_port = 0;
   addr.sin_port = 0;
   return pmap_getport (&addr, prognum, versnum, proto);
   return pmap_getport (&addr, prognum, versnum, proto);

+ 30 - 23
libc/inet/rpc/pmap_clnt.c

@@ -34,10 +34,6 @@
  * Client interface to pmap rpc service.
  * Client interface to pmap rpc service.
  */
  */
 
 
-#define clnt_perror __clnt_perror
-#define clntudp_bufcreate __clntudp_bufcreate
-#define xdr_bool __xdr_bool
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -52,6 +48,15 @@
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_clnt.h>
 #include <rpc/pmap_clnt.h>
 
 
+libc_hidden_proto(ioctl)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(perror)
+libc_hidden_proto(exit)
+libc_hidden_proto(clnt_perror)
+libc_hidden_proto(clntudp_bufcreate)
+libc_hidden_proto(xdr_bool)
+
 /*
 /*
  * Same as get_myaddress, but we try to use the loopback
  * Same as get_myaddress, but we try to use the loopback
  * interface. portmap caches interfaces, and on DHCP clients,
  * interface. portmap caches interfaces, and on DHCP clients,
@@ -66,17 +71,17 @@ __get_myaddress (struct sockaddr_in *addr)
   struct ifreq ifreq, *ifr;
   struct ifreq ifreq, *ifr;
   int len, loopback = 1;
   int len, loopback = 1;
 
 
-  if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+  if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
     {
     {
-      __perror ("__get_myaddress: socket");
+      perror ("__get_myaddress: socket");
-      __exit (1);
+      exit (1);
     }
     }
   ifc.ifc_len = sizeof (buf);
   ifc.ifc_len = sizeof (buf);
   ifc.ifc_buf = buf;
   ifc.ifc_buf = buf;
-  if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
+  if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
     {
     {
-      __perror (_("__get_myaddress: ioctl (get interface configuration)"));
+      perror (_("__get_myaddress: ioctl (get interface configuration)"));
-      __exit (1);
+      exit (1);
     }
     }
 
 
  again:
  again:
@@ -84,17 +89,17 @@ __get_myaddress (struct sockaddr_in *addr)
   for (len = ifc.ifc_len; len; len -= sizeof ifreq)
   for (len = ifc.ifc_len; len; len -= sizeof ifreq)
     {
     {
       ifreq = *ifr;
       ifreq = *ifr;
-      if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
+      if (ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
         {
         {
-          __perror ("__get_myaddress: ioctl");
+          perror ("__get_myaddress: ioctl");
-          __exit (1);
+          exit (1);
         }
         }
       if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
       if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
           && ((ifreq.ifr_flags & IFF_LOOPBACK) || (loopback == 0)))
           && ((ifreq.ifr_flags & IFF_LOOPBACK) || (loopback == 0)))
         {
         {
           *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
           *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
           addr->sin_port = htons (PMAPPORT);
           addr->sin_port = htons (PMAPPORT);
-          __close (s);
+          close (s);
           return TRUE;
           return TRUE;
         }
         }
       ifr++;
       ifr++;
@@ -104,7 +109,7 @@ __get_myaddress (struct sockaddr_in *addr)
       loopback = 0;
       loopback = 0;
       goto again;
       goto again;
     }
     }
-  __close (s);
+  close (s);
   return FALSE;
   return FALSE;
 }
 }
 
 
@@ -116,8 +121,8 @@ static const struct timeval tottimeout = {60, 0};
  * Set a mapping between program,version and port.
  * Set a mapping between program,version and port.
  * Calls the pmap service remotely to do the mapping.
  * Calls the pmap service remotely to do the mapping.
  */
  */
-bool_t attribute_hidden
+bool_t
-__pmap_set (u_long program, u_long version, int protocol, u_short port)
+pmap_set (u_long program, u_long version, int protocol, u_short port)
 {
 {
   struct sockaddr_in myaddress;
   struct sockaddr_in myaddress;
   int socket = -1;
   int socket = -1;
@@ -143,17 +148,18 @@ __pmap_set (u_long program, u_long version, int protocol, u_short port)
       return FALSE;
       return FALSE;
     }
     }
   CLNT_DESTROY (client);
   CLNT_DESTROY (client);
-  /* (void)__close(socket); CLNT_DESTROY closes it */
+  /* (void)close(socket); CLNT_DESTROY closes it */
   return rslt;
   return rslt;
 }
 }
-strong_alias(__pmap_set,pmap_set)
+libc_hidden_proto(pmap_set)
+libc_hidden_def(pmap_set)
 
 
 /*
 /*
  * Remove the mapping between program,version and port.
  * Remove the mapping between program,version and port.
  * Calls the pmap service remotely to do the un-mapping.
  * Calls the pmap service remotely to do the un-mapping.
  */
  */
-bool_t attribute_hidden
+bool_t
-__pmap_unset (u_long program, u_long version)
+pmap_unset (u_long program, u_long version)
 {
 {
   struct sockaddr_in myaddress;
   struct sockaddr_in myaddress;
   int socket = -1;
   int socket = -1;
@@ -173,7 +179,8 @@ __pmap_unset (u_long program, u_long version)
   CLNT_CALL (client, PMAPPROC_UNSET, (xdrproc_t)xdr_pmap, (caddr_t)&parms,
   CLNT_CALL (client, PMAPPROC_UNSET, (xdrproc_t)xdr_pmap, (caddr_t)&parms,
 	     (xdrproc_t)xdr_bool, (caddr_t)&rslt, tottimeout);
 	     (xdrproc_t)xdr_bool, (caddr_t)&rslt, tottimeout);
   CLNT_DESTROY (client);
   CLNT_DESTROY (client);
-  /* (void)__close(socket); CLNT_DESTROY already closed it */
+  /* (void)close(socket); CLNT_DESTROY already closed it */
   return rslt;
   return rslt;
 }
 }
-strong_alias(__pmap_unset,pmap_unset)
+libc_hidden_proto(pmap_unset)
+libc_hidden_def(pmap_unset)

+ 3 - 3
libc/inet/rpc/pmap_getmaps.c

@@ -39,9 +39,6 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define clnt_perror __clnt_perror
-#define clnttcp_create __clnttcp_create
-
 #include <rpc/rpc.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_clnt.h>
 #include <rpc/pmap_clnt.h>
@@ -50,6 +47,9 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";
 #include <stdio.h>
 #include <stdio.h>
 #include <errno.h>
 #include <errno.h>
 
 
+libc_hidden_proto(clnt_perror)
+libc_hidden_proto(clnttcp_create)
+
 /*
 /*
  * Get a copy of the current port maps.
  * Get a copy of the current port maps.
  * Calls the pmap service remotely to do get the maps.
  * Calls the pmap service remotely to do get the maps.

+ 6 - 9
libc/inet/rpc/pmap_getport.c

@@ -38,17 +38,13 @@ static char sccsid[] = "@(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define clntudp_bufcreate __clntudp_bufcreate
-
 #include <rpc/rpc.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_clnt.h>
 #include <rpc/pmap_clnt.h>
 #include <sys/socket.h>
 #include <sys/socket.h>
 
 
-#undef get_rpc_createerr
+libc_hidden_proto(clntudp_bufcreate)
-extern struct rpc_createerr *__rpc_thread_createerr_internal (void)
+libc_hidden_proto(__rpc_thread_createerr)
-     __attribute__ ((__const__)) attribute_hidden;
-#define get_rpc_createerr() (*__rpc_thread_createerr_internal ())
 
 
 static const struct timeval timeout =
 static const struct timeval timeout =
 {5, 0};
 {5, 0};
@@ -60,8 +56,8 @@ static const struct timeval tottimeout =
  * Calls the pmap service remotely to do the lookup.
  * Calls the pmap service remotely to do the lookup.
  * Returns 0 if no map exists.
  * Returns 0 if no map exists.
  */
  */
-u_short attribute_hidden
+u_short
-__pmap_getport (struct sockaddr_in *address, u_long program, u_long version, u_int protocol)
+pmap_getport (struct sockaddr_in *address, u_long program, u_long version, u_int protocol)
 {
 {
   u_short port = 0;
   u_short port = 0;
   int socket = -1;
   int socket = -1;
@@ -95,4 +91,5 @@ __pmap_getport (struct sockaddr_in *address, u_long program, u_long version, u_i
   address->sin_port = 0;
   address->sin_port = 0;
   return port;
   return port;
 }
 }
-strong_alias(__pmap_getport,pmap_getport)
+libc_hidden_proto(pmap_getport)
+libc_hidden_def(pmap_getport)

+ 1 - 2
libc/inet/rpc/pmap_prot.c

@@ -38,12 +38,11 @@ static char sccsid[] = "@(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define xdr_u_long __xdr_u_long
-
 #include <rpc/types.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
 #include <rpc/xdr.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_prot.h>
 
 
+libc_hidden_proto(xdr_u_long)
 
 
 bool_t
 bool_t
 xdr_pmap (xdrs, regs)
 xdr_pmap (xdrs, regs)

+ 2 - 3
libc/inet/rpc/pmap_prot2.c

@@ -38,13 +38,12 @@ static char sccsid[] = "@(#)pmap_prot2.c 1.3 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define xdr_bool __xdr_bool
-#define xdr_reference __xdr_reference
-
 #include <rpc/types.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
 #include <rpc/xdr.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_prot.h>
 
 
+libc_hidden_proto(xdr_bool)
+libc_hidden_proto(xdr_reference)
 
 
 /*
 /*
  * What is going on with linked lists? (!)
  * What is going on with linked lists? (!)

+ 41 - 33
libc/inet/rpc/pmap_rmt.c

@@ -39,20 +39,6 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define authunix_create_default __authunix_create_default
-#define xdrmem_create __xdrmem_create
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-#define xdr_reference __xdr_reference
-#define xdr_u_long __xdr_u_long
-#define inet_makeaddr __inet_makeaddr
-#define inet_netof __inet_netof
-#define clntudp_create __clntudp_create
-#define setsockopt __setsockopt
-#define recvfrom __recvfrom
-#define sendto __sendto
-#define poll __poll
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -73,6 +59,27 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 #define MAX_BROADCAST_SIZE 1400
 #define MAX_BROADCAST_SIZE 1400
 
 
+libc_hidden_proto(memset)
+libc_hidden_proto(ioctl)
+libc_hidden_proto(perror)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(authunix_create_default)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xdr_reference)
+libc_hidden_proto(xdr_u_long)
+libc_hidden_proto(inet_makeaddr)
+libc_hidden_proto(inet_netof)
+libc_hidden_proto(clntudp_create)
+libc_hidden_proto(setsockopt)
+libc_hidden_proto(recvfrom)
+libc_hidden_proto(sendto)
+libc_hidden_proto(poll)
+libc_hidden_proto(fprintf)
+
+
 extern u_long _create_xid (void) attribute_hidden;
 extern u_long _create_xid (void) attribute_hidden;
 
 
 static const struct timeval timeout = {3, 0};
 static const struct timeval timeout = {3, 0};
@@ -81,8 +88,8 @@ static const struct timeval timeout = {3, 0};
  * XDR remote call arguments
  * XDR remote call arguments
  * written for XDR_ENCODE direction only
  * written for XDR_ENCODE direction only
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap)
+xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap)
 {
 {
   u_int lenposition, argposition, position;
   u_int lenposition, argposition, position;
 
 
@@ -106,7 +113,8 @@ __xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_rmtcall_args,xdr_rmtcall_args)
+libc_hidden_proto(xdr_rmtcall_args)
+libc_hidden_def(xdr_rmtcall_args)
 
 
 /*
 /*
  * pmapper remote-call-service interface.
  * pmapper remote-call-service interface.
@@ -142,7 +150,7 @@ pmap_rmtcall (addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_p
       r.port_ptr = port_ptr;
       r.port_ptr = port_ptr;
       r.results_ptr = resp;
       r.results_ptr = resp;
       r.xdr_results = xdrres;
       r.xdr_results = xdrres;
-      stat = CLNT_CALL (client, PMAPPROC_CALLIT, (xdrproc_t)__xdr_rmtcall_args,
+      stat = CLNT_CALL (client, PMAPPROC_CALLIT, (xdrproc_t)xdr_rmtcall_args,
 			(caddr_t)&a, (xdrproc_t)xdr_rmtcallres,
 			(caddr_t)&a, (xdrproc_t)xdr_rmtcallres,
 			(caddr_t)&r, tout);
 			(caddr_t)&r, tout);
       CLNT_DESTROY (client);
       CLNT_DESTROY (client);
@@ -151,7 +159,7 @@ pmap_rmtcall (addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_p
     {
     {
       stat = RPC_FAILED;
       stat = RPC_FAILED;
     }
     }
-  /* (void)__close(socket); CLNT_DESTROY already closed it */
+  /* (void)close(socket); CLNT_DESTROY already closed it */
   addr->sin_port = 0;
   addr->sin_port = 0;
   return stat;
   return stat;
 }
 }
@@ -198,18 +206,18 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf)
 
 
   ifc.ifc_len = UDPMSGSIZE;
   ifc.ifc_len = UDPMSGSIZE;
   ifc.ifc_buf = buf;
   ifc.ifc_buf = buf;
-  if (__ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0)
+  if (ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0)
     {
     {
-      __perror (_("broadcast: ioctl (get interface configuration)"));
+      perror (_("broadcast: ioctl (get interface configuration)"));
       return (0);
       return (0);
     }
     }
   ifr = ifc.ifc_req;
   ifr = ifc.ifc_req;
   for (i = 0, n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
   for (i = 0, n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
     {
     {
       ifreq = *ifr;
       ifreq = *ifr;
-      if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
+      if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
 	{
 	{
-	  __perror (_("broadcast: ioctl (get interface flags)"));
+	  perror (_("broadcast: ioctl (get interface flags)"));
 	  continue;
 	  continue;
 	}
 	}
       if ((ifreq.ifr_flags & IFF_BROADCAST) &&
       if ((ifreq.ifr_flags & IFF_BROADCAST) &&
@@ -218,7 +226,7 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf)
 	{
 	{
 	  sin = (struct sockaddr_in *) &ifr->ifr_addr;
 	  sin = (struct sockaddr_in *) &ifr->ifr_addr;
 #ifdef SIOCGIFBRDADDR		/* 4.3BSD */
 #ifdef SIOCGIFBRDADDR		/* 4.3BSD */
-	  if (__ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0)
+	  if (ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0)
 	    {
 	    {
 	      addrs[i++] = inet_makeaddr (inet_netof
 	      addrs[i++] = inet_makeaddr (inet_netof
 	      /* Changed to pass struct instead of s_addr member
 	      /* Changed to pass struct instead of s_addr member
@@ -277,16 +285,16 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
    * initialization: create a socket, a broadcast address, and
    * initialization: create a socket, a broadcast address, and
    * preserialize the arguments into a send buffer.
    * preserialize the arguments into a send buffer.
    */
    */
-  if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+  if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
     {
     {
-      __perror (_("Cannot create socket for broadcast rpc"));
+      perror (_("Cannot create socket for broadcast rpc"));
       stat = RPC_CANTSEND;
       stat = RPC_CANTSEND;
       goto done_broad;
       goto done_broad;
     }
     }
 #ifdef SO_BROADCAST
 #ifdef SO_BROADCAST
   if (setsockopt (sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0)
   if (setsockopt (sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0)
     {
     {
-      __perror (_("Cannot set socket option SO_BROADCAST"));
+      perror (_("Cannot set socket option SO_BROADCAST"));
       stat = RPC_CANTSEND;
       stat = RPC_CANTSEND;
       goto done_broad;
       goto done_broad;
     }
     }
@@ -294,7 +302,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
   fd.fd = sock;
   fd.fd = sock;
   fd.events = POLLIN;
   fd.events = POLLIN;
   nets = getbroadcastnets (addrs, sock, inbuf);
   nets = getbroadcastnets (addrs, sock, inbuf);
-  __memset ((char *) &baddr, 0, sizeof (baddr));
+  memset ((char *) &baddr, 0, sizeof (baddr));
   baddr.sin_family = AF_INET;
   baddr.sin_family = AF_INET;
   baddr.sin_port = htons (PMAPPORT);
   baddr.sin_port = htons (PMAPPORT);
   baddr.sin_addr.s_addr = htonl (INADDR_ANY);
   baddr.sin_addr.s_addr = htonl (INADDR_ANY);
@@ -317,7 +325,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
   r.xdr_results = xresults;
   r.xdr_results = xresults;
   r.results_ptr = resultsp;
   r.results_ptr = resultsp;
   xdrmem_create (xdrs, outbuf, MAX_BROADCAST_SIZE, XDR_ENCODE);
   xdrmem_create (xdrs, outbuf, MAX_BROADCAST_SIZE, XDR_ENCODE);
-  if ((!xdr_callmsg (xdrs, &msg)) || (!__xdr_rmtcall_args (xdrs, &a)))
+  if ((!xdr_callmsg (xdrs, &msg)) || (!xdr_rmtcall_args (xdrs, &a)))
     {
     {
       stat = RPC_CANTENCODEARGS;
       stat = RPC_CANTENCODEARGS;
       goto done_broad;
       goto done_broad;
@@ -337,7 +345,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
 		      (struct sockaddr *) &baddr,
 		      (struct sockaddr *) &baddr,
 		      sizeof (struct sockaddr)) != outlen)
 		      sizeof (struct sockaddr)) != outlen)
 	    {
 	    {
-	      __perror (_("Cannot send broadcast packet"));
+	      perror (_("Cannot send broadcast packet"));
 	      stat = RPC_CANTSEND;
 	      stat = RPC_CANTSEND;
 	      goto done_broad;
 	      goto done_broad;
 	    }
 	    }
@@ -362,7 +370,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
 	case -1:		/* some kind of error */
 	case -1:		/* some kind of error */
 	  if (errno == EINTR)
 	  if (errno == EINTR)
 	    goto recv_again;
 	    goto recv_again;
-	  __perror (_("Broadcast poll problem"));
+	  perror (_("Broadcast poll problem"));
 	  stat = RPC_CANTRECV;
 	  stat = RPC_CANTRECV;
 	  goto done_broad;
 	  goto done_broad;
 
 
@@ -375,7 +383,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
 	{
 	{
 	  if (errno == EINTR)
 	  if (errno == EINTR)
 	    goto try_again;
 	    goto try_again;
-	  __perror (_("Cannot receive reply to broadcast"));
+	  perror (_("Cannot receive reply to broadcast"));
 	  stat = RPC_CANTRECV;
 	  stat = RPC_CANTRECV;
 	  goto done_broad;
 	  goto done_broad;
 	}
 	}
@@ -422,7 +430,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
 	}
 	}
     }
     }
 done_broad:
 done_broad:
-  (void) __close (sock);
+  (void) close (sock);
   AUTH_DESTROY (unix_auth);
   AUTH_DESTROY (unix_auth);
   return stat;
   return stat;
 }
 }

+ 90 - 69
libc/inet/rpc/rcmd.c

@@ -35,28 +35,6 @@
 static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";
 static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";
 #endif /* LIBC_SCCS and not lint */
 #endif /* LIBC_SCCS and not lint */
 
 
-#define bcopy __bcopy
-#define sysconf __sysconf
-#define getline __getline
-#define geteuid __geteuid
-#define seteuid __seteuid
-#define getpwnam_r __getpwnam_r
-#define gethostbyname __gethostbyname
-#define gethostbyname_r __gethostbyname_r
-#define fileno __fileno
-#define sleep __sleep
-#define inet_addr __inet_addr
-#define inet_ntoa __inet_ntoa
-#define herror __herror
-#define bind __bind
-#define connect __connect
-#define sigblock __sigblock
-#define snprintf __snprintf
-#define poll __poll
-#define accept __accept
-#define listen __listen
-#define sigsetmask __sigsetmask
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -79,9 +57,52 @@ static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 
 
-
+libc_hidden_proto(memcmp)
-extern int __rresvport(int *alport) attribute_hidden;
+libc_hidden_proto(strcat)
-extern int __getc_unlocked (FILE *__stream) attribute_hidden;
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strncmp)
+libc_hidden_proto(strnlen)
+libc_hidden_proto(bcopy)
+libc_hidden_proto(getpid)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(fcntl)
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(perror)
+libc_hidden_proto(lstat)
+libc_hidden_proto(fstat)
+libc_hidden_proto(tolower)
+libc_hidden_proto(sysconf)
+libc_hidden_proto(getline)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(seteuid)
+libc_hidden_proto(getpwnam_r)
+libc_hidden_proto(gethostbyname)
+libc_hidden_proto(gethostbyname_r)
+libc_hidden_proto(fileno)
+libc_hidden_proto(sleep)
+libc_hidden_proto(inet_addr)
+libc_hidden_proto(inet_ntoa)
+libc_hidden_proto(herror)
+libc_hidden_proto(bind)
+libc_hidden_proto(connect)
+libc_hidden_proto(sigblock)
+libc_hidden_proto(snprintf)
+libc_hidden_proto(poll)
+libc_hidden_proto(accept)
+libc_hidden_proto(listen)
+libc_hidden_proto(sigsetmask)
+libc_hidden_proto(getc_unlocked)
+libc_hidden_proto(__fgetc_unlocked)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(fprintf)
+
+libc_hidden_proto(rresvport)
 
 
 /* some forward declarations */
 /* some forward declarations */
 static int __ivaliduser2(FILE *hostf, u_int32_t raddr,
 static int __ivaliduser2(FILE *hostf, u_int32_t raddr,
@@ -110,7 +131,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 	int s, lport, timo;
 	int s, lport, timo;
 	char c;
 	char c;
 
 
-	pid = __getpid();
+	pid = getpid();
 
 
 #ifdef __UCLIBC_HAS_REENTRANT_RPC__
 #ifdef __UCLIBC_HAS_REENTRANT_RPC__
 	hstbuflen = 1024;
 	hstbuflen = 1024;
@@ -160,7 +181,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
         *ahost = hp->h_name;
         *ahost = hp->h_name;
         oldmask = sigblock(sigmask(SIGURG)); /* __sigblock */
         oldmask = sigblock(sigmask(SIGURG)); /* __sigblock */
 	for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
 	for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
-		s = __rresvport(&lport);
+		s = rresvport(&lport);
 		if (s < 0) {
 		if (s < 0) {
 			if (errno == EAGAIN)
 			if (errno == EAGAIN)
 			    (void)fprintf(stderr,
 			    (void)fprintf(stderr,
@@ -170,14 +191,14 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 			sigsetmask(oldmask); /* sigsetmask */
 			sigsetmask(oldmask); /* sigsetmask */
 			return -1;
 			return -1;
 		}
 		}
-		__fcntl(s, F_SETOWN, pid); /* __fcntl */
+		fcntl(s, F_SETOWN, pid);
 		sin.sin_family = hp->h_addrtype;
 		sin.sin_family = hp->h_addrtype;
 		bcopy(hp->h_addr_list[0], &sin.sin_addr,
 		bcopy(hp->h_addr_list[0], &sin.sin_addr,
 		      MIN (sizeof (sin.sin_addr), hp->h_length));
 		      MIN (sizeof (sin.sin_addr), hp->h_length));
 		sin.sin_port = rport;
 		sin.sin_port = rport;
 		if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) /* __connect */
 		if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) /* __connect */
 			break;
 			break;
-		(void)__close(s);
+		(void)close(s);
 		if (errno == EADDRINUSE) {
 		if (errno == EADDRINUSE) {
 			lport--;
 			lport--;
 			continue;
 			continue;
@@ -193,7 +214,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 			(void)fprintf(stderr, "connect to address %s: ",
 			(void)fprintf(stderr, "connect to address %s: ",
 			    inet_ntoa(sin.sin_addr));
 			    inet_ntoa(sin.sin_addr));
 			__set_errno (oerrno);
 			__set_errno (oerrno);
-			__perror(0);
+			perror(0);
 			hp->h_addr_list++;
 			hp->h_addr_list++;
 			bcopy(hp->h_addr_list[0], &sin.sin_addr,
 			bcopy(hp->h_addr_list[0], &sin.sin_addr,
 			      MIN (sizeof (sin.sin_addr), hp->h_length));
 			      MIN (sizeof (sin.sin_addr), hp->h_length));
@@ -207,21 +228,21 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 	}
 	}
 	lport--;
 	lport--;
 	if (fd2p == 0) {
 	if (fd2p == 0) {
-		__write(s, "", 1);
+		write(s, "", 1);
 		lport = 0;
 		lport = 0;
 	} else {
 	} else {
 		char num[8];
 		char num[8];
-		int s2 = __rresvport(&lport), s3;
+		int s2 = rresvport(&lport), s3;
 		socklen_t len = sizeof(from);
 		socklen_t len = sizeof(from);
 
 
 		if (s2 < 0)
 		if (s2 < 0)
 			goto bad;
 			goto bad;
 		listen(s2, 1);
 		listen(s2, 1);
 		(void)snprintf(num, sizeof(num), "%d", lport); /* __snprintf */
 		(void)snprintf(num, sizeof(num), "%d", lport); /* __snprintf */
-		if (__write(s, num, __strlen(num)+1) != __strlen(num)+1) {
+		if (write(s, num, strlen(num)+1) != strlen(num)+1) {
 			(void)fprintf(stderr,
 			(void)fprintf(stderr,
 				      "rcmd: write (setting up stderr): %m\n");
 				      "rcmd: write (setting up stderr): %m\n");
-			(void)__close(s2);
+			(void)close(s2);
 			goto bad;
 			goto bad;
 		}
 		}
 		pfd[0].fd = s;
 		pfd[0].fd = s;
@@ -232,11 +253,11 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 			(void)fprintf(stderr, "rcmd: poll (setting up stderr): %m\n");
 			(void)fprintf(stderr, "rcmd: poll (setting up stderr): %m\n");
 		    else
 		    else
 			(void)fprintf(stderr, "poll: protocol failure in circuit setup\n");
 			(void)fprintf(stderr, "poll: protocol failure in circuit setup\n");
-			(void)__close(s2);
+			(void)close(s2);
 			goto bad;
 			goto bad;
 		}
 		}
 		s3 = accept(s2, (struct sockaddr *)&from, &len);
 		s3 = accept(s2, (struct sockaddr *)&from, &len);
-		(void)__close(s2);
+		(void)close(s2);
 		if (s3 < 0) {
 		if (s3 < 0) {
 			(void)fprintf(stderr,
 			(void)fprintf(stderr,
 			    "rcmd: accept: %m\n");
 			    "rcmd: accept: %m\n");
@@ -253,17 +274,17 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 			goto bad2;
 			goto bad2;
 		}
 		}
 	}
 	}
-	(void)__write(s, locuser, __strlen(locuser)+1);
+	(void)write(s, locuser, strlen(locuser)+1);
-	(void)__write(s, remuser, __strlen(remuser)+1);
+	(void)write(s, remuser, strlen(remuser)+1);
-	(void)__write(s, cmd, __strlen(cmd)+1);
+	(void)write(s, cmd, strlen(cmd)+1);
-	if (__read(s, &c, 1) != 1) {
+	if (read(s, &c, 1) != 1) {
 		(void)fprintf(stderr,
 		(void)fprintf(stderr,
 		    "rcmd: %s: %m\n", *ahost);
 		    "rcmd: %s: %m\n", *ahost);
 		goto bad2;
 		goto bad2;
 	}
 	}
 	if (c != 0) {
 	if (c != 0) {
-		while (__read(s, &c, 1) == 1) {
+		while (read(s, &c, 1) == 1) {
-			(void)__write(STDERR_FILENO, &c, 1);
+			(void)write(STDERR_FILENO, &c, 1);
 			if (c == '\n')
 			if (c == '\n')
 				break;
 				break;
 		}
 		}
@@ -273,21 +294,21 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 	return s;
 	return s;
 bad2:
 bad2:
 	if (lport)
 	if (lport)
-		(void)__close(*fd2p);
+		(void)close(*fd2p);
 bad:
 bad:
-	(void)__close(s);
+	(void)close(s);
 	sigsetmask(oldmask);
 	sigsetmask(oldmask);
 	return -1;
 	return -1;
 }
 }
 
 
-int attribute_hidden __rresvport(int *alport)
+int rresvport(int *alport)
 {
 {
     struct sockaddr_in sin;
     struct sockaddr_in sin;
     int s;
     int s;
 
 
     sin.sin_family = AF_INET;
     sin.sin_family = AF_INET;
     sin.sin_addr.s_addr = INADDR_ANY;
     sin.sin_addr.s_addr = INADDR_ANY;
-    s = __socket(AF_INET, SOCK_STREAM, 0);
+    s = socket(AF_INET, SOCK_STREAM, 0);
     if (s < 0)
     if (s < 0)
 	return -1;
 	return -1;
     for (;;) {
     for (;;) {
@@ -295,12 +316,12 @@ int attribute_hidden __rresvport(int *alport)
 	if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
 	if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
 	    return s;
 	    return s;
 	if (errno != EADDRINUSE) {
 	if (errno != EADDRINUSE) {
-	    (void)__close(s);
+	    (void)close(s);
 	    return -1;
 	    return -1;
 	}
 	}
 	(*alport)--;
 	(*alport)--;
 	if (*alport == IPPORT_RESERVED/2) {
 	if (*alport == IPPORT_RESERVED/2) {
-	    (void)__close(s);
+	    (void)close(s);
 	    __set_errno (EAGAIN);		/* close */
 	    __set_errno (EAGAIN);		/* close */
 	    return -1;
 	    return -1;
 	}
 	}
@@ -308,7 +329,7 @@ int attribute_hidden __rresvport(int *alport)
     
     
     return -1;
     return -1;
 }
 }
-strong_alias(__rresvport,rresvport)
+libc_hidden_def(rresvport)
 
 
 static int  __check_rhosts_file = 1;
 static int  __check_rhosts_file = 1;
 static char *__rcmd_errstr;
 static char *__rcmd_errstr;
@@ -386,7 +407,7 @@ iruserfopen (char *file, uid_t okuser)
      root, if writeable by anyone but the owner, or if hardlinked
      root, if writeable by anyone but the owner, or if hardlinked
      anywhere, quit.  */
      anywhere, quit.  */
   cp = NULL;
   cp = NULL;
-  if (__lstat (file, &st))
+  if (lstat (file, &st))
     cp = "lstat failed";
     cp = "lstat failed";
   else if (!S_ISREG (st.st_mode))
   else if (!S_ISREG (st.st_mode))
     cp = "not regular file";
     cp = "not regular file";
@@ -395,7 +416,7 @@ iruserfopen (char *file, uid_t okuser)
       res = fopen (file, "r");
       res = fopen (file, "r");
       if (!res)
       if (!res)
 	cp = "cannot open";
 	cp = "cannot open";
-      else if (__fstat (fileno (res), &st) < 0)
+      else if (fstat (fileno (res), &st) < 0)
 	cp = "fstat failed";
 	cp = "fstat failed";
       else if (st.st_uid && st.st_uid != okuser)
       else if (st.st_uid && st.st_uid != okuser)
 	cp = "bad owner";
 	cp = "bad owner";
@@ -478,10 +499,10 @@ iruserok2 (raddr, superuser, ruser, luser, rhost)
 			return -1;
 			return -1;
 #endif
 #endif
 
 
-		dirlen = __strlen (pwd->pw_dir);
+		dirlen = strlen (pwd->pw_dir);
 		pbuf = malloc (dirlen + sizeof "/.rhosts");
 		pbuf = malloc (dirlen + sizeof "/.rhosts");
-		__strcpy (pbuf, pwd->pw_dir);
+		strcpy (pbuf, pwd->pw_dir);
-		__strcat (pbuf, "/.rhosts");
+		strcat (pbuf, "/.rhosts");
 
 
 		/* Change effective uid while reading .rhosts.  If root and
 		/* Change effective uid while reading .rhosts.  If root and
 		   reading an NFS mounted file system, can't read files that
 		   reading an NFS mounted file system, can't read files that
@@ -546,18 +567,18 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
 
 
 #ifdef HAVE_NETGROUP
 #ifdef HAVE_NETGROUP
 	/* Check nis netgroup.  */
 	/* Check nis netgroup.  */
-	if (__strncmp ("+@", lhost, 2) == 0)
+	if (strncmp ("+@", lhost, 2) == 0)
 		return innetgr (&lhost[2], rhost, NULL, NULL);
 		return innetgr (&lhost[2], rhost, NULL, NULL);
 
 
-	if (__strncmp ("-@", lhost, 2) == 0)
+	if (strncmp ("-@", lhost, 2) == 0)
 		return -innetgr (&lhost[2], rhost, NULL, NULL);
 		return -innetgr (&lhost[2], rhost, NULL, NULL);
 #endif /* HAVE_NETGROUP */
 #endif /* HAVE_NETGROUP */
 
 
 	/* -host */
 	/* -host */
-	if (__strncmp ("-", lhost,1) == 0) {
+	if (strncmp ("-", lhost,1) == 0) {
 		negate = -1;
 		negate = -1;
 		lhost++;
 		lhost++;
-	} else if (__strcmp ("+",lhost) == 0) {
+	} else if (strcmp ("+",lhost) == 0) {
 		return 1;                    /* asking for trouble, but ok.. */
 		return 1;                    /* asking for trouble, but ok.. */
 	}
 	}
 
 
@@ -587,7 +608,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
 
 
 	/* Spin through ip addresses. */
 	/* Spin through ip addresses. */
 	for (pp = hp->h_addr_list; *pp; ++pp)
 	for (pp = hp->h_addr_list; *pp; ++pp)
-		if (!__memcmp (&raddr, *pp, sizeof (u_int32_t)))
+		if (!memcmp (&raddr, *pp, sizeof (u_int32_t)))
 			return negate;
 			return negate;
 
 
 	/* No match. */
 	/* No match. */
@@ -606,23 +627,23 @@ __icheckuser (const char *luser, const char *ruser)
 
 
 #ifdef HAVE_NETGROUP
 #ifdef HAVE_NETGROUP
     /* [-+]@netgroup */
     /* [-+]@netgroup */
-    if (__strncmp ("+@", luser, 2) == 0)
+    if (strncmp ("+@", luser, 2) == 0)
 	return innetgr (&luser[2], NULL, ruser, NULL);
 	return innetgr (&luser[2], NULL, ruser, NULL);
 
 
-    if (__strncmp ("-@", luser,2) == 0)
+    if (strncmp ("-@", luser,2) == 0)
 	return -innetgr (&luser[2], NULL, ruser, NULL);
 	return -innetgr (&luser[2], NULL, ruser, NULL);
 #endif /* HAVE_NETGROUP */
 #endif /* HAVE_NETGROUP */
 
 
     /* -user */
     /* -user */
-    if (__strncmp ("-", luser, 1) == 0)
+    if (strncmp ("-", luser, 1) == 0)
-	return -(__strcmp (&luser[1], ruser) == 0);
+	return -(strcmp (&luser[1], ruser) == 0);
 
 
     /* + */
     /* + */
-    if (__strcmp ("+", luser) == 0)
+    if (strcmp ("+", luser) == 0)
 	return 1;
 	return 1;
 
 
     /* simple string match */
     /* simple string match */
-    return __strcmp (ruser, luser) == 0;
+    return strcmp (ruser, luser) == 0;
 }
 }
 
 
 /*
 /*
@@ -664,16 +685,16 @@ __ivaliduser2(hostf, raddr, luser, ruser, rhost)
 	}
 	}
 
 
 	/* Skip lines that are too long. */
 	/* Skip lines that are too long. */
-	if (__strchr (p, '\n') == NULL) {
+	if (strchr (p, '\n') == NULL) {
-	    int ch = __getc_unlocked (hostf);
+	    int ch = getc_unlocked (hostf);
 
 
 	    while (ch != '\n' && ch != EOF)
 	    while (ch != '\n' && ch != EOF)
-	      ch = __getc_unlocked (hostf);
+	      ch = getc_unlocked (hostf);
 	    continue;
 	    continue;
 	}
 	}
 
 
 	for (;*p && !isspace(*p); ++p) {
 	for (;*p && !isspace(*p); ++p) {
-	    *p = __tolower (*p);
+	    *p = tolower (*p);
 	}
 	}
 
 
 	/* Next we want to find the permitted name for the remote user.  */
 	/* Next we want to find the permitted name for the remote user.  */

+ 53 - 42
libc/inet/rpc/rexec.c

@@ -27,17 +27,6 @@
  * SUCH DAMAGE.
  * SUCH DAMAGE.
  */
  */
 
 
-#define getsockname __getsockname
-#define getnameinfo __getnameinfo
-#define getaddrinfo __getaddrinfo
-#define freeaddrinfo __freeaddrinfo
-#define sleep __sleep
-#define atoi __atoi
-#define connect __connect
-#define snprintf __snprintf
-#define accept __accept
-#define listen __listen
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <sys/types.h>
 #include <sys/types.h>
@@ -53,15 +42,36 @@
 #include <string.h>
 #include <string.h>
 #include <unistd.h>
 #include <unistd.h>
 
 
+libc_hidden_proto(memset)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strncpy)
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(close)
+libc_hidden_proto(socket)
+libc_hidden_proto(perror)
+libc_hidden_proto(sprintf)
+libc_hidden_proto(snprintf)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(getnameinfo)
+libc_hidden_proto(getaddrinfo)
+libc_hidden_proto(freeaddrinfo)
+libc_hidden_proto(sleep)
+libc_hidden_proto(atoi)
+libc_hidden_proto(connect)
+libc_hidden_proto(accept)
+libc_hidden_proto(listen)
+
 #define SA_LEN(_x)      __libc_sa_len((_x)->sa_family)
 #define SA_LEN(_x)      __libc_sa_len((_x)->sa_family)
 extern int __libc_sa_len (sa_family_t __af) __THROW attribute_hidden;
 extern int __libc_sa_len (sa_family_t __af) __THROW attribute_hidden;
 
 
 int	rexecoptions;
 int	rexecoptions;
 char	ahostbuf[NI_MAXHOST] attribute_hidden;
 char	ahostbuf[NI_MAXHOST] attribute_hidden;
-extern int __ruserpass(const char *host, const char **aname, const char **apass) attribute_hidden;
+extern int ruserpass(const char *host, const char **aname, const char **apass) attribute_hidden;
+libc_hidden_proto(ruserpass)
 
 
-int attribute_hidden
+int
-__rexec_af(char **ahost, int rport, const char *name, const char *pass, const char *cmd, int *fd2p, sa_family_t af)
+rexec_af(char **ahost, int rport, const char *name, const char *pass, const char *cmd, int *fd2p, sa_family_t af)
 {
 {
 	struct sockaddr_storage sa2, from;
 	struct sockaddr_storage sa2, from;
 	struct addrinfo hints, *res0;
 	struct addrinfo hints, *res0;
@@ -76,7 +86,7 @@ __rexec_af(char **ahost, int rport, const char *name, const char *pass, const ch
 	snprintf(servbuff, sizeof(servbuff), "%d", ntohs(rport));
 	snprintf(servbuff, sizeof(servbuff), "%d", ntohs(rport));
 	servbuff[sizeof(servbuff) - 1] = '\0';
 	servbuff[sizeof(servbuff) - 1] = '\0';
 
 
-	__memset(&hints, 0, sizeof(hints));
+	memset(&hints, 0, sizeof(hints));
 	hints.ai_family = af;
 	hints.ai_family = af;
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_flags = AI_CANONNAME;
 	hints.ai_flags = AI_CANONNAME;
@@ -87,51 +97,51 @@ __rexec_af(char **ahost, int rport, const char *name, const char *pass, const ch
 	}
 	}
 
 
 	if (res0->ai_canonname){
 	if (res0->ai_canonname){
-		__strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf));
+		strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf));
 		ahostbuf[sizeof(ahostbuf)-1] = '\0';
 		ahostbuf[sizeof(ahostbuf)-1] = '\0';
 		*ahost = ahostbuf;
 		*ahost = ahostbuf;
 	}
 	}
 	else{
 	else{
 		*ahost = NULL;
 		*ahost = NULL;
 	}
 	}
-	__ruserpass(res0->ai_canonname, &name, &pass);
+	ruserpass(res0->ai_canonname, &name, &pass);
 retry:
 retry:
-	s = __socket(res0->ai_family, res0->ai_socktype, 0);
+	s = socket(res0->ai_family, res0->ai_socktype, 0);
 	if (s < 0) {
 	if (s < 0) {
-		__perror("rexec: socket");
+		perror("rexec: socket");
 		return (-1);
 		return (-1);
 	}
 	}
 	if (connect(s, res0->ai_addr, res0->ai_addrlen) < 0) {
 	if (connect(s, res0->ai_addr, res0->ai_addrlen) < 0) {
 		if (errno == ECONNREFUSED && timo <= 16) {
 		if (errno == ECONNREFUSED && timo <= 16) {
-			(void) __close(s);
+			(void) close(s);
 			sleep(timo);
 			sleep(timo);
 			timo *= 2;
 			timo *= 2;
 			goto retry;
 			goto retry;
 		}
 		}
-		__perror(res0->ai_canonname);
+		perror(res0->ai_canonname);
 		return (-1);
 		return (-1);
 	}
 	}
 	if (fd2p == 0) {
 	if (fd2p == 0) {
-		(void) __write(s, "", 1);
+		(void) write(s, "", 1);
 		port = 0;
 		port = 0;
 	} else {
 	} else {
 		char num[32];
 		char num[32];
 		int s2, sa2len;
 		int s2, sa2len;
 
 
-		s2 = __socket(res0->ai_family, res0->ai_socktype, 0);
+		s2 = socket(res0->ai_family, res0->ai_socktype, 0);
 		if (s2 < 0) {
 		if (s2 < 0) {
-			(void) __close(s);
+			(void) close(s);
 			return (-1);
 			return (-1);
 		}
 		}
 		listen(s2, 1);
 		listen(s2, 1);
 		sa2len = sizeof (sa2);
 		sa2len = sizeof (sa2);
 		if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
 		if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
-			__perror("getsockname");
+			perror("getsockname");
-			(void) __close(s2);
+			(void) close(s2);
 			goto bad;
 			goto bad;
 		} else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) {
 		} else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) {
 			__set_errno(EINVAL);
 			__set_errno(EINVAL);
-			(void) __close(s2);
+			(void) close(s2);
 			goto bad;
 			goto bad;
 		}
 		}
 		port = 0;
 		port = 0;
@@ -139,23 +149,23 @@ retry:
 				 NULL, 0, servbuff, sizeof(servbuff),
 				 NULL, 0, servbuff, sizeof(servbuff),
 				 NI_NUMERICSERV))
 				 NI_NUMERICSERV))
 			port = atoi(servbuff);
 			port = atoi(servbuff);
-		(void) __sprintf(num, "%u", port);
+		(void) sprintf(num, "%u", port);
-		(void) __write(s, num, __strlen(num)+1);
+		(void) write(s, num, strlen(num)+1);
 		{ socklen_t len = sizeof (from);
 		{ socklen_t len = sizeof (from);
 		  s3 = accept(s2, (struct sockaddr *)&from, &len);
 		  s3 = accept(s2, (struct sockaddr *)&from, &len);
-		  __close(s2);
+		  close(s2);
 		  if (s3 < 0) {
 		  if (s3 < 0) {
-			__perror("accept");
+			perror("accept");
 			port = 0;
 			port = 0;
 			goto bad;
 			goto bad;
 		  }
 		  }
 		}
 		}
 		*fd2p = s3;
 		*fd2p = s3;
 	}
 	}
-	(void) __write(s, name, __strlen(name) + 1);
+	(void) write(s, name, strlen(name) + 1);
 	/* should public key encypt the password here */
 	/* should public key encypt the password here */
-	(void) __write(s, pass, __strlen(pass) + 1);
+	(void) write(s, pass, strlen(pass) + 1);
-	(void) __write(s, cmd, __strlen(cmd) + 1);
+	(void) write(s, cmd, strlen(cmd) + 1);
 
 
 	/* We don't need the memory allocated for the name and the password
 	/* We don't need the memory allocated for the name and the password
 	   in ruserpass anymore.  */
 	   in ruserpass anymore.  */
@@ -164,13 +174,13 @@ retry:
 	if (pass != orig_pass)
 	if (pass != orig_pass)
 	  free ((char *) pass);
 	  free ((char *) pass);
 
 
-	if (__read(s, &c, 1) != 1) {
+	if (read(s, &c, 1) != 1) {
-		__perror(*ahost);
+		perror(*ahost);
 		goto bad;
 		goto bad;
 	}
 	}
 	if (c != 0) {
 	if (c != 0) {
-		while (__read(s, &c, 1) == 1) {
+		while (read(s, &c, 1) == 1) {
-			(void) __write(2, &c, 1);
+			(void) write(2, &c, 1);
 			if (c == '\n')
 			if (c == '\n')
 				break;
 				break;
 		}
 		}
@@ -180,12 +190,13 @@ retry:
 	return (s);
 	return (s);
 bad:
 bad:
 	if (port)
 	if (port)
-		(void) __close(*fd2p);
+		(void) close(*fd2p);
-	(void) __close(s);
+	(void) close(s);
 	freeaddrinfo(res0);
 	freeaddrinfo(res0);
 	return (-1);
 	return (-1);
 }
 }
-strong_alias(__rexec_af,rexec_af)
+libc_hidden_proto(rexec_af)
+libc_hidden_def(rexec_af)
 
 
 int
 int
 rexec(ahost, rport, name, pass, cmd, fd2p)
 rexec(ahost, rport, name, pass, cmd, fd2p)
@@ -194,5 +205,5 @@ rexec(ahost, rport, name, pass, cmd, fd2p)
 	const char *name, *pass, *cmd;
 	const char *name, *pass, *cmd;
 	int *fd2p;
 	int *fd2p;
 {
 {
-	return __rexec_af(ahost, rport, name, pass, cmd, fd2p, AF_INET);
+	return rexec_af(ahost, rport, name, pass, cmd, fd2p, AF_INET);
 }
 }

+ 15 - 13
libc/inet/rpc/rpc_callmsg.c

@@ -38,12 +38,6 @@ static char sccsid[] = "@(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro";
  *
  *
  */
  */
 
 
-#define xdr_enum __xdr_enum
-#define xdr_opaque __xdr_opaque
-#define xdr_u_int __xdr_u_int
-#define xdr_u_long __xdr_u_long
-#define xdr_opaque_auth __xdr_opaque_auth
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -51,11 +45,18 @@ static char sccsid[] = "@(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro";
 #include <sys/param.h>
 #include <sys/param.h>
 #include <rpc/rpc.h>
 #include <rpc/rpc.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(xdr_enum)
+libc_hidden_proto(xdr_opaque)
+libc_hidden_proto(xdr_u_int)
+libc_hidden_proto(xdr_u_long)
+libc_hidden_proto(xdr_opaque_auth)
+
 /*
 /*
  * XDR a call message
  * XDR a call message
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
+xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
 {
 {
   int32_t *buf;
   int32_t *buf;
   struct opaque_auth *oa;
   struct opaque_auth *oa;
@@ -91,7 +92,7 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
 	  IXDR_PUT_INT32 (buf, oa->oa_length);
 	  IXDR_PUT_INT32 (buf, oa->oa_length);
 	  if (oa->oa_length)
 	  if (oa->oa_length)
 	    {
 	    {
-	      __memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length);
+	      memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length);
 	      buf = (int32_t *) ((char *) buf + RNDUP (oa->oa_length));
 	      buf = (int32_t *) ((char *) buf + RNDUP (oa->oa_length));
 	    }
 	    }
 	  oa = &cmsg->rm_call.cb_verf;
 	  oa = &cmsg->rm_call.cb_verf;
@@ -99,7 +100,7 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
 	  IXDR_PUT_INT32 (buf, oa->oa_length);
 	  IXDR_PUT_INT32 (buf, oa->oa_length);
 	  if (oa->oa_length)
 	  if (oa->oa_length)
 	    {
 	    {
-	      __memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length);
+	      memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length);
 	      /* no real need....
 	      /* no real need....
 	         buf = (long *) ((char *) buf + RNDUP(oa->oa_length));
 	         buf = (long *) ((char *) buf + RNDUP(oa->oa_length));
 	       */
 	       */
@@ -147,7 +148,7 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
 		}
 		}
 	      else
 	      else
 		{
 		{
-		  __memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length);
+		  memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length);
 		  /* no real need....
 		  /* no real need....
 		     buf = (long *) ((char *) buf
 		     buf = (long *) ((char *) buf
 		     + RNDUP(oa->oa_length));
 		     + RNDUP(oa->oa_length));
@@ -187,7 +188,7 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
 		}
 		}
 	      else
 	      else
 		{
 		{
-		  __memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length);
+		  memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length);
 		  /* no real need...
 		  /* no real need...
 		     buf = (long *) ((char *) buf
 		     buf = (long *) ((char *) buf
 		     + RNDUP(oa->oa_length));
 		     + RNDUP(oa->oa_length));
@@ -210,4 +211,5 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
     return xdr_opaque_auth (xdrs, &(cmsg->rm_call.cb_verf));
     return xdr_opaque_auth (xdrs, &(cmsg->rm_call.cb_verf));
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_callmsg,xdr_callmsg)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_def(xdr_callmsg)

+ 6 - 5
libc/inet/rpc/rpc_dtablesize.c

@@ -31,8 +31,6 @@
 static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
 static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
 #endif
 #endif
 
 
-#define getdtablesize __getdtablesize
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define __USE_BSD
 #define __USE_BSD
 #include <features.h>
 #include <features.h>
@@ -40,12 +38,14 @@ static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
 #include <unistd.h>
 #include <unistd.h>
 #include <rpc/clnt.h>
 #include <rpc/clnt.h>
 
 
+libc_hidden_proto(getdtablesize)
+
 /*
 /*
  * Cache the result of getdtablesize(), so we don't have to do an
  * Cache the result of getdtablesize(), so we don't have to do an
  * expensive system call every time.
  * expensive system call every time.
  */
  */
-int attribute_hidden
+int
-_rpc_dtablesize_internal (void)
+_rpc_dtablesize(void)
 {
 {
   static int size;
   static int size;
 
 
@@ -54,4 +54,5 @@ _rpc_dtablesize_internal (void)
 
 
   return size;
   return size;
 }
 }
-strong_alias(_rpc_dtablesize_internal,_rpc_dtablesize)
+libc_hidden_proto(_rpc_dtablesize)
+libc_hidden_def(_rpc_dtablesize)

+ 1 - 4
libc/inet/rpc/rpc_private.h

@@ -4,10 +4,7 @@
 /* Now define the internal interfaces.  */
 /* Now define the internal interfaces.  */
 extern u_long _create_xid (void) attribute_hidden;
 extern u_long _create_xid (void) attribute_hidden;
 
 
-#undef get_rpc_createerr
+libc_hidden_proto(__rpc_thread_createerr)
-extern struct rpc_createerr *__rpc_thread_createerr_internal (void)
-     __attribute__ ((__const__)) attribute_hidden;
-#define get_rpc_createerr() (*__rpc_thread_createerr_internal ())
 
 
 /*
 /*
  * Multi-threaded support
  * Multi-threaded support

+ 29 - 23
libc/inet/rpc/rpc_prot.c

@@ -44,12 +44,6 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";
  * routines are also in this program.
  * routines are also in this program.
  */
  */
 
 
-#define xdr_bytes __xdr_bytes
-#define xdr_union __xdr_union
-#define xdr_enum __xdr_enum
-#define xdr_opaque __xdr_opaque
-#define xdr_u_long __xdr_u_long
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -57,14 +51,20 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";
 
 
 #include <rpc/rpc.h>
 #include <rpc/rpc.h>
 
 
+libc_hidden_proto(xdr_bytes)
+libc_hidden_proto(xdr_union)
+libc_hidden_proto(xdr_enum)
+libc_hidden_proto(xdr_opaque)
+libc_hidden_proto(xdr_u_long)
+
 /* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */
 /* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */
 
 
 /*
 /*
  * XDR an opaque authentication struct
  * XDR an opaque authentication struct
  * (see auth.h)
  * (see auth.h)
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_opaque_auth (XDR *xdrs, struct opaque_auth *ap)
+xdr_opaque_auth (XDR *xdrs, struct opaque_auth *ap)
 {
 {
 
 
   if (xdr_enum (xdrs, &(ap->oa_flavor)))
   if (xdr_enum (xdrs, &(ap->oa_flavor)))
@@ -72,7 +72,8 @@ __xdr_opaque_auth (XDR *xdrs, struct opaque_auth *ap)
 		      &ap->oa_length, MAX_AUTH_BYTES);
 		      &ap->oa_length, MAX_AUTH_BYTES);
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_opaque_auth,xdr_opaque_auth)
+libc_hidden_proto(xdr_opaque_auth)
+libc_hidden_def(xdr_opaque_auth)
 
 
 /*
 /*
  * XDR a DES block
  * XDR a DES block
@@ -92,7 +93,7 @@ bool_t
 xdr_accepted_reply (XDR *xdrs, struct accepted_reply *ar)
 xdr_accepted_reply (XDR *xdrs, struct accepted_reply *ar)
 {
 {
   /* personalized union, rather than calling xdr_union */
   /* personalized union, rather than calling xdr_union */
-  if (!__xdr_opaque_auth (xdrs, &(ar->ar_verf)))
+  if (!xdr_opaque_auth (xdrs, &(ar->ar_verf)))
     return FALSE;
     return FALSE;
   if (!xdr_enum (xdrs, (enum_t *) & (ar->ar_stat)))
   if (!xdr_enum (xdrs, (enum_t *) & (ar->ar_stat)))
     return FALSE;
     return FALSE;
@@ -109,7 +110,8 @@ xdr_accepted_reply (XDR *xdrs, struct accepted_reply *ar)
     }
     }
   return TRUE;		/* TRUE => open ended set of problems */
   return TRUE;		/* TRUE => open ended set of problems */
 }
 }
-hidden_strong_alias(xdr_accepted_reply,__xdr_accepted_reply)
+libc_hidden_proto(xdr_accepted_reply)
+libc_hidden_def(xdr_accepted_reply)
 
 
 /*
 /*
  * XDR the MSG_DENIED part of a reply message union
  * XDR the MSG_DENIED part of a reply message union
@@ -132,19 +134,20 @@ xdr_rejected_reply (XDR *xdrs, struct rejected_reply *rr)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-hidden_strong_alias(xdr_rejected_reply,__xdr_rejected_reply)
+libc_hidden_proto(xdr_rejected_reply)
+libc_hidden_def(xdr_rejected_reply)
 
 
 static const struct xdr_discrim reply_dscrm[3] =
 static const struct xdr_discrim reply_dscrm[3] =
 {
 {
-  {(int) MSG_ACCEPTED, (xdrproc_t) __xdr_accepted_reply},
+  {(int) MSG_ACCEPTED, (xdrproc_t) xdr_accepted_reply},
-  {(int) MSG_DENIED, (xdrproc_t) __xdr_rejected_reply},
+  {(int) MSG_DENIED, (xdrproc_t) xdr_rejected_reply},
   {__dontcare__, NULL_xdrproc_t}};
   {__dontcare__, NULL_xdrproc_t}};
 
 
 /*
 /*
  * XDR a reply message
  * XDR a reply message
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_replymsg (XDR *xdrs, struct rpc_msg *rmsg)
+xdr_replymsg (XDR *xdrs, struct rpc_msg *rmsg)
 {
 {
   if (xdr_u_long (xdrs, &(rmsg->rm_xid)) &&
   if (xdr_u_long (xdrs, &(rmsg->rm_xid)) &&
       xdr_enum (xdrs, (enum_t *) & (rmsg->rm_direction)) &&
       xdr_enum (xdrs, (enum_t *) & (rmsg->rm_direction)) &&
@@ -154,7 +157,8 @@ __xdr_replymsg (XDR *xdrs, struct rpc_msg *rmsg)
 		      NULL_xdrproc_t);
 		      NULL_xdrproc_t);
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_replymsg,xdr_replymsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_def(xdr_replymsg)
 
 
 
 
 /*
 /*
@@ -162,8 +166,8 @@ strong_alias(__xdr_replymsg,xdr_replymsg)
  * The fields include: rm_xid, rm_direction, rpcvers, prog, and vers.
  * The fields include: rm_xid, rm_direction, rpcvers, prog, and vers.
  * The rm_xid is not really static, but the user can easily munge on the fly.
  * The rm_xid is not really static, but the user can easily munge on the fly.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_callhdr (XDR *xdrs, struct rpc_msg *cmsg)
+xdr_callhdr (XDR *xdrs, struct rpc_msg *cmsg)
 {
 {
 
 
   cmsg->rm_direction = CALL;
   cmsg->rm_direction = CALL;
@@ -177,7 +181,8 @@ __xdr_callhdr (XDR *xdrs, struct rpc_msg *cmsg)
     return xdr_u_long (xdrs, &(cmsg->rm_call.cb_vers));
     return xdr_u_long (xdrs, &(cmsg->rm_call.cb_vers));
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_callhdr,xdr_callhdr)
+libc_hidden_proto(xdr_callhdr)
+libc_hidden_def(xdr_callhdr)
 
 
 /* ************************** Client utility routine ************* */
 /* ************************** Client utility routine ************* */
 
 
@@ -242,8 +247,8 @@ rejected (enum reject_stat rjct_stat,
 /*
 /*
  * given a reply message, fills in the error
  * given a reply message, fills in the error
  */
  */
-void attribute_hidden
+void
-__seterr_reply (struct rpc_msg *msg,
+_seterr_reply (struct rpc_msg *msg,
 	       struct rpc_err *error)
 	       struct rpc_err *error)
 {
 {
   /* optimized for normal, SUCCESSful case */
   /* optimized for normal, SUCCESSful case */
@@ -287,4 +292,5 @@ __seterr_reply (struct rpc_msg *msg,
       break;
       break;
     }
     }
 }
 }
-strong_alias(__seterr_reply,_seterr_reply)
+libc_hidden_proto(_seterr_reply)
+libc_hidden_def(_seterr_reply)

+ 26 - 22
libc/inet/rpc/rpc_thread.c

@@ -1,3 +1,9 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -76,8 +82,8 @@ __rpc_thread_variables (void)
 #undef svc_pollfd
 #undef svc_pollfd
 #undef svc_max_pollfd
 #undef svc_max_pollfd
 
 
-fd_set attribute_hidden *
+fd_set *
-__rpc_thread_svc_fdset_internal (void)
+__rpc_thread_svc_fdset (void)
 {
 {
 	struct rpc_thread_variables *tvp;
 	struct rpc_thread_variables *tvp;
 
 
@@ -86,10 +92,9 @@ __rpc_thread_svc_fdset_internal (void)
 		return &svc_fdset;
 		return &svc_fdset;
 	return &tvp->svc_fdset_s;
 	return &tvp->svc_fdset_s;
 }
 }
-strong_alias(__rpc_thread_svc_fdset_internal,__rpc_thread_svc_fdset)
 
 
-struct rpc_createerr attribute_hidden *
+struct rpc_createerr *
-__rpc_thread_createerr_internal (void)
+__rpc_thread_createerr (void)
 {
 {
 	struct rpc_thread_variables *tvp;
 	struct rpc_thread_variables *tvp;
 
 
@@ -98,11 +103,9 @@ __rpc_thread_createerr_internal (void)
 		return &rpc_createerr;
 		return &rpc_createerr;
 	return &tvp->rpc_createerr_s;
 	return &tvp->rpc_createerr_s;
 }
 }
-#undef __rpc_thread_createerr
-strong_alias(__rpc_thread_createerr_internal,__rpc_thread_createerr)
 
 
-struct pollfd attribute_hidden **
+struct pollfd **
-__rpc_thread_svc_pollfd_internal (void)
+__rpc_thread_svc_pollfd (void)
 {
 {
 	struct rpc_thread_variables *tvp;
 	struct rpc_thread_variables *tvp;
 
 
@@ -111,10 +114,9 @@ __rpc_thread_svc_pollfd_internal (void)
 		return &svc_pollfd;
 		return &svc_pollfd;
 	return &tvp->svc_pollfd_s;
 	return &tvp->svc_pollfd_s;
 }
 }
-strong_alias(__rpc_thread_svc_pollfd_internal,__rpc_thread_svc_pollfd)
 
 
-int attribute_hidden *
+int *
-__rpc_thread_svc_max_pollfd_internal (void)
+__rpc_thread_svc_max_pollfd (void)
 {
 {
 	struct rpc_thread_variables *tvp;
 	struct rpc_thread_variables *tvp;
 
 
@@ -123,7 +125,6 @@ __rpc_thread_svc_max_pollfd_internal (void)
 		return &svc_max_pollfd;
 		return &svc_max_pollfd;
 	return &tvp->svc_max_pollfd_s;
 	return &tvp->svc_max_pollfd_s;
 }
 }
-strong_alias(__rpc_thread_svc_max_pollfd_internal,__rpc_thread_svc_max_pollfd)
 #else
 #else
 
 
 #undef svc_fdset
 #undef svc_fdset
@@ -131,34 +132,37 @@ strong_alias(__rpc_thread_svc_max_pollfd_internal,__rpc_thread_svc_max_pollfd)
 #undef svc_pollfd
 #undef svc_pollfd
 #undef svc_max_pollfd
 #undef svc_max_pollfd
 
 
-fd_set attribute_hidden * __rpc_thread_svc_fdset_internal (void)
+fd_set * __rpc_thread_svc_fdset (void)
 {
 {
     extern fd_set svc_fdset;
     extern fd_set svc_fdset;
     return &(svc_fdset);
     return &(svc_fdset);
 }
 }
-strong_alias(__rpc_thread_svc_fdset_internal,__rpc_thread_svc_fdset)
 
 
-struct rpc_createerr attribute_hidden * __rpc_thread_createerr_internal (void)
+struct rpc_createerr * __rpc_thread_createerr (void)
 {
 {
     extern struct rpc_createerr rpc_createerr;
     extern struct rpc_createerr rpc_createerr;
     return &(rpc_createerr);
     return &(rpc_createerr);
 }
 }
-#undef __rpc_thread_createerr
-strong_alias(__rpc_thread_createerr_internal,__rpc_thread_createerr)
 
 
-struct pollfd attribute_hidden ** __rpc_thread_svc_pollfd_internal (void)
+struct pollfd ** __rpc_thread_svc_pollfd (void)
 {
 {
     extern struct pollfd *svc_pollfd;
     extern struct pollfd *svc_pollfd;
     return &(svc_pollfd);
     return &(svc_pollfd);
 }
 }
-strong_alias(__rpc_thread_svc_pollfd_internal,__rpc_thread_svc_pollfd)
 
 
-int attribute_hidden * __rpc_thread_svc_max_pollfd_internal (void)
+int * __rpc_thread_svc_max_pollfd (void)
 {
 {
     extern int svc_max_pollfd;
     extern int svc_max_pollfd;
     return &(svc_max_pollfd);
     return &(svc_max_pollfd);
 }
 }
-strong_alias(__rpc_thread_svc_max_pollfd_internal,__rpc_thread_svc_max_pollfd)
 
 
 #endif /* __UCLIBC_HAS_THREADS__ */
 #endif /* __UCLIBC_HAS_THREADS__ */
 
 
+libc_hidden_proto(__rpc_thread_svc_fdset)
+libc_hidden_def(__rpc_thread_svc_fdset)
+libc_hidden_proto(__rpc_thread_createerr)
+libc_hidden_def(__rpc_thread_createerr)
+libc_hidden_proto(__rpc_thread_svc_pollfd)
+libc_hidden_def(__rpc_thread_svc_pollfd)
+libc_hidden_proto(__rpc_thread_svc_max_pollfd)
+libc_hidden_def(__rpc_thread_svc_max_pollfd)

+ 11 - 8
libc/inet/rpc/rtime.c

@@ -43,11 +43,6 @@ static char sccsid[] = "@(#)rtime.c	2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 S
  * what unix uses.
  * what unix uses.
  */
  */
 
 
-#define connect __connect
-#define recvfrom __recvfrom
-#define sendto __sendto
-#define poll __poll
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -63,6 +58,14 @@ static char sccsid[] = "@(#)rtime.c	2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 S
 #include <errno.h>
 #include <errno.h>
 #include <netinet/in.h>
 #include <netinet/in.h>
 
 
+libc_hidden_proto(read)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(connect)
+libc_hidden_proto(recvfrom)
+libc_hidden_proto(sendto)
+libc_hidden_proto(poll)
+
 #define NYEARS	(u_long)(1970 - 1900)
 #define NYEARS	(u_long)(1970 - 1900)
 #define TOFFSET (u_long)(60*60*24*(365*NYEARS + (NYEARS/4)))
 #define TOFFSET (u_long)(60*60*24*(365*NYEARS + (NYEARS/4)))
 
 
@@ -74,7 +77,7 @@ do_close (int s)
   int save;
   int save;
 
 
   save = errno;
   save = errno;
-  __close (s);
+  close (s);
   __set_errno (save);
   __set_errno (save);
 }
 }
 
 
@@ -96,7 +99,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
   else
   else
     type = SOCK_DGRAM;
     type = SOCK_DGRAM;
 
 
-  s = __socket (AF_INET, type, 0);
+  s = socket (AF_INET, type, 0);
   if (s < 0)
   if (s < 0)
     return (-1);
     return (-1);
 
 
@@ -138,7 +141,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
 	  do_close (s);
 	  do_close (s);
 	  return -1;
 	  return -1;
 	}
 	}
-      res = __read (s, (char *) &thetime, sizeof (thetime));
+      res = read (s, (char *) &thetime, sizeof (thetime));
       do_close (s);
       do_close (s);
       if (res < 0)
       if (res < 0)
 	return (-1);
 	return (-1);

+ 68 - 55
libc/inet/rpc/ruserpass.c

@@ -27,14 +27,6 @@
  * SUCH DAMAGE.
  * SUCH DAMAGE.
  */
  */
 
 
-#define __fsetlocking __fsetlocking_internal
-#define getgid __getgid
-#define getuid __getuid
-#define getegid __getegid
-#define geteuid __geteuid
-#define gethostname __gethostname
-#define fileno __fileno
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <sys/types.h>
 #include <sys/types.h>
@@ -50,7 +42,27 @@
 #include <string.h>
 #include <string.h>
 #include <unistd.h>
 #include <unistd.h>
 
 
-extern int __getc_unlocked (FILE *__stream) attribute_hidden;
+libc_hidden_proto(strcat)
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strcasecmp)
+libc_hidden_proto(strncasecmp)
+libc_hidden_proto(getenv)
+libc_hidden_proto(printf)
+libc_hidden_proto(fstat)
+libc_hidden_proto(__fsetlocking)
+libc_hidden_proto(getgid)
+libc_hidden_proto(getuid)
+libc_hidden_proto(getegid)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(gethostname)
+libc_hidden_proto(fileno)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(getc_unlocked)
+libc_hidden_proto(__fgetc_unlocked)
 
 
 #define _(X)  (X)
 #define _(X)  (X)
 /* #include "ftp_var.h" */
 /* #include "ftp_var.h" */
@@ -101,7 +113,7 @@ static const struct toktab {
 
 
 
 
 
 
-int attribute_hidden __ruserpass(const char *host, const char **aname, const char **apass)
+int ruserpass(const char *host, const char **aname, const char **apass)
 {
 {
 	char *hdir, *buf, *tmp;
 	char *hdir, *buf, *tmp;
 	char myname[1024], *mydomain;
 	char myname[1024], *mydomain;
@@ -111,20 +123,20 @@ int attribute_hidden __ruserpass(const char *host, const char **aname, const cha
 	/* Give up when running a setuid or setgid app. */
 	/* Give up when running a setuid or setgid app. */
 	if ((getuid() != geteuid()) || getgid() != getegid())
 	if ((getuid() != geteuid()) || getgid() != getegid())
 	    return -1;
 	    return -1;
-	hdir = __getenv("HOME");
+	hdir = getenv("HOME");
 	if (hdir == NULL) {
 	if (hdir == NULL) {
 		/* If we can't get HOME, fail instead of trying ".",
 		/* If we can't get HOME, fail instead of trying ".",
 		   which is no improvement. */
 		   which is no improvement. */
 	  	return -1;
 	  	return -1;
 	}
 	}
 
 
-	buf = alloca (__strlen(hdir) + 8);
+	buf = alloca (strlen(hdir) + 8);
-	__strcpy(buf, hdir);
+	strcpy(buf, hdir);
-	__strcat(buf, "/.netrc");
+	strcat(buf, "/.netrc");
 	cfile = fopen(buf, "r");
 	cfile = fopen(buf, "r");
 	if (cfile == NULL) {
 	if (cfile == NULL) {
 		if (errno != ENOENT)
 		if (errno != ENOENT)
-			__printf("%s", buf);
+			printf("%s", buf);
 		return (0);
 		return (0);
 	}
 	}
 	/* No threads use this stream.  */
 	/* No threads use this stream.  */
@@ -133,9 +145,9 @@ int attribute_hidden __ruserpass(const char *host, const char **aname, const cha
 #endif
 #endif
 	if (gethostname(myname, sizeof(myname)) < 0)
 	if (gethostname(myname, sizeof(myname)) < 0)
 		myname[0] = '\0';
 		myname[0] = '\0';
-	mydomain = __strchr(myname, '.');
+	mydomain = strchr(myname, '.');
 	if (mydomain==NULL) {
 	if (mydomain==NULL) {
-	    mydomain=myname + __strlen(myname);
+	    mydomain=myname + strlen(myname);
 	}
 	}
 next:
 next:
 	while ((t = token())) switch(t) {
 	while ((t = token())) switch(t) {
@@ -153,11 +165,11 @@ next:
 			 * or official hostname.  Also allow match of
 			 * or official hostname.  Also allow match of
 			 * incompletely-specified host in local domain.
 			 * incompletely-specified host in local domain.
 			 */
 			 */
-			if (__strcasecmp(host, tokval) == 0)
+			if (strcasecmp(host, tokval) == 0)
 				goto match;
 				goto match;
-			if ((tmp = __strchr(host, '.')) != NULL &&
+			if ((tmp = strchr(host, '.')) != NULL &&
-			    __strcasecmp(tmp, mydomain) == 0 &&
+			    strcasecmp(tmp, mydomain) == 0 &&
-			    __strncasecmp(host, tokval, tmp - host) == 0 &&
+			    strncasecmp(host, tokval, tmp - host) == 0 &&
 			    tokval[tmp - host] == '\0')
 			    tokval[tmp - host] == '\0')
 				goto match;
 				goto match;
 			continue;
 			continue;
@@ -169,49 +181,49 @@ next:
 			if (token()) {
 			if (token()) {
 				if (*aname == 0) {
 				if (*aname == 0) {
 				  char *newp;
 				  char *newp;
-				  newp = malloc((unsigned) __strlen(tokval) + 1);
+				  newp = malloc((unsigned) strlen(tokval) + 1);
 				  if (newp == NULL)
 				  if (newp == NULL)
 				    {
 				    {
-				      __printf(_("out of memory"));
+				      printf(_("out of memory"));
 				      goto bad;
 				      goto bad;
 				    }
 				    }
-				  *aname = __strcpy(newp, tokval);
+				  *aname = strcpy(newp, tokval);
 				} else {
 				} else {
-					if (__strcmp(*aname, tokval))
+					if (strcmp(*aname, tokval))
 						goto next;
 						goto next;
 				}
 				}
 			}
 			}
 			break;
 			break;
 		case PASSWD:
 		case PASSWD:
-			if (__strcmp(*aname, "anonymous") &&
+			if (strcmp(*aname, "anonymous") &&
-			    __fstat(fileno(cfile), &stb) >= 0 &&
+			    fstat(fileno(cfile), &stb) >= 0 &&
 			    (stb.st_mode & 077) != 0) {
 			    (stb.st_mode & 077) != 0) {
-	__printf(_("Error: .netrc file is readable by others."));
+	printf(_("Error: .netrc file is readable by others."));
-	__printf(_("Remove password or make file unreadable by others."));
+	printf(_("Remove password or make file unreadable by others."));
 				goto bad;
 				goto bad;
 			}
 			}
 			if (token() && *apass == 0) {
 			if (token() && *apass == 0) {
 				char *newp;
 				char *newp;
-				newp = malloc((unsigned) __strlen(tokval) + 1);
+				newp = malloc((unsigned) strlen(tokval) + 1);
 				if (newp == NULL)
 				if (newp == NULL)
 				  {
 				  {
-				    __printf(_("out of memory"));
+				    printf(_("out of memory"));
 				    goto bad;
 				    goto bad;
 				  }
 				  }
-				*apass = __strcpy(newp, tokval);
+				*apass = strcpy(newp, tokval);
 			}
 			}
 			break;
 			break;
 		case ACCOUNT:
 		case ACCOUNT:
 #if 0
 #if 0
-			if (__fstat(fileno(cfile), &stb) >= 0
+			if (fstat(fileno(cfile), &stb) >= 0
 			    && (stb.st_mode & 077) != 0) {
 			    && (stb.st_mode & 077) != 0) {
-	__printf("Error: .netrc file is readable by others.");
+	printf("Error: .netrc file is readable by others.");
-	__printf("Remove account or make file unreadable by others.");
+	printf("Remove account or make file unreadable by others.");
 				goto bad;
 				goto bad;
 			}
 			}
 			if (token() && *aacct == 0) {
 			if (token() && *aacct == 0) {
-				*aacct = malloc((unsigned) __strlen(tokval) + 1);
+				*aacct = malloc((unsigned) strlen(tokval) + 1);
-				(void) __strcpy(*aacct, tokval);
+				(void) strcpy(*aacct, tokval);
 			}
 			}
 #endif
 #endif
 			break;
 			break;
@@ -221,33 +233,33 @@ next:
 				(void) fclose(cfile);
 				(void) fclose(cfile);
 				return (0);
 				return (0);
 			}
 			}
-			while ((c=__getc_unlocked(cfile)) != EOF && c == ' '
+			while ((c=getc_unlocked(cfile)) != EOF && c == ' '
 			       || c == '\t');
 			       || c == '\t');
 			if (c == EOF || c == '\n') {
 			if (c == EOF || c == '\n') {
-				__printf("Missing macdef name argument.\n");
+				printf("Missing macdef name argument.\n");
 				goto bad;
 				goto bad;
 			}
 			}
 			if (macnum == 16) {
 			if (macnum == 16) {
-				__printf("Limit of 16 macros have already been defined\n");
+				printf("Limit of 16 macros have already been defined\n");
 				goto bad;
 				goto bad;
 			}
 			}
 			tmp = macros[macnum].mac_name;
 			tmp = macros[macnum].mac_name;
 			*tmp++ = c;
 			*tmp++ = c;
-			for (i=0; i < 8 && (c=__getc_unlocked(cfile)) != EOF &&
+			for (i=0; i < 8 && (c=getc_unlocked(cfile)) != EOF &&
 			    !isspace(c); ++i) {
 			    !isspace(c); ++i) {
 				*tmp++ = c;
 				*tmp++ = c;
 			}
 			}
 			if (c == EOF) {
 			if (c == EOF) {
-				__printf("Macro definition missing null line terminator.\n");
+				printf("Macro definition missing null line terminator.\n");
 				goto bad;
 				goto bad;
 			}
 			}
 			*tmp = '\0';
 			*tmp = '\0';
 			if (c != '\n') {
 			if (c != '\n') {
-				while ((c=__getc_unlocked(cfile)) != EOF
+				while ((c=getc_unlocked(cfile)) != EOF
 				       && c != '\n');
 				       && c != '\n');
 			}
 			}
 			if (c == EOF) {
 			if (c == EOF) {
-				__printf("Macro definition missing null line terminator.\n");
+				printf("Macro definition missing null line terminator.\n");
 				goto bad;
 				goto bad;
 			}
 			}
 			if (macnum == 0) {
 			if (macnum == 0) {
@@ -258,8 +270,8 @@ next:
 			}
 			}
 			tmp = macros[macnum].mac_start;
 			tmp = macros[macnum].mac_start;
 			while (tmp != macbuf + 4096) {
 			while (tmp != macbuf + 4096) {
-				if ((c=__getc_unlocked(cfile)) == EOF) {
+				if ((c=getc_unlocked(cfile)) == EOF) {
-				__printf("Macro definition missing null line terminator.\n");
+				printf("Macro definition missing null line terminator.\n");
 					goto bad;
 					goto bad;
 				}
 				}
 				*tmp = c;
 				*tmp = c;
@@ -273,13 +285,13 @@ next:
 				tmp++;
 				tmp++;
 			}
 			}
 			if (tmp == macbuf + 4096) {
 			if (tmp == macbuf + 4096) {
-				__printf("4K macro buffer exceeded\n");
+				printf("4K macro buffer exceeded\n");
 				goto bad;
 				goto bad;
 			}
 			}
 #endif
 #endif
 			break;
 			break;
 		default:
 		default:
-			__printf(_("Unknown .netrc keyword %s"), tokval);
+			printf(_("Unknown .netrc keyword %s"), tokval);
 			break;
 			break;
 		}
 		}
 		goto done;
 		goto done;
@@ -291,7 +303,8 @@ bad:
 	(void) fclose(cfile);
 	(void) fclose(cfile);
 	return (-1);
 	return (-1);
 }
 }
-strong_alias(__ruserpass,ruserpass)
+libc_hidden_proto(ruserpass)
+libc_hidden_def(ruserpass)
 
 
 static int
 static int
 token()
 token()
@@ -302,24 +315,24 @@ token()
 
 
 	if (feof_unlocked(cfile) || ferror_unlocked(cfile))
 	if (feof_unlocked(cfile) || ferror_unlocked(cfile))
 		return (0);
 		return (0);
-	while ((c = __getc_unlocked(cfile)) != EOF &&
+	while ((c = getc_unlocked(cfile)) != EOF &&
 	    (c == '\n' || c == '\t' || c == ' ' || c == ','))
 	    (c == '\n' || c == '\t' || c == ' ' || c == ','))
 		continue;
 		continue;
 	if (c == EOF)
 	if (c == EOF)
 		return (0);
 		return (0);
 	cp = tokval;
 	cp = tokval;
 	if (c == '"') {
 	if (c == '"') {
-		while ((c = __getc_unlocked(cfile)) != EOF && c != '"') {
+		while ((c = getc_unlocked(cfile)) != EOF && c != '"') {
 			if (c == '\\')
 			if (c == '\\')
-				c = __getc_unlocked(cfile);
+				c = getc_unlocked(cfile);
 			*cp++ = c;
 			*cp++ = c;
 		}
 		}
 	} else {
 	} else {
 		*cp++ = c;
 		*cp++ = c;
-		while ((c = __getc_unlocked(cfile)) != EOF
+		while ((c = getc_unlocked(cfile)) != EOF
 		    && c != '\n' && c != '\t' && c != ' ' && c != ',') {
 		    && c != '\n' && c != '\t' && c != ' ' && c != ',') {
 			if (c == '\\')
 			if (c == '\\')
-				c = __getc_unlocked(cfile);
+				c = getc_unlocked(cfile);
 			*cp++ = c;
 			*cp++ = c;
 		}
 		}
 	}
 	}
@@ -327,7 +340,7 @@ token()
 	if (tokval[0] == 0)
 	if (tokval[0] == 0)
 		return (0);
 		return (0);
 	for (i = 0; i < (int) (sizeof (toktab) / sizeof (toktab[0])); ++i)
 	for (i = 0; i < (int) (sizeof (toktab) / sizeof (toktab[0])); ++i)
-		if (!__strcmp(&tokstr[toktab[i].tokstr_off], tokval))
+		if (!strcmp(&tokstr[toktab[i].tokstr_off], tokval))
 			return toktab[i].tval;
 			return toktab[i].tval;
 	return (ID);
 	return (ID);
 }
 }

+ 72 - 59
libc/inet/rpc/svc.c

@@ -36,17 +36,6 @@
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define ffs __ffs
-#define pmap_set __pmap_set
-#define pmap_unset __pmap_unset
-#define _authenticate _authenticate_internal
-#define _rpc_dtablesize _rpc_dtablesize_internal
-/* used by svc_[max_]pollfd */
-#define __rpc_thread_svc_pollfd __rpc_thread_svc_pollfd_internal
-#define __rpc_thread_svc_max_pollfd __rpc_thread_svc_max_pollfd_internal
-/* used by svc_fdset */
-#define __rpc_thread_svc_fdset __rpc_thread_svc_fdset_internal
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -58,6 +47,17 @@
 #include <rpc/pmap_clnt.h>
 #include <rpc/pmap_clnt.h>
 #include <sys/poll.h>
 #include <sys/poll.h>
 
 
+libc_hidden_proto(ffs)
+libc_hidden_proto(pmap_set)
+libc_hidden_proto(pmap_unset)
+libc_hidden_proto(_authenticate)
+libc_hidden_proto(_rpc_dtablesize)
+/* used by svc_[max_]pollfd */
+libc_hidden_proto(__rpc_thread_svc_pollfd)
+libc_hidden_proto(__rpc_thread_svc_max_pollfd)
+/* used by svc_fdset */
+libc_hidden_proto(__rpc_thread_svc_fdset)
+
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 #define xports (*(SVCXPRT ***)&RPC_THREAD_VARIABLE(svc_xports_s))
 #define xports (*(SVCXPRT ***)&RPC_THREAD_VARIABLE(svc_xports_s))
 #else
 #else
@@ -86,8 +86,8 @@ static struct svc_callout *svc_head;
 /* ***************  SVCXPRT related stuff **************** */
 /* ***************  SVCXPRT related stuff **************** */
 
 
 /* Activate a transport handle. */
 /* Activate a transport handle. */
-void attribute_hidden
+void
-__xprt_register (SVCXPRT *xprt)
+xprt_register (SVCXPRT *xprt)
 {
 {
   register int sock = xprt->xp_sock;
   register int sock = xprt->xp_sock;
   register int i;
   register int i;
@@ -126,11 +126,12 @@ __xprt_register (SVCXPRT *xprt)
 					       POLLRDNORM | POLLRDBAND);
 					       POLLRDNORM | POLLRDBAND);
     }
     }
 }
 }
-strong_alias(__xprt_register,xprt_register)
+libc_hidden_proto(xprt_register)
+libc_hidden_def(xprt_register)
 
 
 /* De-activate a transport handle. */
 /* De-activate a transport handle. */
-void attribute_hidden
+void
-__xprt_unregister (SVCXPRT *xprt)
+xprt_unregister (SVCXPRT *xprt)
 {
 {
   register int sock = xprt->xp_sock;
   register int sock = xprt->xp_sock;
   register int i;
   register int i;
@@ -147,7 +148,8 @@ __xprt_unregister (SVCXPRT *xprt)
 	  svc_pollfd[i].fd = -1;
 	  svc_pollfd[i].fd = -1;
     }
     }
 }
 }
-strong_alias(__xprt_unregister,xprt_unregister)
+libc_hidden_proto(xprt_unregister)
+libc_hidden_def(xprt_unregister)
 
 
 
 
 /* ********************** CALLOUT list related stuff ************* */
 /* ********************** CALLOUT list related stuff ************* */
@@ -174,8 +176,8 @@ done:
 /* Add a service program to the callout list.
 /* Add a service program to the callout list.
    The dispatch routine will be called when a rpc request for this
    The dispatch routine will be called when a rpc request for this
    program number comes in. */
    program number comes in. */
-bool_t attribute_hidden
+bool_t
-__svc_register (SVCXPRT * xprt, rpcprog_t prog, rpcvers_t vers,
+svc_register (SVCXPRT * xprt, rpcprog_t prog, rpcvers_t vers,
 	      void (*dispatch) (struct svc_req *, SVCXPRT *),
 	      void (*dispatch) (struct svc_req *, SVCXPRT *),
 	      rpcproc_t protocol)
 	      rpcproc_t protocol)
 {
 {
@@ -205,11 +207,12 @@ pmap_it:
 
 
   return TRUE;
   return TRUE;
 }
 }
-strong_alias(__svc_register,svc_register)
+libc_hidden_proto(svc_register)
+libc_hidden_def(svc_register)
 
 
 /* Remove a service program from the callout list. */
 /* Remove a service program from the callout list. */
-void attribute_hidden
+void
-__svc_unregister (rpcprog_t prog, rpcvers_t vers)
+svc_unregister (rpcprog_t prog, rpcvers_t vers)
 {
 {
   struct svc_callout *prev;
   struct svc_callout *prev;
   register struct svc_callout *s;
   register struct svc_callout *s;
@@ -227,13 +230,14 @@ __svc_unregister (rpcprog_t prog, rpcvers_t vers)
   /* now unregister the information with the local binder service */
   /* now unregister the information with the local binder service */
   pmap_unset (prog, vers);
   pmap_unset (prog, vers);
 }
 }
-strong_alias(__svc_unregister,svc_unregister)
+libc_hidden_proto(svc_unregister)
+libc_hidden_def(svc_unregister)
 
 
 /* ******************* REPLY GENERATION ROUTINES  ************ */
 /* ******************* REPLY GENERATION ROUTINES  ************ */
 
 
 /* Send a reply to an rpc request */
 /* Send a reply to an rpc request */
-bool_t attribute_hidden
+bool_t
-__svc_sendreply (register SVCXPRT *xprt, xdrproc_t xdr_results,
+svc_sendreply (register SVCXPRT *xprt, xdrproc_t xdr_results,
 	       caddr_t xdr_location)
 	       caddr_t xdr_location)
 {
 {
   struct rpc_msg rply;
   struct rpc_msg rply;
@@ -246,7 +250,8 @@ __svc_sendreply (register SVCXPRT *xprt, xdrproc_t xdr_results,
   rply.acpted_rply.ar_results.proc = xdr_results;
   rply.acpted_rply.ar_results.proc = xdr_results;
   return SVC_REPLY (xprt, &rply);
   return SVC_REPLY (xprt, &rply);
 }
 }
-strong_alias(__svc_sendreply,svc_sendreply)
+libc_hidden_proto(svc_sendreply)
+libc_hidden_def(svc_sendreply)
 
 
 /* No procedure error reply */
 /* No procedure error reply */
 void
 void
@@ -262,8 +267,8 @@ svcerr_noproc (register SVCXPRT *xprt)
 }
 }
 
 
 /* Can't decode args error reply */
 /* Can't decode args error reply */
-void attribute_hidden
+void
-__svcerr_decode (register SVCXPRT *xprt)
+svcerr_decode (register SVCXPRT *xprt)
 {
 {
   struct rpc_msg rply;
   struct rpc_msg rply;
 
 
@@ -273,7 +278,8 @@ __svcerr_decode (register SVCXPRT *xprt)
   rply.acpted_rply.ar_stat = GARBAGE_ARGS;
   rply.acpted_rply.ar_stat = GARBAGE_ARGS;
   SVC_REPLY (xprt, &rply);
   SVC_REPLY (xprt, &rply);
 }
 }
-strong_alias(__svcerr_decode,svcerr_decode)
+libc_hidden_proto(svcerr_decode)
+libc_hidden_def(svcerr_decode)
 
 
 /* Some system error */
 /* Some system error */
 void
 void
@@ -289,8 +295,8 @@ svcerr_systemerr (register SVCXPRT *xprt)
 }
 }
 
 
 /* Authentication error reply */
 /* Authentication error reply */
-void attribute_hidden
+void
-__svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
+svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
 {
 {
   struct rpc_msg rply;
   struct rpc_msg rply;
 
 
@@ -300,18 +306,19 @@ __svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
   rply.rjcted_rply.rj_why = why;
   rply.rjcted_rply.rj_why = why;
   SVC_REPLY (xprt, &rply);
   SVC_REPLY (xprt, &rply);
 }
 }
-strong_alias(__svcerr_auth,svcerr_auth)
+libc_hidden_proto(svcerr_auth)
+libc_hidden_def(svcerr_auth)
 
 
 /* Auth too weak error reply */
 /* Auth too weak error reply */
 void
 void
 svcerr_weakauth (SVCXPRT *xprt)
 svcerr_weakauth (SVCXPRT *xprt)
 {
 {
-  __svcerr_auth (xprt, AUTH_TOOWEAK);
+  svcerr_auth (xprt, AUTH_TOOWEAK);
 }
 }
 
 
 /* Program unavailable error reply */
 /* Program unavailable error reply */
-void attribute_hidden
+void
-__svcerr_noprog (register SVCXPRT *xprt)
+svcerr_noprog (register SVCXPRT *xprt)
 {
 {
   struct rpc_msg rply;
   struct rpc_msg rply;
 
 
@@ -321,11 +328,12 @@ __svcerr_noprog (register SVCXPRT *xprt)
   rply.acpted_rply.ar_stat = PROG_UNAVAIL;
   rply.acpted_rply.ar_stat = PROG_UNAVAIL;
   SVC_REPLY (xprt, &rply);
   SVC_REPLY (xprt, &rply);
 }
 }
-strong_alias(__svcerr_noprog,svcerr_noprog)
+libc_hidden_proto(svcerr_noprog)
+libc_hidden_def(svcerr_noprog)
 
 
 /* Program version mismatch error reply */
 /* Program version mismatch error reply */
-void attribute_hidden
+void
-__svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
+svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
 		 rpcvers_t high_vers)
 		 rpcvers_t high_vers)
 {
 {
   struct rpc_msg rply;
   struct rpc_msg rply;
@@ -338,7 +346,8 @@ __svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
   rply.acpted_rply.ar_vers.high = high_vers;
   rply.acpted_rply.ar_vers.high = high_vers;
   SVC_REPLY (xprt, &rply);
   SVC_REPLY (xprt, &rply);
 }
 }
-strong_alias(__svcerr_progvers,svcerr_progvers)
+libc_hidden_proto(svcerr_progvers)
+libc_hidden_def(svcerr_progvers)
 
 
 /* ******************* SERVER INPUT STUFF ******************* */
 /* ******************* SERVER INPUT STUFF ******************* */
 
 
@@ -358,8 +367,8 @@ strong_alias(__svcerr_progvers,svcerr_progvers)
  * is mallocated in kernel land.
  * is mallocated in kernel land.
  */
  */
 
 
-void attribute_hidden
+void
-__svc_getreq_common (const int fd)
+svc_getreq_common (const int fd)
 {
 {
   enum xprt_stat stat;
   enum xprt_stat stat;
   struct rpc_msg msg;
   struct rpc_msg msg;
@@ -403,7 +412,7 @@ __svc_getreq_common (const int fd)
 	    }
 	    }
 	  else if ((why = _authenticate (&r, &msg)) != AUTH_OK)
 	  else if ((why = _authenticate (&r, &msg)) != AUTH_OK)
 	    {
 	    {
-	      __svcerr_auth (xprt, why);
+	      svcerr_auth (xprt, why);
 	      goto call_done;
 	      goto call_done;
 	    }
 	    }
 
 
@@ -433,9 +442,9 @@ __svc_getreq_common (const int fd)
 	  /* if we got here, the program or version
 	  /* if we got here, the program or version
 	     is not served ... */
 	     is not served ... */
 	  if (prog_found)
 	  if (prog_found)
-	    __svcerr_progvers (xprt, low_vers, high_vers);
+	    svcerr_progvers (xprt, low_vers, high_vers);
 	  else
 	  else
-	    __svcerr_noprog (xprt);
+	    svcerr_noprog (xprt);
 	  /* Fall through to ... */
 	  /* Fall through to ... */
 	}
 	}
     call_done:
     call_done:
@@ -447,10 +456,11 @@ __svc_getreq_common (const int fd)
     }
     }
   while (stat == XPRT_MOREREQS);
   while (stat == XPRT_MOREREQS);
 }
 }
-strong_alias(__svc_getreq_common,svc_getreq_common)
+libc_hidden_proto(svc_getreq_common)
+libc_hidden_def(svc_getreq_common)
 
 
-void attribute_hidden
+void
-__svc_getreqset (fd_set *readfds)
+svc_getreqset (fd_set *readfds)
 {
 {
   register u_int32_t mask;
   register u_int32_t mask;
   register u_int32_t *maskp;
   register u_int32_t *maskp;
@@ -462,23 +472,25 @@ __svc_getreqset (fd_set *readfds)
   maskp = (u_int32_t *) readfds->fds_bits;
   maskp = (u_int32_t *) readfds->fds_bits;
   for (sock = 0; sock < setsize; sock += 32)
   for (sock = 0; sock < setsize; sock += 32)
     for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
     for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
-      __svc_getreq_common (sock + bit - 1);
+      svc_getreq_common (sock + bit - 1);
 }
 }
-strong_alias(__svc_getreqset,svc_getreqset)
+libc_hidden_proto(svc_getreqset)
+libc_hidden_def(svc_getreqset)
 
 
-void attribute_hidden
+void
-__svc_getreq (int rdfds)
+svc_getreq (int rdfds)
 {
 {
   fd_set readfds;
   fd_set readfds;
 
 
   FD_ZERO (&readfds);
   FD_ZERO (&readfds);
   readfds.fds_bits[0] = rdfds;
   readfds.fds_bits[0] = rdfds;
-  __svc_getreqset (&readfds);
+  svc_getreqset (&readfds);
 }
 }
-strong_alias(__svc_getreq,svc_getreq)
+libc_hidden_proto(svc_getreq)
+libc_hidden_def(svc_getreq)
 
 
-void attribute_hidden
+void
-__svc_getreq_poll (struct pollfd *pfdp, int pollretval)
+svc_getreq_poll (struct pollfd *pfdp, int pollretval)
 {
 {
   register int i;
   register int i;
   register int fds_found;
   register int fds_found;
@@ -493,13 +505,14 @@ __svc_getreq_poll (struct pollfd *pfdp, int pollretval)
 	  ++fds_found;
 	  ++fds_found;
 
 
 	  if (p->revents & POLLNVAL)
 	  if (p->revents & POLLNVAL)
-	    __xprt_unregister (xports[p->fd]);
+	    xprt_unregister (xports[p->fd]);
 	  else
 	  else
-	    __svc_getreq_common (p->fd);
+	    svc_getreq_common (p->fd);
 	}
 	}
     }
     }
 }
 }
-strong_alias(__svc_getreq_poll,svc_getreq_poll)
+libc_hidden_proto(svc_getreq_poll)
+libc_hidden_def(svc_getreq_poll)
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 
 
@@ -508,7 +521,7 @@ void attribute_hidden __rpc_thread_svc_cleanup (void)
   struct svc_callout *svcp;
   struct svc_callout *svcp;
 
 
   while ((svcp = svc_head) != NULL)
   while ((svcp = svc_head) != NULL)
-    __svc_unregister (svcp->sc_prog, svcp->sc_vers);
+    svc_unregister (svcp->sc_prog, svcp->sc_vers);
 }
 }
 
 
 #endif /* __UCLIBC_HAS_THREADS__ */
 #endif /* __UCLIBC_HAS_THREADS__ */

+ 4 - 3
libc/inet/rpc/svc_auth.c

@@ -101,8 +101,8 @@ svcauthsw[] =
  * There is an assumption that any flavour less than AUTH_NULL is
  * There is an assumption that any flavour less than AUTH_NULL is
  * invalid.
  * invalid.
  */
  */
-enum auth_stat attribute_hidden
+enum auth_stat
-_authenticate_internal (register struct svc_req *rqst, struct rpc_msg *msg)
+_authenticate (register struct svc_req *rqst, struct rpc_msg *msg)
 {
 {
   register int cred_flavor;
   register int cred_flavor;
 
 
@@ -115,7 +115,8 @@ _authenticate_internal (register struct svc_req *rqst, struct rpc_msg *msg)
 
 
   return AUTH_REJECTEDCRED;
   return AUTH_REJECTEDCRED;
 }
 }
-strong_alias(_authenticate_internal,_authenticate)
+libc_hidden_proto(_authenticate)
+libc_hidden_def(_authenticate)
 
 
 static enum auth_stat
 static enum auth_stat
 _svcauth_null (struct svc_req *rqst attribute_unused, struct rpc_msg *msg attribute_unused)
 _svcauth_null (struct svc_req *rqst attribute_unused, struct rpc_msg *msg attribute_unused)

+ 7 - 5
libc/inet/rpc/svc_auth_unix.c

@@ -38,9 +38,6 @@
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define xdrmem_create __xdrmem_create
-#define xdr_authunix_parms __xdr_authunix_parms
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -50,6 +47,11 @@
 #include <rpc/rpc.h>
 #include <rpc/rpc.h>
 #include <rpc/svc.h>
 #include <rpc/svc.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(printf)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_authunix_parms)
+
 /*
 /*
  * Unix longhand authenticator
  * Unix longhand authenticator
  */
  */
@@ -88,7 +90,7 @@ _svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg)
 	  stat = AUTH_BADCRED;
 	  stat = AUTH_BADCRED;
 	  goto done;
 	  goto done;
 	}
 	}
-      __memcpy (aup->aup_machname, (caddr_t) buf, (u_int) str_len);
+      memcpy (aup->aup_machname, (caddr_t) buf, (u_int) str_len);
       aup->aup_machname[str_len] = 0;
       aup->aup_machname[str_len] = 0;
       str_len = RNDUP (str_len);
       str_len = RNDUP (str_len);
       buf = (int32_t *) ((char *) buf + str_len);
       buf = (int32_t *) ((char *) buf + str_len);
@@ -111,7 +113,7 @@ _svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg)
        */
        */
       if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len)
       if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len)
 	{
 	{
-	  (void) __printf ("bad auth_len gid %d str %d auth %d\n",
+	  (void) printf ("bad auth_len gid %d str %d auth %d\n",
 			 gid_len, str_len, auth_len);
 			 gid_len, str_len, auth_len);
 	  stat = AUTH_BADCRED;
 	  stat = AUTH_BADCRED;
 	  goto done;
 	  goto done;

+ 4 - 4
libc/inet/rpc/svc_raw.c

@@ -40,15 +40,15 @@ static char sccsid[] = "@(#)svc_raw.c 1.15 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define xdrmem_create __xdrmem_create
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include "rpc_private.h"
 #include "rpc_private.h"
 #include <rpc/svc.h>
 #include <rpc/svc.h>
 
 
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+
 /*
 /*
  * This is the "network" that we will be moving data over
  * This is the "network" that we will be moving data over
  */
  */

+ 8 - 8
libc/inet/rpc/svc_run.c

@@ -31,13 +31,6 @@
  * Wait for input, call server program.
  * Wait for input, call server program.
  */
  */
 
 
-#define svc_getreq_poll __svc_getreq_poll
-#define poll __poll
-
-/* used by svc_[max_]pollfd */
-#define __rpc_thread_svc_pollfd __rpc_thread_svc_pollfd_internal
-#define __rpc_thread_svc_max_pollfd __rpc_thread_svc_max_pollfd_internal
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -47,6 +40,13 @@
 #include <sys/poll.h>
 #include <sys/poll.h>
 #include <rpc/rpc.h>
 #include <rpc/rpc.h>
 
 
+libc_hidden_proto(perror)
+libc_hidden_proto(svc_getreq_poll)
+libc_hidden_proto(poll)
+/* used by svc_[max_]pollfd */
+libc_hidden_proto(__rpc_thread_svc_pollfd)
+libc_hidden_proto(__rpc_thread_svc_max_pollfd)
+
 /* This function can be used as a signal handler to terminate the
 /* This function can be used as a signal handler to terminate the
    server loop.  */
    server loop.  */
 void
 void
@@ -83,7 +83,7 @@ svc_run (void)
 	  free (my_pollfd);
 	  free (my_pollfd);
 	  if (errno == EINTR)
 	  if (errno == EINTR)
 	    continue;
 	    continue;
-	  __perror (_("svc_run: - poll failed"));
+	  perror (_("svc_run: - poll failed"));
 	  return;
 	  return;
 	case 0:
 	case 0:
 	  free (my_pollfd);
 	  free (my_pollfd);

+ 19 - 15
libc/inet/rpc/svc_simple.c

@@ -38,14 +38,6 @@ static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define svc_sendreply __svc_sendreply
-#define svc_register __svc_register
-#define svcerr_decode __svcerr_decode
-#define svcudp_create __svcudp_create
-#define pmap_unset __pmap_unset
-#define asprintf __asprintf
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -64,6 +56,18 @@ static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";
 # define fputs(s, f) _IO_fputs (s, f)
 # define fputs(s, f) _IO_fputs (s, f)
 #endif
 #endif
 
 
+libc_hidden_proto(strdup)
+libc_hidden_proto(memset)
+libc_hidden_proto(asprintf)
+libc_hidden_proto(fputs)
+libc_hidden_proto(write)
+libc_hidden_proto(exit)
+libc_hidden_proto(svc_sendreply)
+libc_hidden_proto(svc_register)
+libc_hidden_proto(svcerr_decode)
+libc_hidden_proto(svcudp_create)
+libc_hidden_proto(pmap_unset)
+
 struct proglst_
 struct proglst_
   {
   {
     char *(*p_progname) (char *);
     char *(*p_progname) (char *);
@@ -105,7 +109,7 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum,
       transp = svcudp_create (RPC_ANYSOCK);
       transp = svcudp_create (RPC_ANYSOCK);
       if (transp == NULL)
       if (transp == NULL)
 	{
 	{
-	  buf = __strdup (_("couldn't create an rpc server\n"));
+	  buf = strdup (_("couldn't create an rpc server\n"));
 	  goto err_out;
 	  goto err_out;
 	}
 	}
     }
     }
@@ -120,7 +124,7 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum,
   pl = (struct proglst_ *) malloc (sizeof (struct proglst_));
   pl = (struct proglst_ *) malloc (sizeof (struct proglst_));
   if (pl == NULL)
   if (pl == NULL)
     {
     {
-      buf = __strdup (_("registerrpc: out of memory\n"));
+      buf = strdup (_("registerrpc: out of memory\n"));
       goto err_out;
       goto err_out;
     }
     }
   pl->p_progname = progname;
   pl->p_progname = progname;
@@ -159,8 +163,8 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
     {
     {
       if (svc_sendreply (transp_l, (xdrproc_t)xdr_void, (char *) NULL) == FALSE)
       if (svc_sendreply (transp_l, (xdrproc_t)xdr_void, (char *) NULL) == FALSE)
 	{
 	{
-	  __write (STDERR_FILENO, "xxx\n", 4);
+	  write (STDERR_FILENO, "xxx\n", 4);
-	  __exit (1);
+	  exit (1);
 	}
 	}
       return;
       return;
     }
     }
@@ -170,7 +174,7 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
     if (pl->p_prognum == prog && pl->p_procnum == proc)
     if (pl->p_prognum == prog && pl->p_procnum == proc)
       {
       {
 	/* decode arguments into a CLEAN buffer */
 	/* decode arguments into a CLEAN buffer */
-	__memset (xdrbuf, 0, sizeof (xdrbuf));	/* required ! */
+	memset (xdrbuf, 0, sizeof (xdrbuf));	/* required ! */
 	if (!svc_getargs (transp_l, pl->p_inproc, xdrbuf))
 	if (!svc_getargs (transp_l, pl->p_inproc, xdrbuf))
 	  {
 	  {
 	    svcerr_decode (transp_l);
 	    svcerr_decode (transp_l);
@@ -185,7 +189,7 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
 	    (void) asprintf (&buf,
 	    (void) asprintf (&buf,
 			       _("trouble replying to prog %d\n"),
 			       _("trouble replying to prog %d\n"),
 			       pl->p_prognum);
 			       pl->p_prognum);
-	    __exit (1);
+	    exit (1);
 	  }
 	  }
 	/* free the decoded arguments */
 	/* free the decoded arguments */
 	(void) svc_freeargs (transp_l, pl->p_inproc, xdrbuf);
 	(void) svc_freeargs (transp_l, pl->p_inproc, xdrbuf);
@@ -199,5 +203,5 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
 #endif
 #endif
     fputs (buf, stderr);
     fputs (buf, stderr);
   free (buf);
   free (buf);
-  __exit (1);
+  exit (1);
 }
 }

+ 34 - 25
libc/inet/rpc/svc_tcp.c

@@ -41,22 +41,6 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
  * and a record/tcp stream.
  * and a record/tcp stream.
  */
  */
 
 
-#define xdrrec_create __xdrrec_create
-#define xdrrec_endofrecord __xdrrec_endofrecord
-#define xdrrec_skiprecord __xdrrec_skiprecord
-#define xdrrec_eof __xdrrec_eof
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-#define xprt_register __xprt_register
-#define xprt_unregister __xprt_unregister
-#define getsockname __getsockname
-#define bind __bind
-#define bindresvport __bindresvport
-#define poll __poll
-#define accept __accept
-#define listen __listen
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -76,6 +60,31 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 # define fputs(s, f) _IO_fputs (s, f)
 # define fputs(s, f) _IO_fputs (s, f)
 #endif
 #endif
 
 
+libc_hidden_proto(memset)
+libc_hidden_proto(memcpy)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(perror)
+libc_hidden_proto(xdrrec_create)
+libc_hidden_proto(xdrrec_endofrecord)
+libc_hidden_proto(xdrrec_skiprecord)
+libc_hidden_proto(xdrrec_eof)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xprt_register)
+libc_hidden_proto(xprt_unregister)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(bind)
+libc_hidden_proto(bindresvport)
+libc_hidden_proto(poll)
+libc_hidden_proto(accept)
+libc_hidden_proto(listen)
+libc_hidden_proto(fputs)
+libc_hidden_proto(fclose)
+libc_hidden_proto(abort)
+
 /*
 /*
  * Ops vector for TCP/IP based rpc service handle
  * Ops vector for TCP/IP based rpc service handle
  */
  */
@@ -170,14 +179,14 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
 
 
   if (sock == RPC_ANYSOCK)
   if (sock == RPC_ANYSOCK)
     {
     {
-      if ((sock = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+      if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
 	{
 	{
-	  __perror (_("svc_tcp.c - tcp socket creation problem"));
+	  perror (_("svc_tcp.c - tcp socket creation problem"));
 	  return (SVCXPRT *) NULL;
 	  return (SVCXPRT *) NULL;
 	}
 	}
       madesock = TRUE;
       madesock = TRUE;
     }
     }
-  __memset ((char *) &addr, 0, sizeof (addr));
+  memset ((char *) &addr, 0, sizeof (addr));
   addr.sin_family = AF_INET;
   addr.sin_family = AF_INET;
   if (bindresvport (sock, &addr))
   if (bindresvport (sock, &addr))
     {
     {
@@ -187,9 +196,9 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
   if ((getsockname (sock, (struct sockaddr *) &addr, &len) != 0) ||
   if ((getsockname (sock, (struct sockaddr *) &addr, &len) != 0) ||
       (listen (sock, 2) != 0))
       (listen (sock, 2) != 0))
     {
     {
-      __perror (_("svc_tcp.c - cannot getsockname or listen"));
+      perror (_("svc_tcp.c - cannot getsockname or listen"));
       if (madesock)
       if (madesock)
-	(void) __close (sock);
+	(void) close (sock);
       return (SVCXPRT *) NULL;
       return (SVCXPRT *) NULL;
     }
     }
   r = (struct tcp_rendezvous *) mem_alloc (sizeof (*r));
   r = (struct tcp_rendezvous *) mem_alloc (sizeof (*r));
@@ -285,7 +294,7 @@ again:
    * make a new transporter (re-uses xprt)
    * make a new transporter (re-uses xprt)
    */
    */
   xprt = makefd_xprt (sock, r->sendsize, r->recvsize);
   xprt = makefd_xprt (sock, r->sendsize, r->recvsize);
-  __memcpy (&xprt->xp_raddr, &addr, sizeof (addr));
+  memcpy (&xprt->xp_raddr, &addr, sizeof (addr));
   xprt->xp_addrlen = len;
   xprt->xp_addrlen = len;
   return FALSE;		/* there is never an rpc msg to be processed */
   return FALSE;		/* there is never an rpc msg to be processed */
 }
 }
@@ -302,7 +311,7 @@ svctcp_destroy (SVCXPRT *xprt)
   struct tcp_conn *cd = (struct tcp_conn *) xprt->xp_p1;
   struct tcp_conn *cd = (struct tcp_conn *) xprt->xp_p1;
 
 
   xprt_unregister (xprt);
   xprt_unregister (xprt);
-  (void) __close (xprt->xp_sock);
+  (void) close (xprt->xp_sock);
   if (xprt->xp_port != 0)
   if (xprt->xp_port != 0)
     {
     {
       /* a rendezvouser socket */
       /* a rendezvouser socket */
@@ -352,7 +361,7 @@ readtcp (char *xprtptr, char *buf, int len)
     }
     }
   while ((pollfd.revents & POLLIN) == 0);
   while ((pollfd.revents & POLLIN) == 0);
 
 
-  if ((len = __read (sock, buf, len)) > 0)
+  if ((len = read (sock, buf, len)) > 0)
     return len;
     return len;
 
 
  fatal_err:
  fatal_err:
@@ -372,7 +381,7 @@ writetcp (char *xprtptr, char * buf, int len)
 
 
   for (cnt = len; cnt > 0; cnt -= i, buf += i)
   for (cnt = len; cnt > 0; cnt -= i, buf += i)
     {
     {
-      if ((i = __write (xprt->xp_sock, buf, cnt)) < 0)
+      if ((i = write (xprt->xp_sock, buf, cnt)) < 0)
 	{
 	{
 	  ((struct tcp_conn *) (xprt->xp_p1))->strm_stat = XPRT_DIED;
 	  ((struct tcp_conn *) (xprt->xp_p1))->strm_stat = XPRT_DIED;
 	  return -1;
 	  return -1;

+ 44 - 34
libc/inet/rpc/svc_udp.c

@@ -39,21 +39,6 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
  */
 
 
-#define xprt_register __xprt_register
-#define xprt_unregister __xprt_unregister
-#define xdrmem_create __xdrmem_create
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-#define getsockname __getsockname
-#define setsockopt __setsockopt
-#define bind __bind
-#define bindresvport __bindresvport
-#define recvfrom __recvfrom
-#define sendto __sendto
-#define recvmsg __recvmsg
-#define sendmsg __sendmsg
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -73,8 +58,31 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
 # include <wchar.h>
 # include <wchar.h>
 # include <libio/iolibio.h>
 # include <libio/iolibio.h>
 # define fputs(s, f) _IO_fputs (s, f)
 # define fputs(s, f) _IO_fputs (s, f)
+libc_hidden_proto(fwprintf)
 #endif
 #endif
 
 
+libc_hidden_proto(memcmp)
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(perror)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(xprt_register)
+libc_hidden_proto(xprt_unregister)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(setsockopt)
+libc_hidden_proto(bind)
+libc_hidden_proto(bindresvport)
+libc_hidden_proto(recvfrom)
+libc_hidden_proto(sendto)
+libc_hidden_proto(recvmsg)
+libc_hidden_proto(sendmsg)
+libc_hidden_proto(fputs)
+libc_hidden_proto(fprintf)
+
 #define rpc_buffer(xprt) ((xprt)->xp_p1)
 #define rpc_buffer(xprt) ((xprt)->xp_p1)
 #ifndef MAX
 #ifndef MAX
 #define MAX(a, b)     ((a > b) ? a : b)
 #define MAX(a, b)     ((a > b) ? a : b)
@@ -127,8 +135,8 @@ struct svcudp_data
  * see (svc.h, xprt_register).
  * see (svc.h, xprt_register).
  * The routines returns NULL if a problem occurred.
  * The routines returns NULL if a problem occurred.
  */
  */
-SVCXPRT attribute_hidden *
+SVCXPRT *
-__svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
+svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
 {
 {
   bool_t madesock = FALSE;
   bool_t madesock = FALSE;
   SVCXPRT *xprt;
   SVCXPRT *xprt;
@@ -140,14 +148,14 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
 
 
   if (sock == RPC_ANYSOCK)
   if (sock == RPC_ANYSOCK)
     {
     {
-      if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+      if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
 	{
 	{
-	  __perror (_("svcudp_create: socket creation problem"));
+	  perror (_("svcudp_create: socket creation problem"));
 	  return (SVCXPRT *) NULL;
 	  return (SVCXPRT *) NULL;
 	}
 	}
       madesock = TRUE;
       madesock = TRUE;
     }
     }
-  __memset ((char *) &addr, 0, sizeof (addr));
+  memset ((char *) &addr, 0, sizeof (addr));
   addr.sin_family = AF_INET;
   addr.sin_family = AF_INET;
   if (bindresvport (sock, &addr))
   if (bindresvport (sock, &addr))
     {
     {
@@ -156,9 +164,9 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
     }
     }
   if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0)
   if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0)
     {
     {
-      __perror (_("svcudp_create - cannot getsockname"));
+      perror (_("svcudp_create - cannot getsockname"));
       if (madesock)
       if (madesock)
-	(void) __close (sock);
+	(void) close (sock);
       return (SVCXPRT *) NULL;
       return (SVCXPRT *) NULL;
     }
     }
   xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT));
   xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT));
@@ -168,7 +176,7 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
     {
     {
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
       if (_IO_fwide (stderr, 0) > 0)
-	(void) __fwprintf (stderr, L"%s", _("svcudp_create: out of memory\n"));
+	(void) fwprintf (stderr, L"%s", _("svcudp_create: out of memory\n"));
       else
       else
 #endif
 #endif
 	(void) fputs (_("svcudp_create: out of memory\n"), stderr);
 	(void) fputs (_("svcudp_create: out of memory\n"), stderr);
@@ -194,7 +202,7 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
     {
     {
 # ifdef USE_IN_LIBIO
 # ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
       if (_IO_fwide (stderr, 0) > 0)
-	(void) __fwprintf (stderr, L"%s",
+	(void) fwprintf (stderr, L"%s",
 			   _("svcudp_create: xp_pad is too small for IP_PKTINFO\n"));
 			   _("svcudp_create: xp_pad is too small for IP_PKTINFO\n"));
       else
       else
 # endif
 # endif
@@ -211,20 +219,22 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
 #endif
 #endif
     /* Clear the padding. */
     /* Clear the padding. */
     pad = 0;
     pad = 0;
-  __memset (&xprt->xp_pad [0], pad, sizeof (xprt->xp_pad));
+  memset (&xprt->xp_pad [0], pad, sizeof (xprt->xp_pad));
 
 
   xprt_register (xprt);
   xprt_register (xprt);
   return xprt;
   return xprt;
 }
 }
-strong_alias(__svcudp_bufcreate,svcudp_bufcreate)
+libc_hidden_proto(svcudp_bufcreate)
+libc_hidden_def(svcudp_bufcreate)
 
 
-SVCXPRT attribute_hidden *
+SVCXPRT *
-__svcudp_create (int sock)
+svcudp_create (int sock)
 {
 {
 
 
-  return __svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
+  return svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
 }
 }
-strong_alias(__svcudp_create,svcudp_create)
+libc_hidden_proto(svcudp_create)
+libc_hidden_def(svcudp_create)
 
 
 static enum xprt_stat
 static enum xprt_stat
 svcudp_stat (xprt)
 svcudp_stat (xprt)
@@ -387,7 +397,7 @@ svcudp_destroy (xprt)
   struct svcudp_data *su = su_data (xprt);
   struct svcudp_data *su = su_data (xprt);
 
 
   xprt_unregister (xprt);
   xprt_unregister (xprt);
-  (void) __close (xprt->xp_sock);
+  (void) close (xprt->xp_sock);
   XDR_DESTROY (&(su->su_xdrs));
   XDR_DESTROY (&(su->su_xdrs));
   mem_free (rpc_buffer (xprt), su->su_iosz);
   mem_free (rpc_buffer (xprt), su->su_iosz);
   mem_free ((caddr_t) su, sizeof (struct svcudp_data));
   mem_free ((caddr_t) su, sizeof (struct svcudp_data));
@@ -420,7 +430,7 @@ svcudp_destroy (xprt)
 	(type *) mem_alloc((unsigned) (sizeof(type) * (size)))
 	(type *) mem_alloc((unsigned) (sizeof(type) * (size)))
 
 
 #define BZERO(addr, type, size)	 \
 #define BZERO(addr, type, size)	 \
-	__memset((char *) addr, 0, sizeof(type) * (int) (size))
+	memset((char *) addr, 0, sizeof(type) * (int) (size))
 
 
 /*
 /*
  * An entry in the cache
  * An entry in the cache
@@ -598,7 +608,7 @@ cache_get (xprt, msg, replyp, replylenp)
   struct svcudp_data *su = su_data (xprt);
   struct svcudp_data *su = su_data (xprt);
   struct udp_cache *uc = (struct udp_cache *) su->su_cache;
   struct udp_cache *uc = (struct udp_cache *) su->su_cache;
 
 
-#define EQADDR(a1, a2)	(__memcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0)
+#define EQADDR(a1, a2)	(memcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0)
 
 
   loc = CACHE_LOC (xprt, su->su_xid);
   loc = CACHE_LOC (xprt, su->su_xid);
   for (ent = uc->uc_entries[loc]; ent != NULL; ent = ent->cache_next)
   for (ent = uc->uc_entries[loc]; ent != NULL; ent = ent->cache_next)
@@ -621,6 +631,6 @@ cache_get (xprt, msg, replyp, replylenp)
   uc->uc_proc = msg->rm_call.cb_proc;
   uc->uc_proc = msg->rm_call.cb_proc;
   uc->uc_vers = msg->rm_call.cb_vers;
   uc->uc_vers = msg->rm_call.cb_vers;
   uc->uc_prog = msg->rm_call.cb_prog;
   uc->uc_prog = msg->rm_call.cb_prog;
-  __memcpy (&uc->uc_addr, &xprt->xp_raddr, sizeof (uc->uc_addr));
+  memcpy (&uc->uc_addr, &xprt->xp_raddr, sizeof (uc->uc_addr));
   return 0;
   return 0;
 }
 }

+ 40 - 32
libc/inet/rpc/svc_unix.c

@@ -37,26 +37,6 @@
  * and a record/unix stream.
  * and a record/unix stream.
  */
  */
 
 
-#define xdrrec_create __xdrrec_create
-#define xdrrec_endofrecord __xdrrec_endofrecord
-#define xdrrec_skiprecord __xdrrec_skiprecord
-#define xdrrec_eof __xdrrec_eof
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-#define xprt_register __xprt_register
-#define xprt_unregister __xprt_unregister
-#define getegid __getegid
-#define geteuid __geteuid
-#define getsockname __getsockname
-#define setsockopt __setsockopt
-#define bind __bind
-#define recvmsg __recvmsg
-#define sendmsg __sendmsg
-#define poll __poll
-#define accept __accept
-#define listen __listen
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 
 
@@ -75,6 +55,34 @@
 # include <wchar.h>
 # include <wchar.h>
 #endif
 #endif
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(strlen)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(perror)
+libc_hidden_proto(getpid)
+libc_hidden_proto(xdrrec_create)
+libc_hidden_proto(xdrrec_endofrecord)
+libc_hidden_proto(xdrrec_skiprecord)
+libc_hidden_proto(xdrrec_eof)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xprt_register)
+libc_hidden_proto(xprt_unregister)
+libc_hidden_proto(getegid)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(setsockopt)
+libc_hidden_proto(bind)
+libc_hidden_proto(recvmsg)
+libc_hidden_proto(sendmsg)
+libc_hidden_proto(poll)
+libc_hidden_proto(accept)
+libc_hidden_proto(listen)
+libc_hidden_proto(fputs)
+libc_hidden_proto(abort)
+
 /*
 /*
  * Ops vector for AF_UNIX based rpc service handle
  * Ops vector for AF_UNIX based rpc service handle
  */
  */
@@ -167,17 +175,17 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path)
 
 
   if (sock == RPC_ANYSOCK)
   if (sock == RPC_ANYSOCK)
     {
     {
-      if ((sock = __socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
+      if ((sock = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
 	{
 	{
-	  __perror (_("svc_unix.c - AF_UNIX socket creation problem"));
+	  perror (_("svc_unix.c - AF_UNIX socket creation problem"));
 	  return (SVCXPRT *) NULL;
 	  return (SVCXPRT *) NULL;
 	}
 	}
       madesock = TRUE;
       madesock = TRUE;
     }
     }
-  __memset (&addr, '\0', sizeof (addr));
+  memset (&addr, '\0', sizeof (addr));
   addr.sun_family = AF_UNIX;
   addr.sun_family = AF_UNIX;
-  len = __strlen (path) + 1;
+  len = strlen (path) + 1;
-  __memcpy (addr.sun_path, path, len);
+  memcpy (addr.sun_path, path, len);
   len += sizeof (addr.sun_family);
   len += sizeof (addr.sun_family);
 
 
   bind (sock, (struct sockaddr *) &addr, len);
   bind (sock, (struct sockaddr *) &addr, len);
@@ -185,9 +193,9 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path)
   if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0
   if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0
       || listen (sock, 2) != 0)
       || listen (sock, 2) != 0)
     {
     {
-      __perror (_("svc_unix.c - cannot getsockname or listen"));
+      perror (_("svc_unix.c - cannot getsockname or listen"));
       if (madesock)
       if (madesock)
-	__close (sock);
+	close (sock);
       return (SVCXPRT *) NULL;
       return (SVCXPRT *) NULL;
     }
     }
 
 
@@ -284,10 +292,10 @@ again:
   /*
   /*
    * make a new transporter (re-uses xprt)
    * make a new transporter (re-uses xprt)
    */
    */
-  __memset (&in_addr, '\0', sizeof (in_addr));
+  memset (&in_addr, '\0', sizeof (in_addr));
   in_addr.sin_family = AF_UNIX;
   in_addr.sin_family = AF_UNIX;
   xprt = makefd_xprt (sock, r->sendsize, r->recvsize);
   xprt = makefd_xprt (sock, r->sendsize, r->recvsize);
-  __memcpy (&xprt->xp_raddr, &in_addr, sizeof (in_addr));
+  memcpy (&xprt->xp_raddr, &in_addr, sizeof (in_addr));
   xprt->xp_addrlen = len;
   xprt->xp_addrlen = len;
   return FALSE;		/* there is never an rpc msg to be processed */
   return FALSE;		/* there is never an rpc msg to be processed */
 }
 }
@@ -304,7 +312,7 @@ svcunix_destroy (SVCXPRT *xprt)
   struct unix_conn *cd = (struct unix_conn *) xprt->xp_p1;
   struct unix_conn *cd = (struct unix_conn *) xprt->xp_p1;
 
 
   xprt_unregister (xprt);
   xprt_unregister (xprt);
-  __close (xprt->xp_sock);
+  close (xprt->xp_sock);
   if (xprt->xp_port != 0)
   if (xprt->xp_port != 0)
     {
     {
       /* a rendezvouser socket */
       /* a rendezvouser socket */
@@ -392,11 +400,11 @@ __msgwrite (int sock, void *data, size_t cnt)
   /* XXX I'm not sure, if gete?id() is always correct, or if we should use
   /* XXX I'm not sure, if gete?id() is always correct, or if we should use
      get?id(). But since keyserv needs geteuid(), we have no other chance.
      get?id(). But since keyserv needs geteuid(), we have no other chance.
      It would be much better, if the kernel could pass both to the server. */
      It would be much better, if the kernel could pass both to the server. */
-  cred.pid = __getpid ();
+  cred.pid = getpid ();
   cred.uid = geteuid ();
   cred.uid = geteuid ();
   cred.gid = getegid ();
   cred.gid = getegid ();
 
 
-  __memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred));
+  memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred));
   cmsg->cmsg_level = SOL_SOCKET;
   cmsg->cmsg_level = SOL_SOCKET;
   cmsg->cmsg_type = SCM_CREDENTIALS;
   cmsg->cmsg_type = SCM_CREDENTIALS;
   cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct ucred);
   cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct ucred);

+ 76 - 61
libc/inet/rpc/xdr.c

@@ -41,8 +41,6 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12";
  * xdr.
  * xdr.
  */
  */
 
 
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -56,8 +54,12 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12";
 
 
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
 # include <wchar.h>
 # include <wchar.h>
+libc_hidden_proto(fwprintf)
 #endif
 #endif
 
 
+libc_hidden_proto(strlen)
+libc_hidden_proto(fputs)
+
 /*
 /*
  * constants specific to the xdr "protocol"
  * constants specific to the xdr "protocol"
  */
  */
@@ -97,8 +99,8 @@ xdr_void (void)
  * The definition of xdr_long() is kept for backward
  * The definition of xdr_long() is kept for backward
  * compatibility. Instead xdr_int() should be used.
  * compatibility. Instead xdr_int() should be used.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_long (XDR *xdrs, long *lp)
+xdr_long (XDR *xdrs, long *lp)
 {
 {
 
 
   if (xdrs->x_op == XDR_ENCODE
   if (xdrs->x_op == XDR_ENCODE
@@ -114,13 +116,14 @@ __xdr_long (XDR *xdrs, long *lp)
 
 
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_long,xdr_long)
+libc_hidden_proto(xdr_long)
+libc_hidden_def(xdr_long)
 
 
 /*
 /*
  * XDR short integers
  * XDR short integers
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_short (XDR *xdrs, short *sp)
+xdr_short (XDR *xdrs, short *sp)
 {
 {
   long l;
   long l;
 
 
@@ -143,13 +146,14 @@ __xdr_short (XDR *xdrs, short *sp)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_short,xdr_short)
+libc_hidden_proto(xdr_short)
+libc_hidden_def(xdr_short)
 
 
 /*
 /*
  * XDR integers
  * XDR integers
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_int (XDR *xdrs, int *ip)
+xdr_int (XDR *xdrs, int *ip)
 {
 {
 
 
 #if INT_MAX < LONG_MAX
 #if INT_MAX < LONG_MAX
@@ -172,22 +176,23 @@ __xdr_int (XDR *xdrs, int *ip)
     }
     }
   return FALSE;
   return FALSE;
 #elif INT_MAX == LONG_MAX
 #elif INT_MAX == LONG_MAX
-  return __xdr_long (xdrs, (long *) ip);
+  return xdr_long (xdrs, (long *) ip);
 #elif INT_MAX == SHRT_MAX
 #elif INT_MAX == SHRT_MAX
-  return __xdr_short (xdrs, (short *) ip);
+  return xdr_short (xdrs, (short *) ip);
 #else
 #else
 #error unexpected integer sizes in xdr_int()
 #error unexpected integer sizes in xdr_int()
 #endif
 #endif
 }
 }
-strong_alias(__xdr_int,xdr_int)
+libc_hidden_proto(xdr_int)
+libc_hidden_def(xdr_int)
 
 
 /*
 /*
  * XDR unsigned long integers
  * XDR unsigned long integers
  * The definition of xdr_u_long() is kept for backward
  * The definition of xdr_u_long() is kept for backward
  * compatibility. Instead xdr_u_int() should be used.
  * compatibility. Instead xdr_u_int() should be used.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_u_long (XDR *xdrs, u_long *ulp)
+xdr_u_long (XDR *xdrs, u_long *ulp)
 {
 {
   switch (xdrs->x_op)
   switch (xdrs->x_op)
     {
     {
@@ -214,13 +219,14 @@ __xdr_u_long (XDR *xdrs, u_long *ulp)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_u_long,xdr_u_long)
+libc_hidden_proto(xdr_u_long)
+libc_hidden_def(xdr_u_long)
 
 
 /*
 /*
  * XDR unsigned integers
  * XDR unsigned integers
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_u_int (XDR *xdrs, u_int *up)
+xdr_u_int (XDR *xdrs, u_int *up)
 {
 {
 #if UINT_MAX < ULONG_MAX
 #if UINT_MAX < ULONG_MAX
   u_long l;
   u_long l;
@@ -242,21 +248,22 @@ __xdr_u_int (XDR *xdrs, u_int *up)
     }
     }
   return FALSE;
   return FALSE;
 #elif UINT_MAX == ULONG_MAX
 #elif UINT_MAX == ULONG_MAX
-  return __xdr_u_long (xdrs, (u_long *) up);
+  return xdr_u_long (xdrs, (u_long *) up);
 #elif UINT_MAX == USHRT_MAX
 #elif UINT_MAX == USHRT_MAX
-  return __xdr_short (xdrs, (short *) up);
+  return xdr_short (xdrs, (short *) up);
 #else
 #else
 #error unexpected integer sizes in xdr_u_int()
 #error unexpected integer sizes in xdr_u_int()
 #endif
 #endif
 }
 }
-strong_alias(__xdr_u_int,xdr_u_int)
+libc_hidden_proto(xdr_u_int)
+libc_hidden_def(xdr_u_int)
 
 
 /*
 /*
  * XDR hyper integers
  * XDR hyper integers
  * same as xdr_u_hyper - open coded to save a proc call!
  * same as xdr_u_hyper - open coded to save a proc call!
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_hyper (XDR *xdrs, quad_t *llp)
+xdr_hyper (XDR *xdrs, quad_t *llp)
 {
 {
   long t1;
   long t1;
   unsigned long int t2;
   unsigned long int t2;
@@ -282,15 +289,16 @@ __xdr_hyper (XDR *xdrs, quad_t *llp)
 
 
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_hyper,xdr_hyper)
+libc_hidden_proto(xdr_hyper)
+libc_hidden_def(xdr_hyper)
 
 
 
 
 /*
 /*
  * XDR hyper integers
  * XDR hyper integers
  * same as xdr_hyper - open coded to save a proc call!
  * same as xdr_hyper - open coded to save a proc call!
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
+xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
 {
 {
   unsigned long t1;
   unsigned long t1;
   unsigned long t2;
   unsigned long t2;
@@ -316,18 +324,19 @@ __xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
 
 
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_u_hyper,xdr_u_hyper)
+libc_hidden_proto(xdr_u_hyper)
+libc_hidden_def(xdr_u_hyper)
 
 
 bool_t
 bool_t
 xdr_longlong_t (XDR *xdrs, quad_t *llp)
 xdr_longlong_t (XDR *xdrs, quad_t *llp)
 {
 {
-  return __xdr_hyper (xdrs, llp);
+  return xdr_hyper (xdrs, llp);
 }
 }
 
 
 bool_t
 bool_t
 xdr_u_longlong_t (XDR *xdrs, u_quad_t *ullp)
 xdr_u_longlong_t (XDR *xdrs, u_quad_t *ullp)
 {
 {
-  return __xdr_u_hyper (xdrs, ullp);
+  return xdr_u_hyper (xdrs, ullp);
 }
 }
 
 
 /*
 /*
@@ -368,7 +377,7 @@ xdr_char (XDR *xdrs, char *cp)
   int i;
   int i;
 
 
   i = (*cp);
   i = (*cp);
-  if (!__xdr_int (xdrs, &i))
+  if (!xdr_int (xdrs, &i))
     {
     {
       return FALSE;
       return FALSE;
     }
     }
@@ -385,7 +394,7 @@ xdr_u_char (XDR *xdrs, u_char *cp)
   u_int u;
   u_int u;
 
 
   u = (*cp);
   u = (*cp);
-  if (!__xdr_u_int (xdrs, &u))
+  if (!xdr_u_int (xdrs, &u))
     {
     {
       return FALSE;
       return FALSE;
     }
     }
@@ -396,8 +405,8 @@ xdr_u_char (XDR *xdrs, u_char *cp)
 /*
 /*
  * XDR booleans
  * XDR booleans
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_bool (XDR *xdrs, bool_t *bp)
+xdr_bool (XDR *xdrs, bool_t *bp)
 {
 {
   long lb;
   long lb;
 
 
@@ -420,13 +429,14 @@ __xdr_bool (XDR *xdrs, bool_t *bp)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_bool,xdr_bool)
+libc_hidden_proto(xdr_bool)
+libc_hidden_def(xdr_bool)
 
 
 /*
 /*
  * XDR enumerations
  * XDR enumerations
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_enum (XDR *xdrs, enum_t *ep)
+xdr_enum (XDR *xdrs, enum_t *ep)
 {
 {
   enum sizecheck
   enum sizecheck
     {
     {
@@ -459,27 +469,28 @@ __xdr_enum (XDR *xdrs, enum_t *ep)
 	}
 	}
       return FALSE;
       return FALSE;
 #else
 #else
-      return __xdr_long (xdrs, (long *) ep);
+      return xdr_long (xdrs, (long *) ep);
 #endif
 #endif
     }
     }
   else if (sizeof (enum sizecheck) == sizeof (short))
   else if (sizeof (enum sizecheck) == sizeof (short))
     {
     {
-      return __xdr_short (xdrs, (short *) ep);
+      return xdr_short (xdrs, (short *) ep);
     }
     }
   else
   else
     {
     {
       return FALSE;
       return FALSE;
     }
     }
 }
 }
-strong_alias(__xdr_enum,xdr_enum)
+libc_hidden_proto(xdr_enum)
+libc_hidden_def(xdr_enum)
 
 
 /*
 /*
  * XDR opaque data
  * XDR opaque data
  * Allows the specification of a fixed size sequence of opaque bytes.
  * Allows the specification of a fixed size sequence of opaque bytes.
  * cp points to the opaque object and cnt gives the byte length.
  * cp points to the opaque object and cnt gives the byte length.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt)
+xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt)
 {
 {
   u_int rndup;
   u_int rndup;
   static char crud[BYTES_PER_XDR_UNIT];
   static char crud[BYTES_PER_XDR_UNIT];
@@ -522,15 +533,16 @@ __xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_opaque,xdr_opaque)
+libc_hidden_proto(xdr_opaque)
+libc_hidden_def(xdr_opaque)
 
 
 /*
 /*
  * XDR counted bytes
  * XDR counted bytes
  * *cpp is a pointer to the bytes, *sizep is the count.
  * *cpp is a pointer to the bytes, *sizep is the count.
  * If *cpp is NULL maxsize bytes are allocated
  * If *cpp is NULL maxsize bytes are allocated
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
+xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
 {
 {
   char *sp = *cpp;	/* sp is the actual string pointer */
   char *sp = *cpp;	/* sp is the actual string pointer */
   u_int nodesize;
   u_int nodesize;
@@ -538,7 +550,7 @@ __xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
   /*
   /*
    * first deal with the length since xdr bytes are counted
    * first deal with the length since xdr bytes are counted
    */
    */
-  if (!__xdr_u_int (xdrs, sizep))
+  if (!xdr_u_int (xdrs, sizep))
     {
     {
       return FALSE;
       return FALSE;
     }
     }
@@ -566,7 +578,7 @@ __xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
 	{
 	{
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
 	  if (_IO_fwide (stderr, 0) > 0)
 	  if (_IO_fwide (stderr, 0) > 0)
-	    (void) __fwprintf (stderr, L"%s", _("xdr_bytes: out of memory\n"));
+	    (void) fwprintf (stderr, L"%s", _("xdr_bytes: out of memory\n"));
 	  else
 	  else
 #endif
 #endif
 	    (void) fputs (_("xdr_bytes: out of memory\n"), stderr);
 	    (void) fputs (_("xdr_bytes: out of memory\n"), stderr);
@@ -575,7 +587,7 @@ __xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
       /* fall into ... */
       /* fall into ... */
 
 
     case XDR_ENCODE:
     case XDR_ENCODE:
-      return __xdr_opaque (xdrs, sp, nodesize);
+      return xdr_opaque (xdrs, sp, nodesize);
 
 
     case XDR_FREE:
     case XDR_FREE:
       if (sp != NULL)
       if (sp != NULL)
@@ -587,7 +599,8 @@ __xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_bytes,xdr_bytes)
+libc_hidden_proto(xdr_bytes)
+libc_hidden_def(xdr_bytes)
 
 
 /*
 /*
  * Implemented here due to commonality of the object.
  * Implemented here due to commonality of the object.
@@ -598,7 +611,7 @@ xdr_netobj (xdrs, np)
      struct netobj *np;
      struct netobj *np;
 {
 {
 
 
-  return __xdr_bytes (xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ);
+  return xdr_bytes (xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ);
 }
 }
 
 
 /*
 /*
@@ -612,15 +625,15 @@ xdr_netobj (xdrs, np)
  * routine may be called.
  * routine may be called.
  * If there is no specific or default routine an error is returned.
  * If there is no specific or default routine an error is returned.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_union (XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault)
+xdr_union (XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault)
 {
 {
   enum_t dscm;
   enum_t dscm;
 
 
   /*
   /*
    * we deal with the discriminator;  it's an enum
    * we deal with the discriminator;  it's an enum
    */
    */
-  if (!__xdr_enum (xdrs, dscmp))
+  if (!xdr_enum (xdrs, dscmp))
     {
     {
       return FALSE;
       return FALSE;
     }
     }
@@ -642,7 +655,8 @@ __xdr_union (XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choi
   return ((dfault == NULL_xdrproc_t) ? FALSE :
   return ((dfault == NULL_xdrproc_t) ? FALSE :
 	  (*dfault) (xdrs, unp, LASTUNSIGNED));
 	  (*dfault) (xdrs, unp, LASTUNSIGNED));
 }
 }
-strong_alias(__xdr_union,xdr_union)
+libc_hidden_proto(xdr_union)
+libc_hidden_def(xdr_union)
 
 
 /*
 /*
  * Non-portable xdr primitives.
  * Non-portable xdr primitives.
@@ -658,8 +672,8 @@ strong_alias(__xdr_union,xdr_union)
  * storage is allocated.  The last parameter is the max allowed length
  * storage is allocated.  The last parameter is the max allowed length
  * of the string as specified by a protocol.
  * of the string as specified by a protocol.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
+xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
 {
 {
   char *sp = *cpp;	/* sp is the actual string pointer */
   char *sp = *cpp;	/* sp is the actual string pointer */
   u_int size;
   u_int size;
@@ -679,12 +693,12 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
     case XDR_ENCODE:
     case XDR_ENCODE:
       if (sp == NULL)
       if (sp == NULL)
 	return FALSE;
 	return FALSE;
-      size = __strlen (sp);
+      size = strlen (sp);
       break;
       break;
     case XDR_DECODE:
     case XDR_DECODE:
       break;
       break;
     }
     }
-  if (!__xdr_u_int (xdrs, &size))
+  if (!xdr_u_int (xdrs, &size))
     {
     {
       return FALSE;
       return FALSE;
     }
     }
@@ -710,7 +724,7 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
 	{
 	{
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
 	  if (_IO_fwide (stderr, 0) > 0)
 	  if (_IO_fwide (stderr, 0) > 0)
-	    (void) __fwprintf (stderr, L"%s",
+	    (void) fwprintf (stderr, L"%s",
 			       _("xdr_string: out of memory\n"));
 			       _("xdr_string: out of memory\n"));
 	  else
 	  else
 #endif
 #endif
@@ -721,7 +735,7 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
       /* fall into ... */
       /* fall into ... */
 
 
     case XDR_ENCODE:
     case XDR_ENCODE:
-      return __xdr_opaque (xdrs, sp, size);
+      return xdr_opaque (xdrs, sp, size);
 
 
     case XDR_FREE:
     case XDR_FREE:
       mem_free (sp, nodesize);
       mem_free (sp, nodesize);
@@ -730,7 +744,8 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
     }
     }
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdr_string,xdr_string)
+libc_hidden_proto(xdr_string)
+libc_hidden_def(xdr_string)
 
 
 /*
 /*
  * Wrapper for xdr_string that can be called directly from
  * Wrapper for xdr_string that can be called directly from
@@ -741,7 +756,7 @@ xdr_wrapstring (xdrs, cpp)
      XDR *xdrs;
      XDR *xdrs;
      char **cpp;
      char **cpp;
 {
 {
-  if (__xdr_string (xdrs, cpp, LASTUNSIGNED))
+  if (xdr_string (xdrs, cpp, LASTUNSIGNED))
     {
     {
       return TRUE;
       return TRUE;
     }
     }

+ 11 - 8
libc/inet/rpc/xdr_array.c

@@ -40,9 +40,6 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
  * arrays.  See xdr.h for more info on the interface to xdr.
  * arrays.  See xdr.h for more info on the interface to xdr.
  */
  */
 
 
-#define xdr_u_int __xdr_u_int
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -55,8 +52,13 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
 
 
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
 # include <wchar.h>
 # include <wchar.h>
+libc_hidden_proto(fwprintf)
 #endif
 #endif
 
 
+libc_hidden_proto(memset)
+libc_hidden_proto(fputs)
+libc_hidden_proto(xdr_u_int)
+
 #define LASTUNSIGNED	((u_int)0-1)
 #define LASTUNSIGNED	((u_int)0-1)
 
 
 
 
@@ -67,8 +69,8 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
  * elsize is the size (in bytes) of each element, and elproc is the
  * elsize is the size (in bytes) of each element, and elproc is the
  * xdr procedure to call to handle each element of the array.
  * xdr procedure to call to handle each element of the array.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
+xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
 {
 {
   u_int i;
   u_int i;
   caddr_t target = *addrp;
   caddr_t target = *addrp;
@@ -107,14 +109,14 @@ __xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsiz
 	  {
 	  {
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
 	    if (_IO_fwide (stderr, 0) > 0)
 	    if (_IO_fwide (stderr, 0) > 0)
-	      (void) __fwprintf (stderr, L"%s",
+	      (void) fwprintf (stderr, L"%s",
 				 _("xdr_array: out of memory\n"));
 				 _("xdr_array: out of memory\n"));
 	    else
 	    else
 #endif
 #endif
 	      (void) fputs (_("xdr_array: out of memory\n"), stderr);
 	      (void) fputs (_("xdr_array: out of memory\n"), stderr);
 	    return FALSE;
 	    return FALSE;
 	  }
 	  }
-	__memset (target, 0, nodesize);
+	memset (target, 0, nodesize);
 	break;
 	break;
 
 
       case XDR_FREE:
       case XDR_FREE:
@@ -142,7 +144,8 @@ __xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsiz
     }
     }
   return stat;
   return stat;
 }
 }
-strong_alias(__xdr_array,xdr_array)
+libc_hidden_proto(xdr_array)
+libc_hidden_def(xdr_array)
 
 
 /*
 /*
  * xdr_vector():
  * xdr_vector():

+ 8 - 5
libc/inet/rpc/xdr_mem.c

@@ -46,6 +46,8 @@
 #include <string.h>
 #include <string.h>
 #include <rpc/rpc.h>
 #include <rpc/rpc.h>
 
 
+libc_hidden_proto(memcpy)
+
 static bool_t xdrmem_getlong (XDR *, long *);
 static bool_t xdrmem_getlong (XDR *, long *);
 static bool_t xdrmem_putlong (XDR *, const long *);
 static bool_t xdrmem_putlong (XDR *, const long *);
 static bool_t xdrmem_getbytes (XDR *, caddr_t, u_int);
 static bool_t xdrmem_getbytes (XDR *, caddr_t, u_int);
@@ -75,8 +77,8 @@ static const struct xdr_ops xdrmem_ops =
  * The procedure xdrmem_create initializes a stream descriptor for a
  * The procedure xdrmem_create initializes a stream descriptor for a
  * memory buffer.
  * memory buffer.
  */
  */
-void attribute_hidden
+void
-__xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
+xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
 {
 {
   xdrs->x_op = op;
   xdrs->x_op = op;
   /* We have to add the const since the `struct xdr_ops' in `struct XDR'
   /* We have to add the const since the `struct xdr_ops' in `struct XDR'
@@ -85,7 +87,8 @@ __xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
   xdrs->x_private = xdrs->x_base = addr;
   xdrs->x_private = xdrs->x_base = addr;
   xdrs->x_handy = size;
   xdrs->x_handy = size;
 }
 }
-strong_alias(__xdrmem_create,xdrmem_create)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_def(xdrmem_create)
 
 
 /*
 /*
  * Nothing needs to be done for the memory case.  The argument is clearly
  * Nothing needs to be done for the memory case.  The argument is clearly
@@ -138,7 +141,7 @@ xdrmem_getbytes (XDR *xdrs, caddr_t addr, u_int len)
 {
 {
   if ((xdrs->x_handy -= len) < 0)
   if ((xdrs->x_handy -= len) < 0)
     return FALSE;
     return FALSE;
-  __memcpy (addr, xdrs->x_private, len);
+  memcpy (addr, xdrs->x_private, len);
   xdrs->x_private += len;
   xdrs->x_private += len;
   return TRUE;
   return TRUE;
 }
 }
@@ -152,7 +155,7 @@ xdrmem_putbytes (XDR *xdrs, const char *addr, u_int len)
 {
 {
   if ((xdrs->x_handy -= len) < 0)
   if ((xdrs->x_handy -= len) < 0)
     return FALSE;
     return FALSE;
-  __memcpy (xdrs->x_private, addr, len);
+  memcpy (xdrs->x_private, addr, len);
   xdrs->x_private += len;
   xdrs->x_private += len;
   return TRUE;
   return TRUE;
 }
 }

+ 25 - 18
libc/inet/rpc/xdr_rec.c

@@ -44,8 +44,6 @@
  * The other 31 bits encode the byte length of the fragment.
  * The other 31 bits encode the byte length of the fragment.
  */
  */
 
 
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -60,8 +58,13 @@
 # include <wchar.h>
 # include <wchar.h>
 # include <libio/iolibio.h>
 # include <libio/iolibio.h>
 # define fputs(s, f) _IO_fputs (s, f)
 # define fputs(s, f) _IO_fputs (s, f)
+libc_hidden_proto(fwprintf)
 #endif
 #endif
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(fputs)
+libc_hidden_proto(lseek)
+
 static bool_t xdrrec_getlong (XDR *, long *);
 static bool_t xdrrec_getlong (XDR *, long *);
 static bool_t xdrrec_putlong (XDR *, const long *);
 static bool_t xdrrec_putlong (XDR *, const long *);
 static bool_t xdrrec_getbytes (XDR *, caddr_t, u_int);
 static bool_t xdrrec_getbytes (XDR *, caddr_t, u_int);
@@ -144,8 +147,8 @@ static bool_t get_input_bytes (RECSTREAM *, caddr_t, int) internal_function;
  * write respectively.   They are like the system
  * write respectively.   They are like the system
  * calls expect that they take an opaque handle rather than an fd.
  * calls expect that they take an opaque handle rather than an fd.
  */
  */
-void attribute_hidden
+void
-__xdrrec_create (XDR *xdrs, u_int sendsize,
+xdrrec_create (XDR *xdrs, u_int sendsize,
 	       u_int recvsize, caddr_t tcp_handle,
 	       u_int recvsize, caddr_t tcp_handle,
 	       int (*readit) (char *, char *, int),
 	       int (*readit) (char *, char *, int),
 	       int (*writeit) (char *, char *, int))
 	       int (*writeit) (char *, char *, int))
@@ -162,7 +165,7 @@ __xdrrec_create (XDR *xdrs, u_int sendsize,
     {
     {
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
       if (_IO_fwide (stderr, 0) > 0)
-	(void) __fwprintf (stderr, L"%s", _("xdrrec_create: out of memory\n"));
+	(void) fwprintf (stderr, L"%s", _("xdrrec_create: out of memory\n"));
       else
       else
 #endif
 #endif
 	(void) fputs (_("xdrrec_create: out of memory\n"), stderr);
 	(void) fputs (_("xdrrec_create: out of memory\n"), stderr);
@@ -206,7 +209,8 @@ __xdrrec_create (XDR *xdrs, u_int sendsize,
   rstrm->fbtbc = 0;
   rstrm->fbtbc = 0;
   rstrm->last_frag = TRUE;
   rstrm->last_frag = TRUE;
 }
 }
-strong_alias(__xdrrec_create,xdrrec_create)
+libc_hidden_proto(xdrrec_create)
+libc_hidden_def(xdrrec_create)
 
 
 
 
 /*
 /*
@@ -299,7 +303,7 @@ xdrrec_putbytes (XDR *xdrs, const char *addr, u_int len)
     {
     {
       current = rstrm->out_boundry - rstrm->out_finger;
       current = rstrm->out_boundry - rstrm->out_finger;
       current = (len < current) ? len : current;
       current = (len < current) ? len : current;
-      __memcpy (rstrm->out_finger, addr, current);
+      memcpy (rstrm->out_finger, addr, current);
       rstrm->out_finger += current;
       rstrm->out_finger += current;
       addr += current;
       addr += current;
       len -= current;
       len -= current;
@@ -319,7 +323,7 @@ xdrrec_getpos (const XDR *xdrs)
   RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
   RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
   long pos;
   long pos;
 
 
-  pos = __lseek ((int) (long) rstrm->tcp_handle, (long) 0, 1);
+  pos = lseek ((int) (long) rstrm->tcp_handle, (long) 0, 1);
   if (pos != -1)
   if (pos != -1)
     switch (xdrs->x_op)
     switch (xdrs->x_op)
       {
       {
@@ -478,8 +482,8 @@ xdrrec_putint32 (XDR *xdrs, const int32_t *ip)
  * Before reading (deserializing from the stream, one should always call
  * Before reading (deserializing from the stream, one should always call
  * this procedure to guarantee proper record alignment.
  * this procedure to guarantee proper record alignment.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdrrec_skiprecord (XDR *xdrs)
+xdrrec_skiprecord (XDR *xdrs)
 {
 {
   RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
   RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
 
 
@@ -494,15 +498,16 @@ __xdrrec_skiprecord (XDR *xdrs)
   rstrm->last_frag = FALSE;
   rstrm->last_frag = FALSE;
   return TRUE;
   return TRUE;
 }
 }
-strong_alias(__xdrrec_skiprecord,xdrrec_skiprecord)
+libc_hidden_proto(xdrrec_skiprecord)
+libc_hidden_def(xdrrec_skiprecord)
 
 
 /*
 /*
  * Lookahead function.
  * Lookahead function.
  * Returns TRUE iff there is no more input in the buffer
  * Returns TRUE iff there is no more input in the buffer
  * after consuming the rest of the current record.
  * after consuming the rest of the current record.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdrrec_eof (XDR *xdrs)
+xdrrec_eof (XDR *xdrs)
 {
 {
   RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
   RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
 
 
@@ -518,7 +523,8 @@ __xdrrec_eof (XDR *xdrs)
     return TRUE;
     return TRUE;
   return FALSE;
   return FALSE;
 }
 }
-strong_alias(__xdrrec_eof,xdrrec_eof)
+libc_hidden_proto(xdrrec_eof)
+libc_hidden_def(xdrrec_eof)
 
 
 /*
 /*
  * The client must tell the package when an end-of-record has occurred.
  * The client must tell the package when an end-of-record has occurred.
@@ -526,8 +532,8 @@ strong_alias(__xdrrec_eof,xdrrec_eof)
  * (output) tcp stream.  (This lets the package support batched or
  * (output) tcp stream.  (This lets the package support batched or
  * pipelined procedure calls.)  TRUE => immediate flush to tcp connection.
  * pipelined procedure calls.)  TRUE => immediate flush to tcp connection.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdrrec_endofrecord (XDR *xdrs, bool_t sendnow)
+xdrrec_endofrecord (XDR *xdrs, bool_t sendnow)
 {
 {
   RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
   RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
   u_long len;		/* fragment length */
   u_long len;		/* fragment length */
@@ -545,7 +551,8 @@ __xdrrec_endofrecord (XDR *xdrs, bool_t sendnow)
   rstrm->out_finger += BYTES_PER_XDR_UNIT;
   rstrm->out_finger += BYTES_PER_XDR_UNIT;
   return TRUE;
   return TRUE;
 }
 }
-strong_alias(__xdrrec_endofrecord,xdrrec_endofrecord)
+libc_hidden_proto(xdrrec_endofrecord)
+libc_hidden_def(xdrrec_endofrecord)
 
 
 /*
 /*
  * Internal useful routines
  * Internal useful routines
@@ -603,7 +610,7 @@ get_input_bytes (RECSTREAM *rstrm, caddr_t addr, int len)
 	  continue;
 	  continue;
 	}
 	}
       current = (len < current) ? len : current;
       current = (len < current) ? len : current;
-      __memcpy (addr, rstrm->in_finger, current);
+      memcpy (addr, rstrm->in_finger, current);
       rstrm->in_finger += current;
       rstrm->in_finger += current;
       addr += current;
       addr += current;
       len -= current;
       len -= current;

+ 12 - 9
libc/inet/rpc/xdr_reference.c

@@ -40,9 +40,6 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
  * "pointers".  See xdr.h for more info on the interface to xdr.
  * "pointers".  See xdr.h for more info on the interface to xdr.
  */
  */
 
 
-#define xdr_bool __xdr_bool
-#define fputs __fputs
-
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -56,8 +53,13 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
 # include <wchar.h>
 # include <wchar.h>
 # include <libio/iolibio.h>
 # include <libio/iolibio.h>
 # define fputs(s, f) _IO_fputs (s, f)
 # define fputs(s, f) _IO_fputs (s, f)
+libc_hidden_proto(fwprintf)
 #endif
 #endif
 
 
+libc_hidden_proto(memset)
+libc_hidden_proto(xdr_bool)
+libc_hidden_proto(fputs)
+
 #define LASTUNSIGNED	((u_int)0-1)
 #define LASTUNSIGNED	((u_int)0-1)
 
 
 /*
 /*
@@ -69,8 +71,8 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
  * size is the size of the referneced structure.
  * size is the size of the referneced structure.
  * proc is the routine to handle the referenced structure.
  * proc is the routine to handle the referenced structure.
  */
  */
-bool_t attribute_hidden
+bool_t
-__xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
+xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
 {
 {
   caddr_t loc = *pp;
   caddr_t loc = *pp;
   bool_t stat;
   bool_t stat;
@@ -87,14 +89,14 @@ __xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
 	  {
 	  {
 #ifdef USE_IN_LIBIO
 #ifdef USE_IN_LIBIO
 	    if (_IO_fwide (stderr, 0) > 0)
 	    if (_IO_fwide (stderr, 0) > 0)
-	      (void) __fwprintf (stderr, L"%s",
+	      (void) fwprintf (stderr, L"%s",
 				 _("xdr_reference: out of memory\n"));
 				 _("xdr_reference: out of memory\n"));
 	    else
 	    else
 #endif
 #endif
 	      (void) fputs (_("xdr_reference: out of memory\n"), stderr);
 	      (void) fputs (_("xdr_reference: out of memory\n"), stderr);
 	    return FALSE;
 	    return FALSE;
 	  }
 	  }
-	__memset (loc, 0, (int) size);
+	memset (loc, 0, (int) size);
 	break;
 	break;
       default:
       default:
 	break;
 	break;
@@ -109,7 +111,8 @@ __xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
     }
     }
   return stat;
   return stat;
 }
 }
-strong_alias(__xdr_reference,xdr_reference)
+libc_hidden_proto(xdr_reference)
+libc_hidden_def(xdr_reference)
 
 
 /*
 /*
  * xdr_pointer():
  * xdr_pointer():
@@ -150,5 +153,5 @@ xdr_pointer (xdrs, objpp, obj_size, xdr_obj)
       *objpp = NULL;
       *objpp = NULL;
       return TRUE;
       return TRUE;
     }
     }
-  return __xdr_reference (xdrs, objpp, obj_size, xdr_obj);
+  return xdr_reference (xdrs, objpp, obj_size, xdr_obj);
 }
 }

+ 6 - 6
libc/inet/rpc/xdr_stdio.c

@@ -37,12 +37,6 @@
  * from the stream.
  * from the stream.
  */
  */
 
 
-#define fread __fread
-#define fwrite __fwrite
-#define fseek __fseek
-#define fflush __fflush
-#define ftell __ftell
-
 #include <rpc/types.h>
 #include <rpc/types.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <rpc/xdr.h>
 #include <rpc/xdr.h>
@@ -55,6 +49,12 @@
 # define fwrite(p, m, n, s) _IO_fwrite (p, m, n, s)
 # define fwrite(p, m, n, s) _IO_fwrite (p, m, n, s)
 #endif
 #endif
 
 
+libc_hidden_proto(fread)
+libc_hidden_proto(fwrite)
+libc_hidden_proto(fseek)
+libc_hidden_proto(fflush)
+libc_hidden_proto(ftell)
+
 static bool_t xdrstdio_getlong (XDR *, long *);
 static bool_t xdrstdio_getlong (XDR *, long *);
 static bool_t xdrstdio_putlong (XDR *, const long *);
 static bool_t xdrstdio_putlong (XDR *, const long *);
 static bool_t xdrstdio_getbytes (XDR *, caddr_t, u_int);
 static bool_t xdrstdio_getbytes (XDR *, caddr_t, u_int);

+ 53 - 45
libc/inet/socketcalls.c

@@ -1,6 +1,8 @@
-#ifdef L_recv
+/*
-#define recvfrom __recvfrom
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-#endif
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
@@ -47,16 +49,16 @@ int __libc_accept(int s, struct sockaddr *addr, socklen_t * addrlen)
 	return __socketcall(SYS_ACCEPT, args);
 	return __socketcall(SYS_ACCEPT, args);
 }
 }
 #endif
 #endif
-hidden_weak_alias(__libc_accept,__accept)
+strong_alias(__libc_accept,accept)
-weak_alias(__libc_accept,accept)
+libc_hidden_proto(accept)
+libc_hidden_def(accept)
 #endif
 #endif
 
 
 #ifdef L_bind
 #ifdef L_bind
 #ifdef __NR_bind
 #ifdef __NR_bind
-#define __NR___bind __NR_bind
+_syscall3(int, bind, int, sockfd, const struct sockaddr *, myaddr, socklen_t, addrlen);
-attribute_hidden _syscall3(int, __bind, int, sockfd, const struct sockaddr *, myaddr, socklen_t, addrlen);
 #elif defined(__NR_socketcall)
 #elif defined(__NR_socketcall)
-int attribute_hidden __bind(int sockfd, const struct sockaddr *myaddr, socklen_t addrlen)
+int bind(int sockfd, const struct sockaddr *myaddr, socklen_t addrlen)
 {
 {
 	unsigned long args[3];
 	unsigned long args[3];
 
 
@@ -66,7 +68,8 @@ int attribute_hidden __bind(int sockfd, const struct sockaddr *myaddr, socklen_t
 	return __socketcall(SYS_BIND, args);
 	return __socketcall(SYS_BIND, args);
 }
 }
 #endif
 #endif
-strong_alias(__bind,bind)
+libc_hidden_proto(bind)
+libc_hidden_def(bind)
 #endif
 #endif
 
 
 #ifdef L_connect
 #ifdef L_connect
@@ -84,8 +87,9 @@ int __libc_connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen)
 	return __socketcall(SYS_CONNECT, args);
 	return __socketcall(SYS_CONNECT, args);
 }
 }
 #endif
 #endif
-hidden_weak_alias(__libc_connect,__connect)
+strong_alias(__libc_connect,connect)
-weak_alias(__libc_connect,connect)
+libc_hidden_proto(connect)
+libc_hidden_def(connect)
 #endif
 #endif
 
 
 #ifdef L_getpeername
 #ifdef L_getpeername
@@ -106,10 +110,9 @@ int getpeername(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
 
 
 #ifdef L_getsockname
 #ifdef L_getsockname
 #ifdef __NR_getsockname
 #ifdef __NR_getsockname
-#define __NR___getsockname __NR_getsockname
+_syscall3(int, getsockname, int, sockfd, struct sockaddr *, addr, socklen_t *,paddrlen);
-attribute_hidden _syscall3(int, __getsockname, int, sockfd, struct sockaddr *, addr, socklen_t *,paddrlen);
 #elif defined(__NR_socketcall)
 #elif defined(__NR_socketcall)
-int attribute_hidden __getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
+int getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
 {
 {
 	unsigned long args[3];
 	unsigned long args[3];
 
 
@@ -119,7 +122,8 @@ int attribute_hidden __getsockname(int sockfd, struct sockaddr *addr, socklen_t
 	return __socketcall(SYS_GETSOCKNAME, args);
 	return __socketcall(SYS_GETSOCKNAME, args);
 }
 }
 #endif
 #endif
-strong_alias(__getsockname,getsockname)
+libc_hidden_proto(getsockname)
+libc_hidden_def(getsockname)
 #endif
 #endif
 
 
 #ifdef L_getsockopt
 #ifdef L_getsockopt
@@ -143,10 +147,9 @@ int getsockopt(int fd, int level, int optname, __ptr_t optval,
 
 
 #ifdef L_listen
 #ifdef L_listen
 #ifdef __NR_listen
 #ifdef __NR_listen
-#define __NR___listen __NR_listen
+_syscall2(int, listen, int, sockfd, int, backlog);
-attribute_hidden _syscall2(int, __listen, int, sockfd, int, backlog);
 #elif defined(__NR_socketcall)
 #elif defined(__NR_socketcall)
-int attribute_hidden __listen(int sockfd, int backlog)
+int listen(int sockfd, int backlog)
 {
 {
 	unsigned long args[2];
 	unsigned long args[2];
 
 
@@ -155,7 +158,8 @@ int attribute_hidden __listen(int sockfd, int backlog)
 	return __socketcall(SYS_LISTEN, args);
 	return __socketcall(SYS_LISTEN, args);
 }
 }
 #endif
 #endif
-strong_alias(__listen,listen)
+libc_hidden_proto(listen)
+libc_hidden_def(listen)
 #endif
 #endif
 
 
 #ifdef L_recv
 #ifdef L_recv
@@ -175,13 +179,15 @@ ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags)
 	return (__socketcall(SYS_RECV, args));
 	return (__socketcall(SYS_RECV, args));
 }
 }
 #elif defined(__NR_recvfrom)
 #elif defined(__NR_recvfrom)
+libc_hidden_proto(recvfrom)
 ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags)
 ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags)
 {
 {
-	return (__recvfrom(sockfd, buffer, len, flags, NULL, NULL));
+	return (recvfrom(sockfd, buffer, len, flags, NULL, NULL));
 }
 }
 #endif
 #endif
-hidden_weak_alias(__libc_recv,__recv)
+strong_alias(__libc_recv,recv)
-weak_alias(__libc_recv,recv)
+libc_hidden_proto(recv)
+libc_hidden_def(recv)
 #endif
 #endif
 
 
 #ifdef L_recvfrom
 #ifdef L_recvfrom
@@ -205,8 +211,9 @@ ssize_t __libc_recvfrom(int sockfd, __ptr_t buffer, size_t len, int flags,
 	return (__socketcall(SYS_RECVFROM, args));
 	return (__socketcall(SYS_RECVFROM, args));
 }
 }
 #endif
 #endif
-hidden_weak_alias(__libc_recvfrom,__recvfrom)
+strong_alias(__libc_recvfrom,recvfrom)
-weak_alias(__libc_recvfrom,recvfrom)
+libc_hidden_proto(recvfrom)
+libc_hidden_def(recvfrom)
 #endif
 #endif
 
 
 #ifdef L_recvmsg
 #ifdef L_recvmsg
@@ -224,8 +231,9 @@ ssize_t __libc_recvmsg(int sockfd, struct msghdr *msg, int flags)
 	return (__socketcall(SYS_RECVMSG, args));
 	return (__socketcall(SYS_RECVMSG, args));
 }
 }
 #endif
 #endif
-hidden_weak_alias(__libc_recvmsg,__recvmsg)
+strong_alias(__libc_recvmsg,recvmsg)
-weak_alias(__libc_recvmsg,recvmsg)
+libc_hidden_proto(recvmsg)
+libc_hidden_def(recvmsg)
 #endif
 #endif
 
 
 #ifdef L_send
 #ifdef L_send
@@ -245,17 +253,15 @@ ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags)
 	return (__socketcall(SYS_SEND, args));
 	return (__socketcall(SYS_SEND, args));
 }
 }
 #elif defined(__NR_sendto)
 #elif defined(__NR_sendto)
-extern ssize_t __sendto (int __fd, __const void *__buf, size_t __n,
+libc_hidden_proto(sendto)
-		       int __flags, __CONST_SOCKADDR_ARG __addr,
-		       socklen_t __addr_len) attribute_hidden;
-
 ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags)
 ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags)
 {
 {
-	return (__sendto(sockfd, buffer, len, flags, NULL, 0));
+	return (sendto(sockfd, buffer, len, flags, NULL, 0));
 }
 }
 #endif
 #endif
-hidden_weak_alias(__libc_send,__send)
+strong_alias(__libc_send,send)
-weak_alias(__libc_send,send)
+libc_hidden_proto(send)
+libc_hidden_def(send)
 #endif
 #endif
 
 
 #ifdef L_sendmsg
 #ifdef L_sendmsg
@@ -273,8 +279,9 @@ ssize_t __libc_sendmsg(int sockfd, const struct msghdr *msg, int flags)
 	return (__socketcall(SYS_SENDMSG, args));
 	return (__socketcall(SYS_SENDMSG, args));
 }
 }
 #endif
 #endif
-hidden_weak_alias(__libc_sendmsg,__sendmsg)
+strong_alias(__libc_sendmsg,sendmsg)
-weak_alias(__libc_sendmsg,sendmsg)
+libc_hidden_proto(sendmsg)
+libc_hidden_def(sendmsg)
 #endif
 #endif
 
 
 #ifdef L_sendto
 #ifdef L_sendto
@@ -298,17 +305,17 @@ ssize_t __libc_sendto(int sockfd, const void *buffer, size_t len, int flags,
 	return (__socketcall(SYS_SENDTO, args));
 	return (__socketcall(SYS_SENDTO, args));
 }
 }
 #endif
 #endif
-hidden_weak_alias(__libc_sendto,__sendto)
+strong_alias(__libc_sendto,sendto)
-weak_alias(__libc_sendto,sendto)
+libc_hidden_proto(sendto)
+libc_hidden_def(sendto)
 #endif
 #endif
 
 
 #ifdef L_setsockopt
 #ifdef L_setsockopt
 #ifdef __NR_setsockopt
 #ifdef __NR_setsockopt
-#define __NR___setsockopt __NR_setsockopt
+_syscall5(int, setsockopt, int, fd, int, level, int, optname, const void *, optval, socklen_t, optlen);
-attribute_hidden _syscall5(int, __setsockopt, int, fd, int, level, int, optname, const void *, optval, socklen_t, optlen);
 #elif defined(__NR_socketcall)
 #elif defined(__NR_socketcall)
 /* [sg]etsockoptions by bir7@leland.stanford.edu */
 /* [sg]etsockoptions by bir7@leland.stanford.edu */
-int attribute_hidden __setsockopt(int fd, int level, int optname, const void *optval,
+int setsockopt(int fd, int level, int optname, const void *optval,
 		   socklen_t optlen)
 		   socklen_t optlen)
 {
 {
 	unsigned long args[5];
 	unsigned long args[5];
@@ -321,7 +328,8 @@ int attribute_hidden __setsockopt(int fd, int level, int optname, const void *op
 	return (__socketcall(SYS_SETSOCKOPT, args));
 	return (__socketcall(SYS_SETSOCKOPT, args));
 }
 }
 #endif
 #endif
-strong_alias(__setsockopt,setsockopt)
+libc_hidden_proto(setsockopt)
+libc_hidden_def(setsockopt)
 #endif
 #endif
 
 
 #ifdef L_shutdown
 #ifdef L_shutdown
@@ -342,10 +350,9 @@ int shutdown(int sockfd, int how)
 
 
 #ifdef L_socket
 #ifdef L_socket
 #ifdef __NR_socket
 #ifdef __NR_socket
-#define __NR___socket __NR_socket
+_syscall3(int, socket, int, family, int, type, int, protocol);
-attribute_hidden _syscall3(int, __socket, int, family, int, type, int, protocol);
 #elif defined(__NR_socketcall)
 #elif defined(__NR_socketcall)
-int attribute_hidden __socket(int family, int type, int protocol)
+int socket(int family, int type, int protocol)
 {
 {
 	unsigned long args[3];
 	unsigned long args[3];
 
 
@@ -355,7 +362,8 @@ int attribute_hidden __socket(int family, int type, int protocol)
 	return __socketcall(SYS_SOCKET, args);
 	return __socketcall(SYS_SOCKET, args);
 }
 }
 #endif
 #endif
-strong_alias(__socket,socket)
+libc_hidden_proto(socket)
+libc_hidden_def(socket)
 #endif
 #endif
 
 
 #ifdef L_socketpair
 #ifdef L_socketpair

+ 3 - 0
libc/misc/assert/__assert.c

@@ -33,6 +33,9 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <bits/uClibc_uintmaxtostr.h>
 #include <bits/uClibc_uintmaxtostr.h>
 
 
+libc_hidden_proto(fprintf)
+libc_hidden_proto(abort)
+
 /* Get the prototype from assert.h as a double-check. */
 /* Get the prototype from assert.h as a double-check. */
 #undef NDEBUG
 #undef NDEBUG
 #include <assert.h>
 #include <assert.h>

+ 19 - 15
libc/misc/ctype/ctype.c

@@ -156,6 +156,9 @@ int CTYPE_NAME(NAME) (int c) \
 #ifdef L___ctype_assert
 #ifdef L___ctype_assert
 #ifdef __UCLIBC_HAS_CTYPE_ENFORCED__
 #ifdef __UCLIBC_HAS_CTYPE_ENFORCED__
 
 
+libc_hidden_proto(fprintf)
+libc_hidden_proto(abort)
+
 void __isctype_assert(int c, int mask)
 void __isctype_assert(int c, int mask)
 {
 {
 	fprintf(stderr,	"%s: __is*{_l}(%d,%#x {locale})\n", __uclibc_progname, c, mask);
 	fprintf(stderr,	"%s: __is*{_l}(%d,%#x {locale})\n", __uclibc_progname, c, mask);
@@ -266,9 +269,10 @@ IS_FUNC_BODY(xdigit);
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_tolower
 #ifdef L_tolower
 
 
+#undef tolower
 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
 
 
-int attribute_hidden __tolower(int c)
+int tolower(int c)
 {
 {
 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
 	assert(CTYPE_DOMAIN_CHECK(c));
 	assert(CTYPE_DOMAIN_CHECK(c));
@@ -278,38 +282,38 @@ int attribute_hidden __tolower(int c)
 
 
 #else  /* __UCLIBC_HAS_CTYPE_TABLES__ */
 #else  /* __UCLIBC_HAS_CTYPE_TABLES__ */
 
 
-int attribute_hidden __tolower(int c)
+int tolower(int c)
 {
 {
 	return __C_tolower(c);
 	return __C_tolower(c);
 }
 }
 
 
 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
-strong_alias(__tolower,tolower)
+libc_hidden_proto(tolower)
+libc_hidden_def(tolower)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_tolower_l
 #ifdef L_tolower_l
 
 
 #undef tolower_l
 #undef tolower_l
-#undef __tolower_l
+int tolower_l(int c, __locale_t l)
-
-int __tolower_l(int c, __locale_t l)
 {
 {
 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
 	assert(CTYPE_DOMAIN_CHECK(c));
 	assert(CTYPE_DOMAIN_CHECK(c));
 #endif
 #endif
 	return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_tolower[c] : c;
 	return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_tolower[c] : c;
 }
 }
-
+libc_hidden_proto(tolower_l)
-weak_alias(__tolower_l, tolower_l)
+libc_hidden_def(tolower_l)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_toupper
 #ifdef L_toupper
 
 
+#undef toupper
 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
 
 
-int attribute_hidden __toupper(int c)
+int toupper(int c)
 {
 {
 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
 	assert(CTYPE_DOMAIN_CHECK(c));
 	assert(CTYPE_DOMAIN_CHECK(c));
@@ -319,22 +323,21 @@ int attribute_hidden __toupper(int c)
 
 
 #else  /* __UCLIBC_HAS_CTYPE_TABLES__ */
 #else  /* __UCLIBC_HAS_CTYPE_TABLES__ */
 
 
-int attribute_hidden __toupper(int c)
+int toupper(int c)
 {
 {
 	return __C_toupper(c);
 	return __C_toupper(c);
 }
 }
 
 
 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
-strong_alias(__toupper,toupper)
+libc_hidden_proto(toupper)
+libc_hidden_def(toupper)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_toupper_l
 #ifdef L_toupper_l
 
 
 #undef toupper_l
 #undef toupper_l
-#undef __toupper_l
+int toupper_l(int c, __locale_t l)
-
-int __toupper_l(int c, __locale_t l)
 {
 {
 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
 	assert(CTYPE_DOMAIN_CHECK(c));
 	assert(CTYPE_DOMAIN_CHECK(c));
@@ -342,7 +345,8 @@ int __toupper_l(int c, __locale_t l)
 	return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_toupper[c] : c;
 	return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_toupper[c] : c;
 }
 }
 
 
-weak_alias(__toupper_l, toupper_l)
+libc_hidden_proto(toupper_l)
+libc_hidden_def(toupper_l)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/

+ 3 - 1
libc/misc/dirent/alphasort.c

@@ -2,9 +2,11 @@
 #include <string.h>
 #include <string.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(strcmp)
+
 int alphasort(const void * a, const void * b)
 int alphasort(const void * a, const void * b)
 {
 {
-    return __strcmp ((*(const struct dirent **) a)->d_name,
+    return strcmp ((*(const struct dirent **) a)->d_name,
 	    (*(const struct dirent **) b)->d_name);
 	    (*(const struct dirent **) b)->d_name);
 }
 }
 
 

+ 2 - 1
libc/misc/dirent/alphasort64.c

@@ -16,9 +16,10 @@
 #include <string.h>
 #include <string.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(strcmp)
 
 
 int alphasort64(const void * a, const void * b)
 int alphasort64(const void * a, const void * b)
 {
 {
-    return __strcmp ((*(const struct dirent64 **) a)->d_name,
+    return strcmp ((*(const struct dirent64 **) a)->d_name,
 	    (*(const struct dirent64 **) b)->d_name);
 	    (*(const struct dirent64 **) b)->d_name);
 }
 }

+ 6 - 3
libc/misc/dirent/closedir.c

@@ -4,7 +4,10 @@
 #include <unistd.h>
 #include <unistd.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
-int attribute_hidden __closedir(DIR * dir)
+libc_hidden_proto(closedir)
+libc_hidden_proto(close)
+
+int closedir(DIR * dir)
 {
 {
 	int fd;
 	int fd;
 
 
@@ -24,6 +27,6 @@ int attribute_hidden __closedir(DIR * dir)
 	__pthread_mutex_unlock(&(dir->dd_lock));
 	__pthread_mutex_unlock(&(dir->dd_lock));
 	free(dir->dd_buf);
 	free(dir->dd_buf);
 	free(dir);
 	free(dir);
-	return __close(fd);
+	return close(fd);
 }
 }
-strong_alias(__closedir,closedir)
+libc_hidden_def(closedir)

+ 9 - 2
libc/misc/dirent/dirfd.c

@@ -1,8 +1,14 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
 #include <dirent.h>
 #include <dirent.h>
 #include <errno.h>
 #include <errno.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
-int attribute_hidden __dirfd(DIR * dir)
+int dirfd(DIR * dir)
 {
 {
 	if (!dir || dir->dd_fd == -1) {
 	if (!dir || dir->dd_fd == -1) {
 		__set_errno(EBADF);
 		__set_errno(EBADF);
@@ -11,4 +17,5 @@ int attribute_hidden __dirfd(DIR * dir)
 
 
 	return dir->dd_fd;
 	return dir->dd_fd;
 }
 }
-strong_alias(__dirfd,dirfd)
+libc_hidden_proto(dirfd)
+libc_hidden_def(dirfd)

+ 2 - 2
libc/misc/dirent/dirstream.h

@@ -72,10 +72,10 @@ struct __dirstream {
 
 
 
 
 extern ssize_t __getdents(int fd, char *buf, size_t count) attribute_hidden;
 extern ssize_t __getdents(int fd, char *buf, size_t count) attribute_hidden;
-extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden;
+libc_hidden_proto(readdir)
 #ifdef __UCLIBC_HAS_LFS__
 #ifdef __UCLIBC_HAS_LFS__
 extern ssize_t __getdents64 (int fd, char *buf, size_t count) attribute_hidden;
 extern ssize_t __getdents64 (int fd, char *buf, size_t count) attribute_hidden;
-extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden;
+libc_hidden_proto(readdir64)
 #endif
 #endif
 
 
 #endif /* dirent.h  */
 #endif /* dirent.h  */

+ 12 - 7
libc/misc/dirent/opendir.c

@@ -7,32 +7,37 @@
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(opendir)
+libc_hidden_proto(open)
+libc_hidden_proto(fcntl)
+libc_hidden_proto(close)
+libc_hidden_proto(stat)
 
 
 /* opendir just makes an open() call - it return NULL if it fails
 /* opendir just makes an open() call - it return NULL if it fails
  * (open sets errno), otherwise it returns a DIR * pointer.
  * (open sets errno), otherwise it returns a DIR * pointer.
  */
  */
-DIR attribute_hidden *__opendir(const char *name)
+DIR *opendir(const char *name)
 {
 {
 	int fd;
 	int fd;
 	struct stat statbuf;
 	struct stat statbuf;
 	char *buf;
 	char *buf;
 	DIR *ptr;
 	DIR *ptr;
 
 
-	if (__stat(name, &statbuf))
+	if (stat(name, &statbuf))
 		return NULL;
 		return NULL;
 	if (!S_ISDIR(statbuf.st_mode)) {
 	if (!S_ISDIR(statbuf.st_mode)) {
 		__set_errno(ENOTDIR);
 		__set_errno(ENOTDIR);
 		return NULL;
 		return NULL;
 	}
 	}
-	if ((fd = __open(name, O_RDONLY)) < 0)
+	if ((fd = open(name, O_RDONLY)) < 0)
 		return NULL;
 		return NULL;
 	/* According to POSIX, directory streams should be closed when
 	/* According to POSIX, directory streams should be closed when
 	 * exec. From "Anna Pluzhnikov" <besp@midway.uchicago.edu>.
 	 * exec. From "Anna Pluzhnikov" <besp@midway.uchicago.edu>.
 	 */
 	 */
-	if (__fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
+	if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
 		return NULL;
 		return NULL;
 	if (!(ptr = malloc(sizeof(*ptr)))) {
 	if (!(ptr = malloc(sizeof(*ptr)))) {
-		__close(fd);
+		close(fd);
 		__set_errno(ENOMEM);
 		__set_errno(ENOMEM);
 		return NULL;
 		return NULL;
 	}
 	}
@@ -45,7 +50,7 @@ DIR attribute_hidden *__opendir(const char *name)
 		ptr->dd_max = 512;
 		ptr->dd_max = 512;
 
 
 	if (!(buf = calloc(1, ptr->dd_max))) {
 	if (!(buf = calloc(1, ptr->dd_max))) {
-		__close(fd);
+		close(fd);
 		free(ptr);
 		free(ptr);
 		__set_errno(ENOMEM);
 		__set_errno(ENOMEM);
 		return NULL;
 		return NULL;
@@ -54,4 +59,4 @@ DIR attribute_hidden *__opendir(const char *name)
 	__pthread_mutex_init(&(ptr->dd_lock), NULL);
 	__pthread_mutex_init(&(ptr->dd_lock), NULL);
 	return ptr;
 	return ptr;
 }
 }
-strong_alias(__opendir,opendir)
+libc_hidden_def(opendir)

+ 4 - 2
libc/misc/dirent/readdir.c

@@ -7,7 +7,9 @@
 #include <dirent.h>
 #include <dirent.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
-struct dirent attribute_hidden *__readdir(DIR * dir)
+libc_hidden_proto(readdir)
+
+struct dirent *readdir(DIR * dir)
 {
 {
 	ssize_t bytes;
 	ssize_t bytes;
 	struct dirent *de;
 	struct dirent *de;
@@ -46,4 +48,4 @@ all_done:
 	__pthread_mutex_unlock(&(dir->dd_lock));
 	__pthread_mutex_unlock(&(dir->dd_lock));
 	return de;
 	return de;
 }
 }
-strong_alias(__readdir,readdir)
+libc_hidden_def(readdir)

+ 4 - 2
libc/misc/dirent/readdir64.c

@@ -20,7 +20,9 @@
 #include <dirent.h>
 #include <dirent.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
-struct dirent64 attribute_hidden *__readdir64(DIR * dir)
+libc_hidden_proto(readdir64)
+
+struct dirent64 *readdir64(DIR * dir)
 {
 {
 	ssize_t bytes;
 	ssize_t bytes;
 	struct dirent64 *de;
 	struct dirent64 *de;
@@ -60,4 +62,4 @@ all_done:
 
 
 	return de;
 	return de;
 }
 }
-strong_alias(__readdir64,readdir64)
+libc_hidden_def(readdir64)

+ 3 - 1
libc/misc/dirent/readdir64_r.c

@@ -19,6 +19,8 @@
 #include <dirent.h>
 #include <dirent.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(memcpy)
+
 int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result)
 int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result)
 {
 {
 	int ret;
 	int ret;
@@ -59,7 +61,7 @@ int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result)
 	if (de == NULL) {
 	if (de == NULL) {
 	    *result = NULL;
 	    *result = NULL;
 	} else {
 	} else {
-	    *result = __memcpy (entry, de, de->d_reclen);
+	    *result = memcpy (entry, de, de->d_reclen);
 	}
 	}
 	ret = 0;
 	ret = 0;
 
 

+ 3 - 1
libc/misc/dirent/readdir_r.c

@@ -5,6 +5,8 @@
 #include <dirent.h>
 #include <dirent.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(memcpy)
+
 int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result)
 int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result)
 {
 {
 	int ret;
 	int ret;
@@ -45,7 +47,7 @@ int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result)
 	if (de == NULL) {
 	if (de == NULL) {
 	    *result = NULL;
 	    *result = NULL;
 	} else {
 	} else {
-	    *result = __memcpy (entry, de, de->d_reclen);
+	    *result = memcpy (entry, de, de->d_reclen);
 	}
 	}
 	ret = 0;
 	ret = 0;
 
 

+ 2 - 1
libc/misc/dirent/rewinddir.c

@@ -3,6 +3,7 @@
 #include <unistd.h>
 #include <unistd.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(lseek)
 
 
 /* rewinddir() just does an lseek(fd,0,0) - see close for comments */
 /* rewinddir() just does an lseek(fd,0,0) - see close for comments */
 void rewinddir(DIR * dir)
 void rewinddir(DIR * dir)
@@ -12,7 +13,7 @@ void rewinddir(DIR * dir)
 		return;
 		return;
 	}
 	}
 	__pthread_mutex_lock(&(dir->dd_lock));
 	__pthread_mutex_lock(&(dir->dd_lock));
-	__lseek(dir->dd_fd, 0, SEEK_SET);
+	lseek(dir->dd_fd, 0, SEEK_SET);
 	dir->dd_nextoff = dir->dd_nextloc = dir->dd_size = 0;
 	dir->dd_nextoff = dir->dd_nextloc = dir->dd_size = 0;
 	__pthread_mutex_unlock(&(dir->dd_lock));
 	__pthread_mutex_unlock(&(dir->dd_lock));
 }
 }

+ 13 - 27
libc/misc/dirent/scandir.c

@@ -1,28 +1,8 @@
-/* Copyright (C) 1992-1998, 2000 Free Software Foundation, Inc.
+/*
-   This file is part of the GNU C Library.
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-
+ *
-   The GNU C Library is free software; you can redistribute it and/or
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-   modify it under the terms of the GNU Lesser General Public
+ */
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  
-   */
-
-/* Modified for uClibc by Erik Andersen
-   */
-
-#define qsort __qsort
-#define opendir __opendir
-#define closedir __closedir
 
 
 #include <dirent.h>
 #include <dirent.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -32,6 +12,12 @@
 #include <sys/types.h>
 #include <sys/types.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(readdir)
+libc_hidden_proto(opendir)
+libc_hidden_proto(closedir)
+libc_hidden_proto(qsort)
+
 int scandir(const char *dir, struct dirent ***namelist, 
 int scandir(const char *dir, struct dirent ***namelist, 
 	int (*selector) (const struct dirent *),
 	int (*selector) (const struct dirent *),
 	int (*compar) (const void *, const void *))
 	int (*compar) (const void *, const void *))
@@ -49,7 +35,7 @@ int scandir(const char *dir, struct dirent ***namelist,
     __set_errno (0);
     __set_errno (0);
 
 
     pos = 0;
     pos = 0;
-    while ((current = __readdir (dp)) != NULL)
+    while ((current = readdir (dp)) != NULL)
 	if (selector == NULL || (*selector) (current))
 	if (selector == NULL || (*selector) (current))
 	{
 	{
 	    struct dirent *vnew;
 	    struct dirent *vnew;
@@ -76,7 +62,7 @@ int scandir(const char *dir, struct dirent ***namelist,
 	    if (vnew == NULL)
 	    if (vnew == NULL)
 		break;
 		break;
 
 
-	    names[pos++] = (struct dirent *) __memcpy (vnew, current, dsize);
+	    names[pos++] = (struct dirent *) memcpy (vnew, current, dsize);
 	}
 	}
 
 
     if (unlikely(errno != 0))
     if (unlikely(errno != 0))

+ 7 - 6
libc/misc/dirent/scandir64.c

@@ -20,10 +20,6 @@
 /* Modified for uClibc by Erik Andersen
 /* Modified for uClibc by Erik Andersen
    */
    */
 
 
-#define qsort __qsort
-#define opendir __opendir
-#define closedir __closedir
-
 #include <features.h>
 #include <features.h>
 
 
 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
@@ -47,6 +43,11 @@
 #include <sys/types.h>
 #include <sys/types.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(opendir)
+libc_hidden_proto(closedir)
+libc_hidden_proto(qsort)
+
 int scandir64(const char *dir, struct dirent64 ***namelist, 
 int scandir64(const char *dir, struct dirent64 ***namelist, 
 	int (*selector) (const struct dirent64 *),
 	int (*selector) (const struct dirent64 *),
 	int (*compar) (const void *, const void *))
 	int (*compar) (const void *, const void *))
@@ -64,7 +65,7 @@ int scandir64(const char *dir, struct dirent64 ***namelist,
     __set_errno (0);
     __set_errno (0);
 
 
     pos = 0;
     pos = 0;
-    while ((current = __readdir64 (dp)) != NULL)
+    while ((current = readdir64 (dp)) != NULL)
 	if (selector == NULL || (*selector) (current))
 	if (selector == NULL || (*selector) (current))
 	{
 	{
 	    struct dirent64 *vnew;
 	    struct dirent64 *vnew;
@@ -91,7 +92,7 @@ int scandir64(const char *dir, struct dirent64 ***namelist,
 	    if (vnew == NULL)
 	    if (vnew == NULL)
 		break;
 		break;
 
 
-	    names[pos++] = (struct dirent64 *) __memcpy (vnew, current, dsize);
+	    names[pos++] = (struct dirent64 *) memcpy (vnew, current, dsize);
 	}
 	}
 
 
     if (unlikely(errno != 0))
     if (unlikely(errno != 0))

+ 3 - 1
libc/misc/dirent/seekdir.c

@@ -3,6 +3,8 @@
 #include <unistd.h>
 #include <unistd.h>
 #include "dirstream.h"
 #include "dirstream.h"
 
 
+libc_hidden_proto(lseek)
+
 void seekdir(DIR * dir, long int offset)
 void seekdir(DIR * dir, long int offset)
 {
 {
 	if (!dir) {
 	if (!dir) {
@@ -10,7 +12,7 @@ void seekdir(DIR * dir, long int offset)
 		return;
 		return;
 	}
 	}
 	__pthread_mutex_lock(&(dir->dd_lock));
 	__pthread_mutex_lock(&(dir->dd_lock));
-	dir->dd_nextoff = __lseek(dir->dd_fd, offset, SEEK_SET);
+	dir->dd_nextoff = lseek(dir->dd_fd, offset, SEEK_SET);
 	dir->dd_size = dir->dd_nextloc = 0;
 	dir->dd_size = dir->dd_nextloc = 0;
 	__pthread_mutex_unlock(&(dir->dd_lock));
 	__pthread_mutex_unlock(&(dir->dd_lock));
 }
 }

+ 29 - 19
libc/misc/error/err.c

@@ -5,8 +5,6 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
  */
 
 
-#define vfprintf __vfprintf
-
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
@@ -22,6 +20,18 @@
 #warning REMINDER: Deal with wide oriented stderr case.
 #warning REMINDER: Deal with wide oriented stderr case.
 #endif
 #endif
 
 
+libc_hidden_proto(vwarn)
+libc_hidden_proto(vwarnx)
+libc_hidden_proto(err)
+libc_hidden_proto(verr)
+libc_hidden_proto(verrx)
+
+libc_hidden_proto(fprintf)
+libc_hidden_proto(vfprintf)
+libc_hidden_proto(__xpg_strerror_r)
+libc_hidden_proto(exit)
+libc_hidden_proto(vfprintf)
+
 static void vwarn_work(const char *format, va_list args, int showerr)
 static void vwarn_work(const char *format, va_list args, int showerr)
 {
 {
 	/*                         0123 45678 9 a b*/
 	/*                         0123 45678 9 a b*/
@@ -34,7 +44,7 @@ static void vwarn_work(const char *format, va_list args, int showerr)
 	f = fmt + 11;				/* At 11. */
 	f = fmt + 11;				/* At 11. */
 	if (showerr) {
 	if (showerr) {
 		f -= 4;					/* At 7. */
 		f -= 4;					/* At 7. */
-		__xpg_strerror_r_internal(errno, buf, sizeof(buf));
+		__xpg_strerror_r(errno, buf, sizeof(buf));
 	}
 	}
 
 
 	__STDIO_AUTO_THREADLOCK(stderr);
 	__STDIO_AUTO_THREADLOCK(stderr);
@@ -49,68 +59,68 @@ static void vwarn_work(const char *format, va_list args, int showerr)
 	__STDIO_AUTO_THREADUNLOCK(stderr);
 	__STDIO_AUTO_THREADUNLOCK(stderr);
 }
 }
 
 
-void attribute_hidden __vwarn(const char *format, va_list args)
+void vwarn(const char *format, va_list args)
 {
 {
 	vwarn_work(format, args, 1);
 	vwarn_work(format, args, 1);
 }
 }
-strong_alias(__vwarn,vwarn)
+libc_hidden_def(vwarn)
 
 
 void warn(const char *format, ...)
 void warn(const char *format, ...)
 {
 {
 	va_list args;
 	va_list args;
 
 
 	va_start(args, format);
 	va_start(args, format);
-	__vwarn(format, args);
+	vwarn(format, args);
 	va_end(args);
 	va_end(args);
 }
 }
 
 
-void attribute_hidden __vwarnx(const char *format, va_list args)
+void vwarnx(const char *format, va_list args)
 {
 {
 	vwarn_work(format, args, 0);
 	vwarn_work(format, args, 0);
 }
 }
-strong_alias(__vwarnx,vwarnx)
+libc_hidden_def(vwarnx)
 
 
 void warnx(const char *format, ...)
 void warnx(const char *format, ...)
 {
 {
 	va_list args;
 	va_list args;
 
 
 	va_start(args, format);
 	va_start(args, format);
-	__vwarnx(format, args);
+	vwarnx(format, args);
 	va_end(args);
 	va_end(args);
 }
 }
 
 
-void attribute_hidden __verr(int status, const char *format, va_list args)
+void verr(int status, const char *format, va_list args)
 {
 {
-	__vwarn(format, args);
+	vwarn(format, args);
-	__exit(status);
+	exit(status);
 }
 }
-strong_alias(__verr,verr)
+libc_hidden_def(verr)
 
 
 void attribute_noreturn err(int status, const char *format, ...)
 void attribute_noreturn err(int status, const char *format, ...)
 {
 {
 	va_list args;
 	va_list args;
 
 
 	va_start(args, format);
 	va_start(args, format);
-	__verr(status, format, args);
+	verr(status, format, args);
 	/* This should get optimized away.  We'll leave it now for safety. */
 	/* This should get optimized away.  We'll leave it now for safety. */
 	/* The loop is added only to keep gcc happy. */
 	/* The loop is added only to keep gcc happy. */
 	while(1)
 	while(1)
 		va_end(args);
 		va_end(args);
 }
 }
 
 
-void attribute_hidden __verrx(int status, const char *format, va_list args)
+void verrx(int status, const char *format, va_list args)
 {
 {
-	__vwarnx(format, args);
+	vwarnx(format, args);
-	__exit(status);
+	exit(status);
 }
 }
-strong_alias(__verrx,verrx)
+libc_hidden_def(verrx)
 
 
 void attribute_noreturn errx(int status, const char *format, ...)
 void attribute_noreturn errx(int status, const char *format, ...)
 {
 {
 	va_list args;
 	va_list args;
 
 
 	va_start(args, format);
 	va_start(args, format);
-	__verrx(status, format, args);
+	verrx(status, format, args);
 	/* This should get optimized away.  We'll leave it now for safety. */
 	/* This should get optimized away.  We'll leave it now for safety. */
 	/* The loop is added only to keep gcc happy. */
 	/* The loop is added only to keep gcc happy. */
 	while(1)
 	while(1)

+ 14 - 10
libc/misc/error/error.c

@@ -22,17 +22,21 @@
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
 /* Adjusted slightly by Erik Andersen <andersen@uclibc.org> */
 /* Adjusted slightly by Erik Andersen <andersen@uclibc.org> */
 
 
-#define strerror __strerror
-#define vfprintf __vfprintf
-#define fflush __fflush
-
 #include <stdio.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
 #include "error.h"
 #include "error.h"
 
 
-extern int __putc(int c, FILE *stream) attribute_hidden;
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strerror)
+libc_hidden_proto(fprintf)
+libc_hidden_proto(exit)
+libc_hidden_proto(putc)
+libc_hidden_proto(vfprintf)
+libc_hidden_proto(fflush)
+libc_hidden_proto(fputc)
+libc_hidden_proto(__fputc_unlocked)
 
 
 /* This variable is incremented each time `error' is called.  */
 /* This variable is incremented each time `error' is called.  */
 unsigned int error_message_count = 0;
 unsigned int error_message_count = 0;
@@ -59,9 +63,9 @@ void __error (int status, int errnum, const char *message, ...)
     if (errnum) {
     if (errnum) {
 	fprintf (stderr, ": %s", strerror (errnum));
 	fprintf (stderr, ": %s", strerror (errnum));
     }
     }
-    __putc ('\n', stderr);
+    putc ('\n', stderr);
     if (status)
     if (status)
-	__exit (status);
+	exit (status);
 }
 }
 
 
 void __error_at_line (int status, int errnum, const char *file_name,
 void __error_at_line (int status, int errnum, const char *file_name,
@@ -74,7 +78,7 @@ void __error_at_line (int status, int errnum, const char *file_name,
 	static unsigned int old_line_number;
 	static unsigned int old_line_number;
 
 
 	if (old_line_number == line_number &&
 	if (old_line_number == line_number &&
-		(file_name == old_file_name || !__strcmp (old_file_name, file_name)))
+		(file_name == old_file_name || !strcmp (old_file_name, file_name)))
 	    /* Simply return and print nothing.  */
 	    /* Simply return and print nothing.  */
 	    return;
 	    return;
 
 
@@ -95,9 +99,9 @@ void __error_at_line (int status, int errnum, const char *file_name,
     if (errnum) {
     if (errnum) {
 	fprintf (stderr, ": %s", strerror (errnum));
 	fprintf (stderr, ": %s", strerror (errnum));
     }
     }
-    __putc ('\n', stderr);
+    putc ('\n', stderr);
     if (status)
     if (status)
-	__exit (status);
+	exit (status);
 }
 }
 
 
 /* Use the weaks here in an effort at controlling namespace pollution */
 /* Use the weaks here in an effort at controlling namespace pollution */

+ 12 - 8
libc/misc/file/lockf.c

@@ -17,7 +17,6 @@
    Boston, MA 02111-1307, USA.  */
    Boston, MA 02111-1307, USA.  */
 
 
 #include <features.h>
 #include <features.h>
-#undef __lockf
 
 
 #include <sys/types.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -25,14 +24,19 @@
 #include <errno.h>
 #include <errno.h>
 #include <string.h>
 #include <string.h>
 
 
+libc_hidden_proto(lockf)
+
+libc_hidden_proto(memset)
+libc_hidden_proto(fcntl)
+libc_hidden_proto(getpid)
+
 /* lockf is a simplified interface to fcntl's locking facilities.  */
 /* lockf is a simplified interface to fcntl's locking facilities.  */
 
 
-#undef lockf
+int lockf (int fd, int cmd, off_t len)
-int attribute_hidden __lockf (int fd, int cmd, off_t len)
 {
 {
     struct flock fl;
     struct flock fl;
 
 
-    __memset ((char *) &fl, '\0', sizeof (fl));
+    memset ((char *) &fl, '\0', sizeof (fl));
 
 
     /* lockf is always relative to the current file position.  */
     /* lockf is always relative to the current file position.  */
     fl.l_whence = SEEK_CUR;
     fl.l_whence = SEEK_CUR;
@@ -45,9 +49,9 @@ int attribute_hidden __lockf (int fd, int cmd, off_t len)
 	    /* Test the lock: return 0 if FD is unlocked or locked by this process;
 	    /* Test the lock: return 0 if FD is unlocked or locked by this process;
 	       return -1, set errno to EACCES, if another process holds the lock.  */
 	       return -1, set errno to EACCES, if another process holds the lock.  */
 	    fl.l_type = F_RDLCK;
 	    fl.l_type = F_RDLCK;
-	    if (__fcntl (fd, F_GETLK, &fl) < 0)
+	    if (fcntl (fd, F_GETLK, &fl) < 0)
 		return -1;
 		return -1;
-	    if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())
+	    if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
 		return 0;
 		return 0;
 	    __set_errno(EACCES);
 	    __set_errno(EACCES);
 	    return -1;
 	    return -1;
@@ -70,6 +74,6 @@ int attribute_hidden __lockf (int fd, int cmd, off_t len)
 	    return -1;
 	    return -1;
     }
     }
 
 
-    return __fcntl(fd, cmd, &fl);
+    return fcntl(fd, cmd, &fl);
 }
 }
-strong_alias(__lockf,lockf)
+libc_hidden_def(lockf)

+ 11 - 10
libc/misc/file/lockf64.c

@@ -17,7 +17,6 @@
    Boston, MA 02111-1307, USA.  */
    Boston, MA 02111-1307, USA.  */
 
 
 #include <features.h>
 #include <features.h>
-#undef __lockf64
 
 
 #ifdef __UCLIBC_HAS_LFS__
 #ifdef __UCLIBC_HAS_LFS__
 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
@@ -43,17 +42,20 @@
 
 
 #ifdef __NR_fcntl64
 #ifdef __NR_fcntl64
 #define flock flock64
 #define flock flock64
-#define fcntl __fcntl64
+#define fcntl fcntl64
 #define F_GETLK F_GETLK64
 #define F_GETLK F_GETLK64
 #define F_SETLK F_SETLK64
 #define F_SETLK F_SETLK64
-#else
-#define fcntl __fcntl
 #endif
 #endif
 
 
+libc_hidden_proto(lockf64)
+
+libc_hidden_proto(memset)
+libc_hidden_proto(fcntl)
+libc_hidden_proto(getpid)
+
 /* lockf is a simplified interface to fcntl's locking facilities.  */
 /* lockf is a simplified interface to fcntl's locking facilities.  */
 
 
-#undef lockf64
+int lockf64 (int fd, int cmd, off64_t len64)
-int attribute_hidden __lockf64 (int fd, int cmd, off64_t len64)
 {
 {
     struct flock fl;
     struct flock fl;
     off_t len = (off_t) len64;
     off_t len = (off_t) len64;
@@ -65,7 +67,7 @@ int attribute_hidden __lockf64 (int fd, int cmd, off64_t len64)
 	return -1;
 	return -1;
     }
     }
 
 
-    __memset((char *) &fl, '\0', sizeof (fl));
+    memset((char *) &fl, '\0', sizeof (fl));
 
 
     /* lockf is always relative to the current file position.  */
     /* lockf is always relative to the current file position.  */
     fl.l_whence = SEEK_CUR;
     fl.l_whence = SEEK_CUR;
@@ -80,7 +82,7 @@ int attribute_hidden __lockf64 (int fd, int cmd, off64_t len64)
 	    fl.l_type = F_RDLCK;
 	    fl.l_type = F_RDLCK;
 	    if (fcntl (fd, F_GETLK, &fl) < 0)
 	    if (fcntl (fd, F_GETLK, &fl) < 0)
 		return -1;
 		return -1;
-	    if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())
+	    if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
 		return 0;
 		return 0;
 	    __set_errno(EACCES);
 	    __set_errno(EACCES);
 	    return -1;
 	    return -1;
@@ -105,5 +107,4 @@ int attribute_hidden __lockf64 (int fd, int cmd, off64_t len64)
 
 
     return fcntl(fd, cmd, &fl);
     return fcntl(fd, cmd, &fl);
 }
 }
-
+libc_hidden_def(lockf64)
-strong_alias(__lockf64,lockf64)

+ 63 - 55
libc/misc/fnmatch/fnmatch.c

@@ -17,8 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define strcmp __strcmp
-
 #if HAVE_CONFIG_H
 #if HAVE_CONFIG_H
 # include <config.h>
 # include <config.h>
 #endif
 #endif
@@ -34,11 +32,6 @@
 # define HAVE_STRING_H 1
 # define HAVE_STRING_H 1
 # define STDC_HEADERS
 # define STDC_HEADERS
 # define HAVE___STRCHRNUL 1
 # define HAVE___STRCHRNUL 1
-extern void *__mempcpy (void *__restrict __dest,
-			__const void *__restrict __src, size_t __n)
-     __THROW __nonnull ((1, 2)) attribute_hidden;
-extern void *__memchr (__const void *__s, int __c, size_t __n)
-      __THROW __attribute_pure__ __nonnull ((1)) attribute_hidden;
 # ifdef __UCLIBC_HAS_WCHAR__
 # ifdef __UCLIBC_HAS_WCHAR__
 #  define HAVE_WCHAR_H 1
 #  define HAVE_WCHAR_H 1
 #  define HAVE_WCTYPE_H 1
 #  define HAVE_WCTYPE_H 1
@@ -64,6 +57,22 @@ extern void *__memchr (__const void *__s, int __c, size_t __n)
 # include <stdlib.h>
 # include <stdlib.h>
 #endif
 #endif
 
 
+#ifdef __UCLIBC__
+#define __memset memset
+libc_hidden_proto(memchr)
+libc_hidden_proto(memset)
+libc_hidden_proto(mempcpy)
+libc_hidden_proto(strcat)
+libc_hidden_proto(strcmp)
+/*libc_hidden_proto(strchr)*/
+/*libc_hidden_proto(strchrnul)*/
+libc_hidden_proto(strlen)
+libc_hidden_proto(strcoll)
+libc_hidden_proto(tolower)
+libc_hidden_proto(fnmatch)
+libc_hidden_proto(getenv)
+#endif
+
 /* For platform which support the ISO C amendement 1 functionality we
 /* For platform which support the ISO C amendement 1 functionality we
    support user defined character classes.  */
    support user defined character classes.  */
 #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
 #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
@@ -71,24 +80,20 @@ extern void *__memchr (__const void *__s, int __c, size_t __n)
 # include <wchar.h>
 # include <wchar.h>
 # include <wctype.h>
 # include <wctype.h>
 # ifdef __UCLIBC__
 # ifdef __UCLIBC__
-extern wctype_t __wctype (__const char *__property) __THROW attribute_hidden;
+libc_hidden_proto(wctype)
-extern int __iswctype (wint_t __wc, wctype_t __desc) __THROW attribute_hidden;
+libc_hidden_proto(iswctype)
-extern wint_t __btowc (int __c) __THROW attribute_hidden;
+libc_hidden_proto(btowc)
 #  ifdef __UCLIBC_HAS_LOCALE__
 #  ifdef __UCLIBC_HAS_LOCALE__
-extern size_t __mbsrtowcs (wchar_t *__restrict __dst,
+libc_hidden_proto(wmemchr)
-			 __const char **__restrict __src, size_t __len,
+libc_hidden_proto(wmempcpy)
-			 mbstate_t *__restrict __ps) __THROW attribute_hidden;
+libc_hidden_proto(wcscat)
-extern size_t __wcslen (__const wchar_t *__s) __THROW __attribute_pure__ attribute_hidden;
+/*libc_hidden_proto(wcschr)*/
-extern wchar_t *__wmempcpy (wchar_t *__restrict __s1,
+/*libc_hidden_proto(wcschrnul)*/
-			  __const wchar_t *__restrict __s2, size_t __n)
+libc_hidden_proto(wcslen)
-     __THROW attribute_hidden;
+libc_hidden_proto(wcscoll)
-extern wchar_t *__wcscat (wchar_t *__restrict __dest,
+libc_hidden_proto(towlower)
-			__const wchar_t *__restrict __src) __THROW attribute_hidden;
+libc_hidden_proto(mbsrtowcs)
-extern size_t __strnlen (__const char *__string, size_t __maxlen)
+libc_hidden_proto(strnlen)
-     __THROW __attribute_pure__ __nonnull ((1)) attribute_hidden;
-extern wchar_t *__wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n)
-     __THROW __attribute_pure__ attribute_hidden;
-extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden;
 #  endif
 #  endif
 # endif
 # endif
 #endif
 #endif
@@ -96,21 +101,22 @@ extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden;
 /* We need some of the locale data (the collation sequence information)
 /* We need some of the locale data (the collation sequence information)
    but there is no interface to get this information in general.  Therefore
    but there is no interface to get this information in general.  Therefore
    we support a correct implementation only in glibc.  */
    we support a correct implementation only in glibc.  */
-#if defined _LIBC || defined __UCLIBC__
+#if defined _LIBC
-# ifndef __UCLIBC__
 # include "../locale/localeinfo.h"
 # include "../locale/localeinfo.h"
 # include "../locale/elem-hash.h"
 # include "../locale/elem-hash.h"
 # include "../locale/coll-lookup.h"
 # include "../locale/coll-lookup.h"
 # include <shlib-compat.h>
 # include <shlib-compat.h>
-# endif
 
 
 # define CONCAT(a,b) __CONCAT(a,b)
 # define CONCAT(a,b) __CONCAT(a,b)
-# if defined _LIBC || defined __UCLIBC_HAS_LOCALE__
+# if defined _LIBC
 # define mbsrtowcs __mbsrtowcs
 # define mbsrtowcs __mbsrtowcs
 # endif
 # endif
 # define fnmatch __fnmatch
 # define fnmatch __fnmatch
 extern int fnmatch (const char *pattern, const char *string, int flags) attribute_hidden;
 extern int fnmatch (const char *pattern, const char *string, int flags) attribute_hidden;
 #endif
 #endif
+#ifdef __UCLIBC__
+# define CONCAT(a,b) __CONCAT(a,b)
+#endif
 
 
 /* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set.  */
 /* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set.  */
 #define NO_LEADING_PERIOD(flags) \
 #define NO_LEADING_PERIOD(flags) \
@@ -168,13 +174,13 @@ extern int fnmatch (const char *pattern, const char *string, int flags) attribut
 #   define CHAR_CLASS_MAX_LENGTH 256
 #   define CHAR_CLASS_MAX_LENGTH 256
 #  endif
 #  endif
 
 
-#  if defined _LIBC || defined __UCLIBC__
+#  if defined _LIBC
 #   define IS_CHAR_CLASS(string) __wctype (string)
 #   define IS_CHAR_CLASS(string) __wctype (string)
 #  else
 #  else
 #   define IS_CHAR_CLASS(string) wctype (string)
 #   define IS_CHAR_CLASS(string) wctype (string)
 #  endif
 #  endif
 
 
-#  if defined _LIBC || defined __UCLIBC__
+#  if defined _LIBC
 #   define ISWCTYPE(WC, WT)	__iswctype (WC, WT)
 #   define ISWCTYPE(WC, WT)	__iswctype (WC, WT)
 #  else
 #  else
 #   define ISWCTYPE(WC, WT)	iswctype (WC, WT)
 #   define ISWCTYPE(WC, WT)	iswctype (WC, WT)
@@ -246,7 +252,7 @@ __wcschrnul (s, c)
 # endif
 # endif
 
 
 /* Note that this evaluates C many times.  */
 /* Note that this evaluates C many times.  */
-# if defined _LIBC || defined __UCLIBC__
+# if defined _LIBC
 #  define FOLD(c) ((flags & FNM_CASEFOLD) ? __tolower (c) : (c))
 #  define FOLD(c) ((flags & FNM_CASEFOLD) ? __tolower (c) : (c))
 # else
 # else
 #  define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
 #  define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
@@ -258,22 +264,22 @@ __wcschrnul (s, c)
 # define EXT	ext_match
 # define EXT	ext_match
 # define END	end_pattern
 # define END	end_pattern
 # define L(CS)	CS
 # define L(CS)	CS
-# if defined _LIBC || defined __UCLIBC__
+# if defined _LIBC
 #  define BTOWC(C)	__btowc (C)
 #  define BTOWC(C)	__btowc (C)
 # else
 # else
 #  define BTOWC(C)	btowc (C)
 #  define BTOWC(C)	btowc (C)
 # endif
 # endif
-# define STRLEN(S) __strlen (S)
+# define STRLEN(S) strlen (S)
-# define STRCAT(D, S) __strcat (D, S)
+# define STRCAT(D, S) strcat (D, S)
-# define MEMPCPY(D, S, N) __mempcpy (D, S, N)
+# define MEMPCPY(D, S, N) mempcpy (D, S, N)
-# define MEMCHR(S, C, N) __memchr (S, C, N)
+# define MEMCHR(S, C, N) memchr (S, C, N)
-# define STRCOLL(S1, S2) __strcoll (S1, S2)
+# define STRCOLL(S1, S2) strcoll (S1, S2)
 # include "fnmatch_loop.c"
 # include "fnmatch_loop.c"
 
 
 
 
 # if HANDLE_MULTIBYTE
 # if HANDLE_MULTIBYTE
 /* Note that this evaluates C many times.  */
 /* Note that this evaluates C many times.  */
-#  if defined _LIBC || defined __UCLIBC__
+#  if defined _LIBC
 #   define FOLD(c) ((flags & FNM_CASEFOLD) ? __towlower (c) : (c))
 #   define FOLD(c) ((flags & FNM_CASEFOLD) ? __towlower (c) : (c))
 #  else
 #  else
 #   define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? towlower (c) : (c))
 #   define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? towlower (c) : (c))
@@ -286,11 +292,11 @@ __wcschrnul (s, c)
 # define END	end_wpattern
 # define END	end_wpattern
 #  define L(CS)	L##CS
 #  define L(CS)	L##CS
 #  define BTOWC(C)	(C)
 #  define BTOWC(C)	(C)
-#  define STRLEN(S) __wcslen (S)
+#  define STRLEN(S) wcslen (S)
-#  define STRCAT(D, S) __wcscat (D, S)
+#  define STRCAT(D, S) wcscat (D, S)
-#  define MEMPCPY(D, S, N) __wmempcpy (D, S, N)
+#  define MEMPCPY(D, S, N) wmempcpy (D, S, N)
-#  define MEMCHR(S, C, N) __wmemchr (S, C, N)
+#  define MEMCHR(S, C, N) wmemchr (S, C, N)
-#  define STRCOLL(S1, S2) __wcscoll (S1, S2)
+#  define STRCOLL(S1, S2) wcscoll (S1, S2)
 #  ifndef __UCLIBC__
 #  ifndef __UCLIBC__
 #  define WIDE_CHAR_VERSION 1
 #  define WIDE_CHAR_VERSION 1
 #  endif
 #  endif
@@ -354,7 +360,7 @@ is_char_class (const wchar_t *wcs)
 
 
   *cp = '\0';
   *cp = '\0';
 
 
-#  if defined _LIBC || defined __UCLIBC__
+#  if defined _LIBC
   return __wctype (s);
   return __wctype (s);
 #  else
 #  else
   return wctype (s);
   return wctype (s);
@@ -365,15 +371,16 @@ is_char_class (const wchar_t *wcs)
 #  include "fnmatch_loop.c"
 #  include "fnmatch_loop.c"
 # endif
 # endif
 
 
+extern size_t _stdlib_mb_cur_max (void) __THROW __wur;
+libc_hidden_proto(_stdlib_mb_cur_max)
 
 
-int attribute_hidden
+int
 fnmatch (const char *pattern, const char *string, int flags)
 fnmatch (const char *pattern, const char *string, int flags)
 {
 {
 # if HANDLE_MULTIBYTE
 # if HANDLE_MULTIBYTE
 #  ifdef __UCLIBC_HAS_WCHAR__
 #  ifdef __UCLIBC_HAS_WCHAR__
 #   undef MB_CUR_MAX
 #   undef MB_CUR_MAX
-#   define	MB_CUR_MAX	(_stdlib_mb_cur_max_internal ())
+#   define	MB_CUR_MAX	(_stdlib_mb_cur_max ())
-extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden;
 #  endif
 #  endif
   if (__builtin_expect (MB_CUR_MAX, 1) != 1)
   if (__builtin_expect (MB_CUR_MAX, 1) != 1)
     {
     {
@@ -387,9 +394,9 @@ extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden;
       __memset (&ps, '\0', sizeof (ps));
       __memset (&ps, '\0', sizeof (ps));
       p = pattern;
       p = pattern;
 #if defined _LIBC || defined __UCLIBC__
 #if defined _LIBC || defined __UCLIBC__
-      n = __strnlen (pattern, 1024);
+      n = strnlen (pattern, 1024);
 #else
 #else
-      n = __strlen (pattern);
+      n = strlen (pattern);
 #endif
 #endif
       if (__builtin_expect (n < 1024, 1))
       if (__builtin_expect (n < 1024, 1))
 	{
 	{
@@ -418,9 +425,9 @@ extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden;
 
 
       assert (mbsinit (&ps));
       assert (mbsinit (&ps));
 #if defined _LIBC || defined __UCLIBC__
 #if defined _LIBC || defined __UCLIBC__
-      n = __strnlen (string, 1024);
+      n = strnlen (string, 1024);
 #else
 #else
-      n = __strlen (string);
+      n = strlen (string);
 #endif
 #endif
       p = string;
       p = string;
       if (__builtin_expect (n < 1024, 1))
       if (__builtin_expect (n < 1024, 1))
@@ -453,11 +460,11 @@ extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden;
     }
     }
 # endif  /* mbstate_t and mbsrtowcs or _LIBC.  */
 # endif  /* mbstate_t and mbsrtowcs or _LIBC.  */
 
 
-  return internal_fnmatch (pattern, string, string + __strlen (string),
+  return internal_fnmatch (pattern, string, string + strlen (string),
 			   flags & FNM_PERIOD, flags);
 			   flags & FNM_PERIOD, flags);
 }
 }
 
 
-# if defined _LIBC || defined __UCLIBC__
+# if defined _LIBC
 #  undef fnmatch
 #  undef fnmatch
 #  ifndef __UCLIBC__
 #  ifndef __UCLIBC__
 versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3);
 versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3);
@@ -466,9 +473,10 @@ strong_alias (__fnmatch, __fnmatch_old)
 compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0);
 compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0);
 #  endif
 #  endif
 libc_hidden_ver (__fnmatch, fnmatch)
 libc_hidden_ver (__fnmatch, fnmatch)
-#  else
-strong_alias(__fnmatch,fnmatch)
 #  endif
 #  endif
+# else
+libc_hidden_proto(fnmatch)
+libc_hidden_def(fnmatch)
 # endif
 # endif
 
 
 #endif	/* _LIBC or not __GNU_LIBRARY__.  */
 #endif	/* _LIBC or not __GNU_LIBRARY__.  */

+ 3 - 3
libc/misc/fnmatch/fnmatch_loop.c

@@ -214,7 +214,7 @@ FCT (pattern, string, string_end, no_leading_period, flags)
 	    UCHAR fn;
 	    UCHAR fn;
 
 
 	    if (posixly_correct == 0)
 	    if (posixly_correct == 0)
-	      posixly_correct = __getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
+	      posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
 
 
 	    if (n == string_end)
 	    if (n == string_end)
 	      return FNM_NOMATCH;
 	      return FNM_NOMATCH;
@@ -993,7 +993,7 @@ END (const CHAR *pattern)
       {
       {
 	/* Handle brackets special.  */
 	/* Handle brackets special.  */
 	if (posixly_correct == 0)
 	if (posixly_correct == 0)
-	  posixly_correct = __getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
+	  posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
 
 
 	/* Skip the not sign.  We have to recognize it because of a possibly
 	/* Skip the not sign.  We have to recognize it because of a possibly
 	   following ']'.  */
 	   following ']'.  */
@@ -1045,7 +1045,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
       {
       {
 	/* Handle brackets special.  */
 	/* Handle brackets special.  */
 	if (posixly_correct == 0)
 	if (posixly_correct == 0)
-	  posixly_correct = __getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
+	  posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
 
 
 	/* Skip the not sign.  We have to recognize it because of a possibly
 	/* Skip the not sign.  We have to recognize it because of a possibly
 	   following ']'.  */
 	   following ']'.  */

+ 7 - 4
libc/misc/fnmatch/fnmatch_old.c

@@ -28,6 +28,9 @@ Cambridge, MA 02139, USA.  */
 #include <fnmatch.h>
 #include <fnmatch.h>
 #include <ctype.h>
 #include <ctype.h>
 
 
+libc_hidden_proto(fnmatch)
+
+libc_hidden_proto(tolower)
 /* Comment out all this code if we are using the GNU C Library, and are not
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C
    actually compiling the library itself.  This code is part of the GNU C
    Library, but also included in many other GNU distributions.  Compiling
    Library, but also included in many other GNU distributions.  Compiling
@@ -50,13 +53,13 @@ Cambridge, MA 02139, USA.  */
 
 
 /* Match STRING against the filename pattern PATTERN, returning zero if
 /* Match STRING against the filename pattern PATTERN, returning zero if
    it matches, nonzero if not.  */
    it matches, nonzero if not.  */
-int attribute_hidden __fnmatch(const char *pattern, const char *string, int flags)
+int fnmatch(const char *pattern, const char *string, int flags)
 {
 {
 	register const char *p = pattern, *n = string;
 	register const char *p = pattern, *n = string;
 	register char c;
 	register char c;
 
 
 /* Note that this evaluates C many times.  */
 /* Note that this evaluates C many times.  */
-# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? __tolower (c) : (c))
+# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
 
 
 	while ((c = *p++) != '\0') {
 	while ((c = *p++) != '\0') {
 		c = FOLD(c);
 		c = FOLD(c);
@@ -116,7 +119,7 @@ int attribute_hidden __fnmatch(const char *pattern, const char *string, int flag
 				c1 = FOLD(c1);
 				c1 = FOLD(c1);
 				for (--p; *n != '\0'; ++n)
 				for (--p; *n != '\0'; ++n)
 					if ((c == '[' || FOLD(*n) == c1) &&
 					if ((c == '[' || FOLD(*n) == c1) &&
-						__fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
+						fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
 						return 0;
 						return 0;
 				return FNM_NOMATCH;
 				return FNM_NOMATCH;
 			}
 			}
@@ -220,5 +223,5 @@ int attribute_hidden __fnmatch(const char *pattern, const char *string, int flag
 
 
 # undef FOLD
 # undef FOLD
 }
 }
-strong_alias(__fnmatch,fnmatch)
+libc_hidden_def(fnmatch)
 #endif							/* _LIBC or not __GNU_LIBRARY__.  */
 #endif							/* _LIBC or not __GNU_LIBRARY__.  */

+ 37 - 28
libc/misc/ftw/ftw.c

@@ -31,17 +31,6 @@
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_DECL_STPCPY 1
 #define HAVE_DECL_STPCPY 1
 #define HAVE_MEMPCPY 1
 #define HAVE_MEMPCPY 1
-#define dirfd __dirfd
-#define tsearch __tsearch
-#define tfind __tfind
-#define tdestroy __tdestroy
-#define getcwd __getcwd
-#define chdir __chdir
-#define fchdir __fchdir
-#define mempcpy __mempcpy
-#define opendir __opendir
-#define closedir __closedir
-#define stpcpy __stpcpy
 #endif
 #endif
 
 
 #if __GNUC__
 #if __GNUC__
@@ -64,7 +53,7 @@ char *alloca ();
 #else
 #else
 # if HAVE_DIRENT_H
 # if HAVE_DIRENT_H
 #  include <dirent.h>
 #  include <dirent.h>
-#  define NAMLEN(dirent) __strlen ((dirent)->d_name)
+#  define NAMLEN(dirent) strlen ((dirent)->d_name)
 # else
 # else
 #  define dirent direct
 #  define dirent direct
 #  define NAMLEN(dirent) (dirent)->d_namlen
 #  define NAMLEN(dirent) (dirent)->d_namlen
@@ -96,6 +85,28 @@ char *alloca ();
 # include <sys/stat.h>
 # include <sys/stat.h>
 #endif
 #endif
 
 
+libc_hidden_proto(memset)
+libc_hidden_proto(strchr)
+libc_hidden_proto(strlen)
+libc_hidden_proto(dirfd)
+libc_hidden_proto(tsearch)
+libc_hidden_proto(tfind)
+libc_hidden_proto(tdestroy)
+libc_hidden_proto(getcwd)
+libc_hidden_proto(chdir)
+libc_hidden_proto(fchdir)
+libc_hidden_proto(mempcpy)
+libc_hidden_proto(opendir)
+#ifdef __UCLIBC_HAS_LFS__
+libc_hidden_proto(readdir64)
+libc_hidden_proto(lstat64)
+libc_hidden_proto(stat64)
+#endif
+libc_hidden_proto(closedir)
+libc_hidden_proto(stpcpy)
+libc_hidden_proto(lstat)
+libc_hidden_proto(stat)
+
 #if ! _LIBC && !HAVE_DECL_STPCPY && !defined stpcpy
 #if ! _LIBC && !HAVE_DECL_STPCPY && !defined stpcpy
 char *stpcpy ();
 char *stpcpy ();
 #endif
 #endif
@@ -108,24 +119,30 @@ char *stpcpy ();
 /* #define NDEBUG 1 */
 /* #define NDEBUG 1 */
 #include <assert.h>
 #include <assert.h>
 
 
-#if !defined _LIBC && !defined __UCLIBC__
+#if !defined _LIBC
 # undef __chdir
 # undef __chdir
 # define __chdir chdir
 # define __chdir chdir
 # undef __closedir
 # undef __closedir
 # define __closedir closedir
 # define __closedir closedir
 # undef __fchdir
 # undef __fchdir
 # define __fchdir fchdir
 # define __fchdir fchdir
-# ifndef __UCLIBC__
 # undef __getcwd
 # undef __getcwd
+# ifndef __UCLIBC__
 # define __getcwd(P, N) xgetcwd ()
 # define __getcwd(P, N) xgetcwd ()
 extern char *xgetcwd (void);
 extern char *xgetcwd (void);
+# else
+# define __getcwd getcwd
 # endif
 # endif
 # undef __mempcpy
 # undef __mempcpy
 # define __mempcpy mempcpy
 # define __mempcpy mempcpy
 # undef __opendir
 # undef __opendir
 # define __opendir opendir
 # define __opendir opendir
 # undef __readdir64
 # undef __readdir64
+# ifndef __UCLIBC_HAS_LFS__
 # define __readdir64 readdir
 # define __readdir64 readdir
+# else
+# define __readdir64 readdir64
+# endif
 # undef __stpcpy
 # undef __stpcpy
 # define __stpcpy stpcpy
 # define __stpcpy stpcpy
 # undef __tdestroy
 # undef __tdestroy
@@ -136,8 +153,10 @@ extern char *xgetcwd (void);
 # define __tsearch tsearch
 # define __tsearch tsearch
 # undef internal_function
 # undef internal_function
 # define internal_function /* empty */
 # define internal_function /* empty */
+# ifndef __UCLIBC_HAS_LFS__
 # undef dirent64
 # undef dirent64
 # define dirent64 dirent
 # define dirent64 dirent
+# endif
 # undef MAX
 # undef MAX
 # define MAX(a, b) ((a) > (b) ? (a) : (b))
 # define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif
 #endif
@@ -167,21 +186,11 @@ int rpl_lstat (const char *, struct stat *);
 #  define LXSTAT __lxstat
 #  define LXSTAT __lxstat
 #  define XSTAT __xstat
 #  define XSTAT __xstat
 # else
 # else
-#  ifdef __UCLIBC__
-#    define LXSTAT(V,f,sb) __lstat(f,sb)
-#    define XSTAT(V,f,sb) __stat(f,sb)
-#    define __readdir64 __readdir
-#    define dirent64 dirent
-#  else
 #  define LXSTAT(V,f,sb) lstat (f,sb)
 #  define LXSTAT(V,f,sb) lstat (f,sb)
 #  define XSTAT(V,f,sb) stat (f,sb)
 #  define XSTAT(V,f,sb) stat (f,sb)
-#  endif
 # endif
 # endif
 # define FTW_FUNC_T __ftw_func_t
 # define FTW_FUNC_T __ftw_func_t
 # define NFTW_FUNC_T __nftw_func_t
 # define NFTW_FUNC_T __nftw_func_t
-extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden;
-# else
-extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden;
 #endif
 #endif
 
 
 /* We define PATH_MAX if the system does not provide a definition.
 /* We define PATH_MAX if the system does not provide a definition.
@@ -520,7 +529,7 @@ fail:
 
 
   /* Next, update the `struct FTW' information.  */
   /* Next, update the `struct FTW' information.  */
   ++data->ftw.level;
   ++data->ftw.level;
-  startp = __strchr (data->dirbuf, '\0');
+  startp = strchr (data->dirbuf, '\0');
   /* There always must be a directory name.  */
   /* There always must be a directory name.  */
   assert (startp != data->dirbuf);
   assert (startp != data->dirbuf);
   if (startp[-1] != '/')
   if (startp[-1] != '/')
@@ -556,7 +565,7 @@ fail:
 
 
       while (result == 0 && *runp != '\0')
       while (result == 0 && *runp != '\0')
 	{
 	{
-	  char *endp = __strchr (runp, '\0');
+	  char *endp = strchr (runp, '\0');
 
 
 	  result = process_entry (data, &dir, runp, endp - runp);
 	  result = process_entry (data, &dir, runp, endp - runp);
 
 
@@ -633,10 +642,10 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
   data.actdir = 0;
   data.actdir = 0;
   data.dirstreams = (struct dir_data **) alloca (data.maxdir
   data.dirstreams = (struct dir_data **) alloca (data.maxdir
 						 * sizeof (struct dir_data *));
 						 * sizeof (struct dir_data *));
-  __memset (data.dirstreams, '\0', data.maxdir * sizeof (struct dir_data *));
+  memset (data.dirstreams, '\0', data.maxdir * sizeof (struct dir_data *));
 
 
   /* PATH_MAX is always defined when we get here.  */
   /* PATH_MAX is always defined when we get here.  */
-  data.dirbufsize = MAX (2 * __strlen (dir), PATH_MAX);
+  data.dirbufsize = MAX (2 * strlen (dir), PATH_MAX);
   data.dirbuf = (char *) malloc (data.dirbufsize);
   data.dirbuf = (char *) malloc (data.dirbufsize);
   if (data.dirbuf == NULL)
   if (data.dirbuf == NULL)
     return -1;
     return -1;

+ 2 - 2
libc/misc/ftw/ftw64.c

@@ -24,8 +24,8 @@
 #define NFTW_NEW_NAME __new_nftw64
 #define NFTW_NEW_NAME __new_nftw64
 #define INO_T ino64_t
 #define INO_T ino64_t
 #define STAT stat64
 #define STAT stat64
-#define LXSTAT(V,f,sb) __lstat64(f,sb)
+#define LXSTAT(V,f,sb) lstat64(f,sb)
-#define XSTAT(V,f,sb) __stat64(f,sb)
+#define XSTAT(V,f,sb) stat64(f,sb)
 #define FTW_FUNC_T __ftw64_func_t
 #define FTW_FUNC_T __ftw64_func_t
 #define NFTW_FUNC_T __nftw64_func_t
 #define NFTW_FUNC_T __nftw64_func_t
 
 

+ 32 - 25
libc/misc/glob/glob.c

@@ -15,11 +15,6 @@ License along with this library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 Cambridge, MA 02139, USA.  */
 
 
-#define strrchr __strrchr
-#define strcoll __strcoll
-#define qsort __qsort
-#define fnmatch __fnmatch
-
 #include <features.h>
 #include <features.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
@@ -33,8 +28,17 @@ Cambridge, MA 02139, USA.  */
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <glob.h>
 #include <glob.h>
 
 
-extern DIR *__opendir (__const char *__name) __nonnull ((1)) attribute_hidden;
+libc_hidden_proto(memcpy)
-extern int __closedir (DIR *__dirp) __nonnull ((1)) attribute_hidden;
+libc_hidden_proto(strcat)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strrchr)
+libc_hidden_proto(strcoll)
+libc_hidden_proto(opendir)
+libc_hidden_proto(closedir)
+libc_hidden_proto(fnmatch)
+libc_hidden_proto(qsort)
+libc_hidden_proto(lstat)
 
 
 extern __ptr_t (*__glob_opendir_hook) __P ((const char *directory));
 extern __ptr_t (*__glob_opendir_hook) __P ((const char *directory));
 extern void (*__glob_closedir_hook) __P ((__ptr_t stream));
 extern void (*__glob_closedir_hook) __P ((__ptr_t stream));
@@ -51,12 +55,15 @@ static int collated_compare __P ((const __ptr_t, const __ptr_t));
 
 
 #ifdef __GLOB64
 #ifdef __GLOB64
 extern int __glob_pattern_p(const char *pattern, int quote) attribute_hidden;
 extern int __glob_pattern_p(const char *pattern, int quote) attribute_hidden;
+libc_hidden_proto(readdir64)
+#define __readdir readdir64
 #else
 #else
-extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden;
 extern int __glob (__const char *__restrict __pattern, int __flags,
 extern int __glob (__const char *__restrict __pattern, int __flags,
 		 int (*__errfunc) (__const char *, int),
 		 int (*__errfunc) (__const char *, int),
 		 glob_t *__restrict __pglob) __THROW attribute_hidden;
 		 glob_t *__restrict __pglob) __THROW attribute_hidden;
 extern void __globfree (glob_t *__pglob) __THROW attribute_hidden;
 extern void __globfree (glob_t *__pglob) __THROW attribute_hidden;
+#define __readdir readdir
+libc_hidden_proto(readdir)
 /* Return nonzero if PATTERN contains any metacharacters.
 /* Return nonzero if PATTERN contains any metacharacters.
    Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
    Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
 int attribute_hidden __glob_pattern_p(const char *pattern, int quote)
 int attribute_hidden __glob_pattern_p(const char *pattern, int quote)
@@ -138,7 +145,7 @@ __glob (pattern, flags, errfunc, pglob)
     {
     {
       dirlen = filename - pattern;
       dirlen = filename - pattern;
       dirname = (char *) alloca (dirlen + 1);
       dirname = (char *) alloca (dirlen + 1);
-      __memcpy (dirname, pattern, dirlen);
+      memcpy (dirname, pattern, dirlen);
       dirname[dirlen] = '\0';
       dirname[dirlen] = '\0';
       ++filename;
       ++filename;
     }
     }
@@ -230,11 +237,11 @@ __glob (pattern, flags, errfunc, pglob)
 	/* No matches.  */
 	/* No matches.  */
 	if (flags & GLOB_NOCHECK)
 	if (flags & GLOB_NOCHECK)
 	{
 	{
-	    size_t len = __strlen (pattern) + 1;
+	    size_t len = strlen (pattern) + 1;
 	    char *patcopy = (char *) malloc (len);
 	    char *patcopy = (char *) malloc (len);
 	    if (patcopy == NULL)
 	    if (patcopy == NULL)
 	      return GLOB_NOSPACE;
 	      return GLOB_NOSPACE;
-	    __memcpy (patcopy, pattern, len);
+	    memcpy (patcopy, pattern, len);
 
 
 	    pglob->gl_pathv
 	    pglob->gl_pathv
 	      = (char **) realloc (pglob->gl_pathv,
 	      = (char **) realloc (pglob->gl_pathv,
@@ -290,9 +297,9 @@ __glob (pattern, flags, errfunc, pglob)
       int i;
       int i;
       struct stat st;
       struct stat st;
       for (i = oldcount; i < pglob->gl_pathc; ++i)
       for (i = oldcount; i < pglob->gl_pathc; ++i)
-	if (__lstat (pglob->gl_pathv[i], &st) == 0 &&
+	if (lstat (pglob->gl_pathv[i], &st) == 0 &&
 	    S_ISDIR (st.st_mode))
 	    S_ISDIR (st.st_mode))
-	  __strcat (pglob->gl_pathv[i], "/");
+	  strcat (pglob->gl_pathv[i], "/");
     }
     }
 
 
   if (!(flags & GLOB_NOSORT))
   if (!(flags & GLOB_NOSORT))
@@ -364,7 +371,7 @@ prefix_array (dirname, array, n, add_slash)
      int add_slash;
      int add_slash;
 {
 {
   register size_t i;
   register size_t i;
-  size_t dirlen = __strlen (dirname);
+  size_t dirlen = strlen (dirname);
 
 
   if (dirlen == 1 && dirname[0] == '/')
   if (dirlen == 1 && dirname[0] == '/')
     /* DIRNAME is just "/", so normal prepending would get us "//foo".
     /* DIRNAME is just "/", so normal prepending would get us "//foo".
@@ -373,7 +380,7 @@ prefix_array (dirname, array, n, add_slash)
 
 
   for (i = 0; i < n; ++i)
   for (i = 0; i < n; ++i)
     {
     {
-      size_t eltlen = __strlen (array[i]) + 1;
+      size_t eltlen = strlen (array[i]) + 1;
       char *new = (char *) malloc (dirlen + 1 + eltlen + (add_slash ? 1 : 0));
       char *new = (char *) malloc (dirlen + 1 + eltlen + (add_slash ? 1 : 0));
       if (new == NULL)
       if (new == NULL)
 	{
 	{
@@ -382,9 +389,9 @@ prefix_array (dirname, array, n, add_slash)
 	  return 1;
 	  return 1;
 	}
 	}
 
 
-      __memcpy (new, dirname, dirlen);
+      memcpy (new, dirname, dirlen);
       new[dirlen] = '/';
       new[dirlen] = '/';
-      __memcpy (&new[dirlen + 1], array[i], eltlen);
+      memcpy (&new[dirlen + 1], array[i], eltlen);
       free ((__ptr_t) array[i]);
       free ((__ptr_t) array[i]);
       array[i] = new;
       array[i] = new;
     }
     }
@@ -417,7 +424,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
   int meta;
   int meta;
 
 
   stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory)
   stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory)
-	   : (__ptr_t) __opendir (directory));
+	   : (__ptr_t) opendir (directory));
   if (stream == NULL)
   if (stream == NULL)
     {
     {
       if ((errfunc != NULL && (*errfunc) (directory, errno)) ||
       if ((errfunc != NULL && (*errfunc) (directory, errno)) ||
@@ -457,7 +464,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
 #endif
 #endif
 	}
 	}
 		
 		
-      if ((!meta && __strcmp (pattern, name) == 0)
+      if ((!meta && strcmp (pattern, name) == 0)
 	  || fnmatch (pattern, name,
 	  || fnmatch (pattern, name,
 		      (!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) |
 		      (!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) |
 		      ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0)
 		      ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0)
@@ -465,12 +472,12 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
 	  struct globlink *new
 	  struct globlink *new
 	    = (struct globlink *) alloca (sizeof (struct globlink));
 	    = (struct globlink *) alloca (sizeof (struct globlink));
 	  if (len == 0)
 	  if (len == 0)
-	    len = __strlen (name);
+	    len = strlen (name);
 	  new->name
 	  new->name
 	    = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
 	    = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
 	  if (new->name == NULL)
 	  if (new->name == NULL)
 	    goto memory_error;
 	    goto memory_error;
-	  __memcpy ((__ptr_t) new->name, name, len);
+	  memcpy ((__ptr_t) new->name, name, len);
 	  new->name[len] = '\0';
 	  new->name[len] = '\0';
 	  new->next = names;
 	  new->next = names;
 	  names = new;
 	  names = new;
@@ -482,14 +489,14 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
 
 
   if (nfound == 0 && (flags & GLOB_NOCHECK))
   if (nfound == 0 && (flags & GLOB_NOCHECK))
     {
     {
-      size_t len = __strlen (pattern);
+      size_t len = strlen (pattern);
       nfound = 1;
       nfound = 1;
       names = (struct globlink *) alloca (sizeof (struct globlink));
       names = (struct globlink *) alloca (sizeof (struct globlink));
       names->next = NULL;
       names->next = NULL;
       names->name = (char *) malloc (len + (flags & GLOB_MARK ? 1 : 0) + 1);
       names->name = (char *) malloc (len + (flags & GLOB_MARK ? 1 : 0) + 1);
       if (names->name == NULL)
       if (names->name == NULL)
 	goto memory_error;
 	goto memory_error;
-      __memcpy (names->name, pattern, len);
+      memcpy (names->name, pattern, len);
       names->name[len] = '\0';
       names->name[len] = '\0';
     }
     }
 
 
@@ -517,7 +524,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
     if (__glob_closedir_hook)
     if (__glob_closedir_hook)
       (*__glob_closedir_hook) (stream);
       (*__glob_closedir_hook) (stream);
     else
     else
-      (void) __closedir ((DIR *) stream);
+      (void) closedir ((DIR *) stream);
     errno = save;
     errno = save;
   }
   }
   return nfound == 0 ? GLOB_NOMATCH : 0;
   return nfound == 0 ? GLOB_NOMATCH : 0;
@@ -528,7 +535,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
     if (__glob_closedir_hook)
     if (__glob_closedir_hook)
       (*__glob_closedir_hook) (stream);
       (*__glob_closedir_hook) (stream);
     else
     else
-      (void) __closedir ((DIR *) stream);
+      (void) closedir ((DIR *) stream);
     errno = save;
     errno = save;
   }
   }
   while (names != NULL)
   while (names != NULL)

+ 2 - 4
libc/misc/glob/glob64.c

@@ -18,15 +18,13 @@
 #include <glob.h>
 #include <glob.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 
 
-extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden;
+
 extern int __glob64 (__const char *__restrict __pattern, int __flags,
 extern int __glob64 (__const char *__restrict __pattern, int __flags,
 		   int (*__errfunc) (__const char *, int),
 		   int (*__errfunc) (__const char *, int),
 		   glob64_t *__restrict __pglob) __THROW attribute_hidden;
 		   glob64_t *__restrict __pglob) __THROW attribute_hidden;
 extern void __globfree (glob_t *__pglob) __THROW attribute_hidden;
 extern void __globfree (glob_t *__pglob) __THROW attribute_hidden;
 extern void __globfree64 (glob64_t *__pglob) __THROW attribute_hidden;
 extern void __globfree64 (glob64_t *__pglob) __THROW attribute_hidden;
-
 #define dirent dirent64
 #define dirent dirent64
-#define __readdir(dirp) __readdir64(dirp)
 
 
 #define glob_t glob64_t
 #define glob_t glob64_t
 #define __glob(pattern, flags, errfunc, pglob) \
 #define __glob(pattern, flags, errfunc, pglob) \
@@ -38,7 +36,7 @@ extern void __globfree64 (glob64_t *__pglob) __THROW attribute_hidden;
 
 
 #undef stat
 #undef stat
 #define stat stat64
 #define stat stat64
-#define __lstat __lstat64
+#define lstat lstat64
 
 
 #define __GLOB64    1
 #define __GLOB64    1
     
     

+ 12 - 11
libc/misc/gnu/obstack.c

@@ -51,7 +51,7 @@
 # endif
 # endif
 #endif
 #endif
 
 
-#if defined _LIBC && defined USE_IN_LIBIO
+#if (defined _LIBC && defined USE_IN_LIBIO) || defined __UCLIBC_HAS_WCHAR__
 # include <wchar.h>
 # include <wchar.h>
 #endif
 #endif
 
 
@@ -105,6 +105,14 @@ void (*obstack_alloc_failed_handler) () = print_and_abort;
 # ifndef EXIT_FAILURE
 # ifndef EXIT_FAILURE
 #  define EXIT_FAILURE 1
 #  define EXIT_FAILURE 1
 # endif
 # endif
+
+libc_hidden_proto(fprintf)
+libc_hidden_proto(abort)
+libc_hidden_proto(exit)
+#ifdef __UCLIBC_HAS_WCHAR__
+libc_hidden_proto(fwprintf)
+#endif
+
 int obstack_exit_failure = EXIT_FAILURE;
 int obstack_exit_failure = EXIT_FAILURE;
 
 
 /* The non-GNU-C macros copy the obstack into this global variable
 /* The non-GNU-C macros copy the obstack into this global variable
@@ -480,15 +488,8 @@ _obstack_memory_used (h)
 #  define fputs(s, f) _IO_fputs (s, f)
 #  define fputs(s, f) _IO_fputs (s, f)
 # endif
 # endif
 
 
-# ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-#  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-#   define __attribute__(Spec) /* empty */
-#  endif
-# endif
-
 static void
 static void
-__attribute__ ((noreturn))
+attribute_noreturn
 print_and_abort ()
 print_and_abort ()
 {
 {
   /* Don't change any of these strings.  Yes, it would be possible to add
   /* Don't change any of these strings.  Yes, it would be possible to add
@@ -498,11 +499,11 @@ print_and_abort ()
      a very similar string which requires a separate translation.  */
      a very similar string which requires a separate translation.  */
 # if defined _LIBC && defined USE_IN_LIBIO
 # if defined _LIBC && defined USE_IN_LIBIO
   if (_IO_fwide (stderr, 0) > 0)
   if (_IO_fwide (stderr, 0) > 0)
-    __fwprintf (stderr, L"%s\n", _("memory exhausted"));
+    fwprintf (stderr, L"%s\n", _("memory exhausted"));
   else
   else
 # endif
 # endif
     fprintf (stderr, "%s\n", _("memory exhausted"));
     fprintf (stderr, "%s\n", _("memory exhausted"));
-  __exit (obstack_exit_failure);
+  exit (obstack_exit_failure);
 }
 }
 
 
 # if 0
 # if 0

+ 28 - 17
libc/misc/internals/__uClibc_main.c

@@ -13,11 +13,6 @@
  * avoided in the static library case.
  * avoided in the static library case.
  */
  */
 
 
-#define getgid __getgid
-#define getuid __getuid
-#define getegid __getegid
-#define geteuid __geteuid
-
 #define	_ERRNO_H
 #define	_ERRNO_H
 #include <features.h>
 #include <features.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -33,6 +28,21 @@
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/sysmacros.h>
 #include <sys/sysmacros.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(strrchr)
+libc_hidden_proto(getgid)
+libc_hidden_proto(getuid)
+libc_hidden_proto(getegid)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(fstat)
+libc_hidden_proto(abort)
+libc_hidden_proto(exit)
+
+extern int __libc_open (__const char *__file, int __oflag, ...) __nonnull ((1));
+libc_hidden_proto(__libc_open)
+extern int __libc_fcntl (int __fd, int __cmd, ...);
+libc_hidden_proto(__libc_fcntl)
+
 #ifndef SHARED
 #ifndef SHARED
 void *__libc_stack_end=NULL;
 void *__libc_stack_end=NULL;
 
 
@@ -84,7 +94,8 @@ weak_alias(__environ, environ)
 
 
 /* TODO: don't export __pagesize; we cant now because libpthread uses it */
 /* TODO: don't export __pagesize; we cant now because libpthread uses it */
 size_t __pagesize = 0;
 size_t __pagesize = 0;
-hidden_strong_alias(__pagesize,__pagesize_internal)
+libc_hidden_proto(__pagesize)
+libc_hidden_def(__pagesize)
 
 
 #ifndef O_NOFOLLOW
 #ifndef O_NOFOLLOW
 # define O_NOFOLLOW	0
 # define O_NOFOLLOW	0
@@ -95,18 +106,17 @@ hidden_strong_alias(__pagesize,__pagesize_internal)
 static void __check_one_fd(int fd, int mode)
 static void __check_one_fd(int fd, int mode)
 {
 {
     /* Check if the specified fd is already open */
     /* Check if the specified fd is already open */
-    if (unlikely(__fcntl(fd, F_GETFD)==-1 && *(__errno_location())==EBADF))
+    if (unlikely(__libc_fcntl(fd, F_GETFD)==-1 && *(__errno_location())==EBADF))
     {
     {
 	/* The descriptor is probably not open, so try to use /dev/null */
 	/* The descriptor is probably not open, so try to use /dev/null */
 	struct stat st;
 	struct stat st;
-	int nullfd = __open(_PATH_DEVNULL, mode);
+	int nullfd = __libc_open(_PATH_DEVNULL, mode);
 	/* /dev/null is major=1 minor=3.  Make absolutely certain
 	/* /dev/null is major=1 minor=3.  Make absolutely certain
 	 * that is in fact the device that we have opened and not
 	 * that is in fact the device that we have opened and not
 	 * some other wierd file... */
 	 * some other wierd file... */
-	if ( (nullfd!=fd) || __fstat(fd, &st) || !S_ISCHR(st.st_mode) ||
+	if ( (nullfd!=fd) || fstat(fd, &st) || !S_ISCHR(st.st_mode) ||
 		(st.st_rdev != makedev(1, 3)))
 		(st.st_rdev != makedev(1, 3)))
 	{
 	{
-	    /* Somebody is trying some trickery here... */
 		abort();
 		abort();
 	}
 	}
     }
     }
@@ -152,7 +162,7 @@ void __uClibc_init(void)
 
 
     /* Setup an initial value.  This may not be perfect, but is
     /* Setup an initial value.  This may not be perfect, but is
      * better than  malloc using __pagesize=0 for atexit, ctors, etc.  */
      * better than  malloc using __pagesize=0 for atexit, ctors, etc.  */
-    __pagesize_internal = PAGE_SIZE;
+    __pagesize = PAGE_SIZE;
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
     /* Before we start initializing uClibc we have to call
     /* Before we start initializing uClibc we have to call
@@ -189,7 +199,8 @@ void __uClibc_init(void)
 	_stdio_init();
 	_stdio_init();
 
 
 }
 }
-hidden_strong_alias(__uClibc_init,__uClibc_init_internal)
+libc_hidden_proto(__uClibc_init)
+libc_hidden_def(__uClibc_init)
 
 
 #ifdef __UCLIBC_CTOR_DTOR__
 #ifdef __UCLIBC_CTOR_DTOR__
 void attribute_hidden (*__app_fini)(void) = NULL;
 void attribute_hidden (*__app_fini)(void) = NULL;
@@ -237,7 +248,7 @@ __uClibc_main(int (*main)(int, char **, char **), int argc,
     while (*aux_dat) {
     while (*aux_dat) {
 	ElfW(auxv_t) *auxv_entry = (ElfW(auxv_t) *) aux_dat;
 	ElfW(auxv_t) *auxv_entry = (ElfW(auxv_t) *) aux_dat;
 	if (auxv_entry->a_type <= AT_EGID) {
 	if (auxv_entry->a_type <= AT_EGID) {
-	    __memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(ElfW(auxv_t)));
+	    memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(ElfW(auxv_t)));
 	}
 	}
 	aux_dat += 2;
 	aux_dat += 2;
     }
     }
@@ -246,11 +257,11 @@ __uClibc_main(int (*main)(int, char **, char **), int argc,
     /* We need to initialize uClibc.  If we are dynamically linked this
     /* We need to initialize uClibc.  If we are dynamically linked this
      * may have already been completed by the shared lib loader.  We call
      * may have already been completed by the shared lib loader.  We call
      * __uClibc_init() regardless, to be sure the right thing happens. */
      * __uClibc_init() regardless, to be sure the right thing happens. */
-    __uClibc_init_internal();
+    __uClibc_init();
 
 
 #ifdef __ARCH_HAS_MMU__
 #ifdef __ARCH_HAS_MMU__
     /* Make certain getpagesize() gives the correct answer */
     /* Make certain getpagesize() gives the correct answer */
-    __pagesize_internal = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
+    __pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
 
 
     /* Prevent starting SUID binaries where the stdin. stdout, and
     /* Prevent starting SUID binaries where the stdin. stdout, and
      * stderr file descriptors are not already opened. */
      * stderr file descriptors are not already opened. */
@@ -267,7 +278,7 @@ __uClibc_main(int (*main)(int, char **, char **), int argc,
 
 
 #ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
 #ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
     __progname_full = *argv;
     __progname_full = *argv;
-    __progname = __strrchr(*argv, '/');
+    __progname = strrchr(*argv, '/');
     if (__progname != NULL)
     if (__progname != NULL)
 	++__progname;
 	++__progname;
     else
     else
@@ -300,5 +311,5 @@ __uClibc_main(int (*main)(int, char **, char **), int argc,
     /*
     /*
      * Finally, invoke application's main and then exit.
      * Finally, invoke application's main and then exit.
      */
      */
-    __exit(main(argc, argv, __environ));
+    exit(main(argc, argv, __environ));
 }
 }

+ 25 - 18
libc/misc/internals/tempname.c

@@ -31,10 +31,6 @@
  * Use brain damaged getpid() if real random fails.
  * Use brain damaged getpid() if real random fails.
  */
  */
 
 
-#define open64 __open64
-#define mkdir __mkdir
-#define gettimeofday __gettimeofday
-
 #include <stddef.h>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -49,12 +45,23 @@
 #include <sys/time.h>
 #include <sys/time.h>
 #include "tempname.h"
 #include "tempname.h"
 
 
+libc_hidden_proto(strlen)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(sprintf)
+libc_hidden_proto(mkdir)
+libc_hidden_proto(open)
+libc_hidden_proto(open64)
+libc_hidden_proto(read)
+libc_hidden_proto(close)
+libc_hidden_proto(getpid)
+libc_hidden_proto(stat)
+libc_hidden_proto(gettimeofday)
 
 
 /* Return nonzero if DIR is an existent directory.  */
 /* Return nonzero if DIR is an existent directory.  */
 static int direxists (const char *dir)
 static int direxists (const char *dir)
 {
 {
     struct stat buf;
     struct stat buf;
-    return __stat(dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+    return stat(dir, &buf) == 0 && S_ISDIR (buf.st_mode);
 }
 }
 
 
 /* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
 /* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
@@ -76,7 +83,7 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di
     }
     }
     else
     else
     {
     {
-	plen = __strlen (pfx);
+	plen = strlen (pfx);
 	if (plen > 5)
 	if (plen > 5)
 	    plen = 5;
 	    plen = 5;
     }
     }
@@ -98,7 +105,7 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di
     {
     {
 	if (direxists (P_tmpdir))
 	if (direxists (P_tmpdir))
 	    dir = P_tmpdir;
 	    dir = P_tmpdir;
-	else if (__strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
+	else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
 	    dir = "/tmp";
 	    dir = "/tmp";
 	else
 	else
 	{
 	{
@@ -107,7 +114,7 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di
 	}
 	}
     }
     }
 
 
-    dlen = __strlen (dir);
+    dlen = strlen (dir);
     while (dlen > 1 && dir[dlen - 1] == '/')
     while (dlen > 1 && dir[dlen - 1] == '/')
 	dlen--;			/* remove trailing slashes */
 	dlen--;			/* remove trailing slashes */
 
 
@@ -118,7 +125,7 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di
 	return -1;
 	return -1;
     }
     }
 
 
-    __sprintf (tmpl, "%.*s/%.*sXXXXXX", dlen, dir, plen, pfx);
+    sprintf (tmpl, "%.*s/%.*sXXXXXX", dlen, dir, plen, pfx);
     return 0;
     return 0;
 }
 }
 
 
@@ -131,13 +138,13 @@ static unsigned int fillrand(unsigned char *buf, unsigned int len)
 {
 {
     int fd;
     int fd;
     unsigned int result = -1;
     unsigned int result = -1;
-    fd = __open("/dev/urandom", O_RDONLY);
+    fd = open("/dev/urandom", O_RDONLY);
     if (fd < 0) {
     if (fd < 0) {
-	fd = __open("/dev/random", O_RDONLY | O_NONBLOCK);
+	fd = open("/dev/random", O_RDONLY | O_NONBLOCK);
     }
     }
     if (fd >= 0) {
     if (fd >= 0) {
-	result = __read(fd, buf, len);
+	result = read(fd, buf, len);
-	__close(fd);
+	close(fd);
     }
     }
     return result;
     return result;
 }
 }
@@ -149,7 +156,7 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len)
 	uint32_t high, low, rh;
 	uint32_t high, low, rh;
 	static uint64_t value;
 	static uint64_t value;
 	gettimeofday(&tv, NULL);
 	gettimeofday(&tv, NULL);
-	value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ __getpid();
+	value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid();
 	low = value & UINT32_MAX;
 	low = value & UINT32_MAX;
 	high = value >> 32;
 	high = value >> 32;
 	for (i = 0; i < len; ++i) {
 	for (i = 0; i < len; ++i) {
@@ -188,10 +195,10 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind)
     unsigned char randomness[6];
     unsigned char randomness[6];
     size_t len;
     size_t len;
 
 
-    len = __strlen (tmpl);
+    len = strlen (tmpl);
     /* This is where the Xs start.  */
     /* This is where the Xs start.  */
     XXXXXX = tmpl + len - 6;
     XXXXXX = tmpl + len - 6;
-    if (len < 6 || __strcmp (XXXXXX, "XXXXXX"))
+    if (len < 6 || strcmp (XXXXXX, "XXXXXX"))
     {
     {
 	__set_errno (EINVAL);
 	__set_errno (EINVAL);
 	return -1;
 	return -1;
@@ -212,7 +219,7 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind)
 	    case __GT_NOCREATE:
 	    case __GT_NOCREATE:
 		{
 		{
 		    struct stat st;
 		    struct stat st;
-		    if (__stat (tmpl, &st) < 0) {
+		    if (stat (tmpl, &st) < 0) {
 			if (errno == ENOENT) {
 			if (errno == ENOENT) {
 			    fd = 0;
 			    fd = 0;
 			    goto restore_and_ret;
 			    goto restore_and_ret;
@@ -223,7 +230,7 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind)
 			fd = 0;
 			fd = 0;
 		}
 		}
 	    case __GT_FILE:
 	    case __GT_FILE:
-		fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+		fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
 		break;
 		break;
 #if defined __UCLIBC_HAS_LFS__
 #if defined __UCLIBC_HAS_LFS__
 	    case __GT_BIGFILE:
 	    case __GT_BIGFILE:

+ 63 - 56
libc/misc/locale/locale.c

@@ -46,15 +46,10 @@
  *    locale support had (8-bit codesets only).
  *    locale support had (8-bit codesets only).
  */
  */
 
 
-#define stpcpy __stpcpy
-#define strtok_r __strtok_r
-/* #define fflush __fflush */
-
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 
 
 #define __CTYPE_HAS_8_BIT_LOCALES 1
 #define __CTYPE_HAS_8_BIT_LOCALES 1
 
 
-
 #include <string.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <stddef.h>
@@ -65,6 +60,18 @@
 #include <ctype.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdio.h>
 
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(stpcpy)
+libc_hidden_proto(strtok_r)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strncmp)
+libc_hidden_proto(strchr)
+libc_hidden_proto(getenv)
+/*libc_hidden_proto(fflush)*/
+
 #ifdef __UCLIBC_MJN3_ONLY__
 #ifdef __UCLIBC_MJN3_ONLY__
 #ifdef L_setlocale
 #ifdef L_setlocale
 #warning TODO: Make the link_warning()s a config option?
 #warning TODO: Make the link_warning()s a config option?
@@ -157,7 +164,7 @@ char *setlocale(int category, register const char *locale)
 			 && ( (!locale)		/* Request for locale category string. */
 			 && ( (!locale)		/* Request for locale category string. */
 				  || (!*locale)	/* Implementation-defined default is C. */
 				  || (!*locale)	/* Implementation-defined default is C. */
 				  || ((*locale == 'C') && !locale[1])
 				  || ((*locale == 'C') && !locale[1])
-				  || (!__strcmp(locale, "POSIX"))) )
+				  || (!strcmp(locale, "POSIX"))) )
 		? (char *) C_string		/* Always in C/POSIX locale. */
 		? (char *) C_string		/* Always in C/POSIX locale. */
 		: NULL;
 		: NULL;
 }
 }
@@ -186,6 +193,8 @@ static const char utf8[] = "UTF-8";
  */
  */
 static char hr_locale[(MAX_LOCALE_CATEGORY_STR * LC_ALL) + MAX_LOCALE_STR];
 static char hr_locale[(MAX_LOCALE_CATEGORY_STR * LC_ALL) + MAX_LOCALE_STR];
 
 
+libc_hidden_proto(newlocale)
+
 static void update_hr_locale(const unsigned char *spec)
 static void update_hr_locale(const unsigned char *spec)
 {
 {
 	const unsigned char *loc;
 	const unsigned char *loc;
@@ -228,7 +237,7 @@ static void update_hr_locale(const unsigned char *spec)
 					*n = 0;
 					*n = 0;
 				} else {
 				} else {
 					char at = 0;
 					char at = 0;
-					__memcpy(n, LOCALE_NAMES + 5*((*loc)-1), 5);
+					memcpy(n, LOCALE_NAMES + 5*((*loc)-1), 5);
 					if (n[2] != '_') {
 					if (n[2] != '_') {
 						at = n[2];
 						at = n[2];
 						n[2] = '_';
 						n[2] = '_';
@@ -263,9 +272,6 @@ static void update_hr_locale(const unsigned char *spec)
 	} while (!done);
 	} while (!done);
 }
 }
 
 
-extern __locale_t __newlocale (int __category_mask, __const char *__locale,
-			     __locale_t __base) __THROW attribute_hidden;
-
 char *setlocale(int category, const char *locale)
 char *setlocale(int category, const char *locale)
 {
 {
 	if (((unsigned int)(category)) > LC_ALL) {
 	if (((unsigned int)(category)) > LC_ALL) {
@@ -276,7 +282,7 @@ char *setlocale(int category, const char *locale)
 	}
 	}
 
 
 	if (locale != NULL) {		/* Not just a query... */
 	if (locale != NULL) {		/* Not just a query... */
-		if (!__newlocale((1 << category), locale, __global_locale)) {
+		if (!newlocale((1 << category), locale, __global_locale)) {
 			return NULL;		/* Failed! */
 			return NULL;		/* Failed! */
 		}
 		}
 		update_hr_locale(__global_locale->cur_locale);
 		update_hr_locale(__global_locale->cur_locale);
@@ -460,7 +466,7 @@ static int init_cur_collate(int der_num, __collate_t *cur_collate)
 								+ cdd->base_idx * sizeof(coldata_base_t)
 								+ cdd->base_idx * sizeof(coldata_base_t)
 								)/2 );
 								)/2 );
 
 
-	__memcpy(cur_collate, cdb, offsetof(coldata_base_t,index2weight_offset));
+	memcpy(cur_collate, cdb, offsetof(coldata_base_t,index2weight_offset));
 	cur_collate->undefined_idx = cdd->undefined_idx;
 	cur_collate->undefined_idx = cdd->undefined_idx;
 
 
 	cur_collate->ti_mask = (1 << cur_collate->ti_shift)-1;
 	cur_collate->ti_mask = (1 << cur_collate->ti_shift)-1;
@@ -512,9 +518,9 @@ static int init_cur_collate(int der_num, __collate_t *cur_collate)
 	cur_collate->index2ruleidx = cur_collate->index2weight
 	cur_collate->index2ruleidx = cur_collate->index2weight
 		+ cur_collate->max_col_index + 1;
 		+ cur_collate->max_col_index + 1;
 
 
-	__memcpy(cur_collate->index2weight, cur_collate->index2weight_tbl,
+	memcpy(cur_collate->index2weight, cur_collate->index2weight_tbl,
 		   cur_collate->num_col_base * sizeof(uint16_t));
 		   cur_collate->num_col_base * sizeof(uint16_t));
-	__memcpy(cur_collate->index2ruleidx, cur_collate->index2ruleidx_tbl,
+	memcpy(cur_collate->index2ruleidx, cur_collate->index2ruleidx_tbl,
 		   cur_collate->num_col_base * sizeof(uint16_t));
 		   cur_collate->num_col_base * sizeof(uint16_t));
 
 
 	/* now do the overrides */
 	/* now do the overrides */
@@ -599,7 +605,7 @@ int attribute_hidden _locale_set_l(const unsigned char *p, __locale_t base)
 			return 0;			/* calloc failed. */
 			return 0;			/* calloc failed. */
 		}
 		}
 		free(base->collate.index2weight);
 		free(base->collate.index2weight);
-		__memcpy(&base->collate, &newcol, sizeof(__collate_t));
+		memcpy(&base->collate, &newcol, sizeof(__collate_t));
 	}
 	}
 
 
 	do {
 	do {
@@ -669,15 +675,15 @@ int attribute_hidden _locale_set_l(const unsigned char *p, __locale_t base)
 					 * All of this will be replaced in the next generation
 					 * All of this will be replaced in the next generation
 					 * of locale support anyway... */
 					 * of locale support anyway... */
 
 
-					__memcpy(base->__ctype_b_data,
+					memcpy(base->__ctype_b_data,
 						   __C_ctype_b - __UCLIBC_CTYPE_B_TBL_OFFSET,
 						   __C_ctype_b - __UCLIBC_CTYPE_B_TBL_OFFSET,
 						   (256 + __UCLIBC_CTYPE_B_TBL_OFFSET)
 						   (256 + __UCLIBC_CTYPE_B_TBL_OFFSET)
 						   * sizeof(__ctype_mask_t));
 						   * sizeof(__ctype_mask_t));
-					__memcpy(base->__ctype_tolower_data,
+					memcpy(base->__ctype_tolower_data,
 						   __C_ctype_tolower - __UCLIBC_CTYPE_TO_TBL_OFFSET,
 						   __C_ctype_tolower - __UCLIBC_CTYPE_TO_TBL_OFFSET,
 						   (256 + __UCLIBC_CTYPE_TO_TBL_OFFSET)
 						   (256 + __UCLIBC_CTYPE_TO_TBL_OFFSET)
 						   * sizeof(__ctype_touplow_t));
 						   * sizeof(__ctype_touplow_t));
-					__memcpy(base->__ctype_toupper_data,
+					memcpy(base->__ctype_toupper_data,
 						   __C_ctype_toupper - __UCLIBC_CTYPE_TO_TBL_OFFSET,
 						   __C_ctype_toupper - __UCLIBC_CTYPE_TO_TBL_OFFSET,
 						   (256 + __UCLIBC_CTYPE_TO_TBL_OFFSET)
 						   (256 + __UCLIBC_CTYPE_TO_TBL_OFFSET)
 						   * sizeof(__ctype_touplow_t));
 						   * sizeof(__ctype_touplow_t));
@@ -787,7 +793,7 @@ int attribute_hidden _locale_set_l(const unsigned char *p, __locale_t base)
 				d = base->outdigit_length;
 				d = base->outdigit_length;
 				x = &base->outdigit0_mb;
 				x = &base->outdigit0_mb;
 				for (c = 0 ; c < 10 ; c++) {
 				for (c = 0 ; c < 10 ; c++) {
-					((unsigned char *)d)[c] = __strlen(x[c]);
+					((unsigned char *)d)[c] = strlen(x[c]);
 					assert(d[c] > 0);
 					assert(d[c] > 0);
 				}
 				}
 			} else if (i == LC_NUMERIC) {
 			} else if (i == LC_NUMERIC) {
@@ -852,10 +858,10 @@ static const uint16_t __code2flag[16] = {
 
 
 void attribute_hidden _locale_init_l(__locale_t base)
 void attribute_hidden _locale_init_l(__locale_t base)
 {
 {
-	__memset(base->cur_locale, 0, LOCALE_SELECTOR_SIZE);
+	memset(base->cur_locale, 0, LOCALE_SELECTOR_SIZE);
 	base->cur_locale[0] = '#';
 	base->cur_locale[0] = '#';
 
 
-	__memcpy(base->category_item_count,
+	memcpy(base->category_item_count,
 		   __locale_mmap->lc_common_item_offsets_LEN,
 		   __locale_mmap->lc_common_item_offsets_LEN,
 		   LC_ALL);
 		   LC_ALL);
 
 
@@ -1006,7 +1012,7 @@ static const unsigned char nl_data[C_LC_ALL + 1 + 90 + 320] = {
 	   ']', '\x00',    '^',    '[',    'n',    'N',    ']', '\x00', 
 	   ']', '\x00',    '^',    '[',    'n',    'N',    ']', '\x00', 
 };
 };
 
 
-char attribute_hidden *__nl_langinfo(nl_item item)
+char *nl_langinfo(nl_item item)
 {
 {
 	unsigned int c;
 	unsigned int c;
 	unsigned int i;
 	unsigned int i;
@@ -1019,25 +1025,27 @@ char attribute_hidden *__nl_langinfo(nl_item item)
 	}
 	}
 	return (char *) cat_start;	/* Conveniently, this is the empty string. */
 	return (char *) cat_start;	/* Conveniently, this is the empty string. */
 }
 }
-strong_alias(__nl_langinfo,nl_langinfo)
+libc_hidden_proto(nl_langinfo)
+libc_hidden_def(nl_langinfo)
 
 
 #else  /* __LOCALE_C_ONLY */
 #else  /* __LOCALE_C_ONLY */
 
 
 #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
 #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
 
 
-extern char *__nl_langinfo_l (nl_item __item, __locale_t l) attribute_hidden;
+libc_hidden_proto(nl_langinfo_l)
 
 
-char attribute_hidden *__nl_langinfo(nl_item item)
+char *nl_langinfo(nl_item item)
 {
 {
-	return __nl_langinfo_l(item, __UCLIBC_CURLOCALE);
+	return nl_langinfo_l(item, __UCLIBC_CURLOCALE);
 }
 }
-strong_alias(__nl_langinfo,nl_langinfo)
+libc_hidden_proto(nl_langinfo)
+libc_hidden_def(nl_langinfo)
 
 
 #else  /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
 #else  /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
 
 
 static const char empty[] = "";
 static const char empty[] = "";
 
 
-char attribute_hidden *__UCXL(nl_langinfo)(nl_item item   __LOCALE_PARAM )
+char *__XL_NPP(nl_langinfo)(nl_item item   __LOCALE_PARAM )
 {
 {
 	unsigned int c = _NL_ITEM_CATEGORY(item);
 	unsigned int c = _NL_ITEM_CATEGORY(item);
 	unsigned int i = _NL_ITEM_INDEX(item);
 	unsigned int i = _NL_ITEM_INDEX(item);
@@ -1049,7 +1057,8 @@ char attribute_hidden *__UCXL(nl_langinfo)(nl_item item   __LOCALE_PARAM )
 
 
 	return (char *) empty;
 	return (char *) empty;
 }
 }
-__UCXL_ALIAS(nl_langinfo)
+libc_hidden_proto(__XL_NPP(nl_langinfo))
+libc_hidden_def(__XL_NPP(nl_langinfo))
 
 
 #endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
 #endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
 
 
@@ -1082,14 +1091,14 @@ static int find_locale(int category_mask, const char *p,
 	char buf[18];	/* TODO: 7+{max codeset name length} */
 	char buf[18];	/* TODO: 7+{max codeset name length} */
 	const char *q;
 	const char *q;
 
 
-	if ((q = __strchr(p,'@')) != NULL) {
+	if ((q = strchr(p,'@')) != NULL) {
 		if ((((size_t)((q-p)-5)) > (sizeof(buf) - 5)) || (p[2] != '_')) {
 		if ((((size_t)((q-p)-5)) > (sizeof(buf) - 5)) || (p[2] != '_')) {
 			return 0;
 			return 0;
 		}
 		}
 		/* locale name at least 5 chars long and 3rd char is '_' */
 		/* locale name at least 5 chars long and 3rd char is '_' */
 		s = LOCALE_AT_MODIFIERS;
 		s = LOCALE_AT_MODIFIERS;
 		do {
 		do {
-			if (!__strcmp(s+2, q+1)) {
+			if (!strcmp(s+2, q+1)) {
 				break;
 				break;
 			}
 			}
 			s += 2 + *s;		/* TODO - fix this throughout */
 			s += 2 + *s;		/* TODO - fix this throughout */
@@ -1098,7 +1107,7 @@ static int find_locale(int category_mask, const char *p,
 			return 0;
 			return 0;
 		}
 		}
 		assert(q - p < sizeof(buf));
 		assert(q - p < sizeof(buf));
-		__memcpy(buf, p, q-p);
+		memcpy(buf, p, q-p);
 		buf[q-p] = 0;
 		buf[q-p] = 0;
 		buf[2] = s[1];
 		buf[2] = s[1];
 		p = buf;
 		p = buf;
@@ -1106,19 +1115,19 @@ static int find_locale(int category_mask, const char *p,
 #endif
 #endif
 
 
 	lang_cult = codeset = 0;	/* Assume C and default codeset.  */
 	lang_cult = codeset = 0;	/* Assume C and default codeset.  */
-	if (((*p == 'C') && !p[1]) || !__strcmp(p, posix)) {
+	if (((*p == 'C') && !p[1]) || !strcmp(p, posix)) {
 		goto FIND_LOCALE;
 		goto FIND_LOCALE;
 	}
 	}
 
 
-	if ((__strlen(p) > 5) && (p[5] == '.')) {	/* Codeset in locale name? */
+	if ((strlen(p) > 5) && (p[5] == '.')) {	/* Codeset in locale name? */
 		/* TODO: maybe CODESET_LIST + *s ??? */
 		/* TODO: maybe CODESET_LIST + *s ??? */
 		/* 7bit is 1, UTF-8 is 2, 8-bit is >= 3 */
 		/* 7bit is 1, UTF-8 is 2, 8-bit is >= 3 */
 		codeset = 2;
 		codeset = 2;
-		if (__strcmp(utf8,p+6) != 0) {/* TODO - fix! */
+		if (strcmp(utf8,p+6) != 0) {/* TODO - fix! */
 			s = CODESET_LIST;
 			s = CODESET_LIST;
 			do {
 			do {
 				++codeset;		/* Increment codeset first. */
 				++codeset;		/* Increment codeset first. */
-				if (!__strcmp(CODESET_LIST+*s, p+6)) {
+				if (!strcmp(CODESET_LIST+*s, p+6)) {
 					goto FIND_LANG_CULT;
 					goto FIND_LANG_CULT;
 				}
 				}
 			} while (*++s);
 			} while (*++s);
@@ -1131,7 +1140,7 @@ static int find_locale(int category_mask, const char *p,
 	do {						/* TODO -- do a binary search? */
 	do {						/* TODO -- do a binary search? */
 		/* TODO -- fix gen_mmap!*/
 		/* TODO -- fix gen_mmap!*/
 		++lang_cult;			/* Increment first since C/POSIX is 0. */
 		++lang_cult;			/* Increment first since C/POSIX is 0. */
-		if (!__strncmp(s,p,5)) { /* Found a matching locale name; */
+		if (!strncmp(s,p,5)) { /* Found a matching locale name; */
 			goto FIND_LOCALE;
 			goto FIND_LOCALE;
 		}
 		}
 		s += 5;
 		s += 5;
@@ -1173,14 +1182,14 @@ static unsigned char *composite_locale(int category_mask, const char *locale,
 	int c;
 	int c;
 	int component_mask;
 	int component_mask;
 
 
-	if (!__strchr(locale,'=')) {
+	if (!strchr(locale,'=')) {
 		if (!find_locale(category_mask, locale, new_locale)) {
 		if (!find_locale(category_mask, locale, new_locale)) {
 			return NULL;
 			return NULL;
 		}
 		}
 		return new_locale;
 		return new_locale;
 	}
 	}
 
 
-	if (__strlen(locale) >= sizeof(buf)) {
+	if (strlen(locale) >= sizeof(buf)) {
 		return NULL;
 		return NULL;
 	}
 	}
 	stpcpy(buf, locale);
 	stpcpy(buf, locale);
@@ -1189,7 +1198,7 @@ static unsigned char *composite_locale(int category_mask, const char *locale,
 	t = strtok_r(buf, "=", &e);	/* This can't fail because of strchr test above. */
 	t = strtok_r(buf, "=", &e);	/* This can't fail because of strchr test above. */
 	do {
 	do {
 		c = 0;
 		c = 0;
-		while (__strcmp(CATEGORY_NAMES + (int) CATEGORY_NAMES[c], t)) {
+		while (strcmp(CATEGORY_NAMES + (int) CATEGORY_NAMES[c], t)) {
 			if (++c == LC_ALL) { /* Unknown category name! */
 			if (++c == LC_ALL) { /* Unknown category name! */
 				return NULL;
 				return NULL;
 			}
 			}
@@ -1212,7 +1221,7 @@ static unsigned char *composite_locale(int category_mask, const char *locale,
 	return new_locale;
 	return new_locale;
 }
 }
 
 
-__locale_t attribute_hidden __newlocale(int category_mask, const char *locale, __locale_t base)
+__locale_t newlocale(int category_mask, const char *locale, __locale_t base)
 {
 {
 	const unsigned char *p;
 	const unsigned char *p;
 	int i, j, k;
 	int i, j, k;
@@ -1231,7 +1240,7 @@ __locale_t attribute_hidden __newlocale(int category_mask, const char *locale, _
 #ifdef __UCLIBC_MJN3_ONLY__
 #ifdef __UCLIBC_MJN3_ONLY__
 #warning TODO: Rename cur_locale to locale_selector.
 #warning TODO: Rename cur_locale to locale_selector.
 #endif
 #endif
-	__strcpy((char *) new_selector,
+	strcpy((char *) new_selector,
 		   (base ? (char *) base->cur_locale : C_LOCALE_SELECTOR));
 		   (base ? (char *) base->cur_locale : C_LOCALE_SELECTOR));
 
 
 	if (!*locale) {			 /* locale == "", so check environment. */
 	if (!*locale) {			 /* locale == "", so check environment. */
@@ -1251,7 +1260,7 @@ __locale_t attribute_hidden __newlocale(int category_mask, const char *locale, _
 				j = 0;
 				j = 0;
 				do {
 				do {
 					p = envstr[j];
 					p = envstr[j];
-				} while ((++j < 4) && (!(p = __getenv(p)) || !*p));
+				} while ((++j < 4) && (!(p = getenv(p)) || !*p));
 
 
 
 
 				/* The user set something... is it valid? */
 				/* The user set something... is it valid? */
@@ -1296,8 +1305,8 @@ __locale_t attribute_hidden __newlocale(int category_mask, const char *locale, _
 
 
 	return base;
 	return base;
 }
 }
-
+libc_hidden_proto(newlocale)
-weak_alias(__newlocale, newlocale)
+libc_hidden_def(newlocale)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
@@ -1307,7 +1316,7 @@ weak_alias(__newlocale, newlocale)
 #warning REMINDER: When we allocate ctype tables, remember to dup them.
 #warning REMINDER: When we allocate ctype tables, remember to dup them.
 #endif
 #endif
 
 
-__locale_t attribute_hidden __duplocale(__locale_t dataset)
+__locale_t duplocale(__locale_t dataset)
 {
 {
 	__locale_t r;
 	__locale_t r;
 	uint16_t * i2w;
 	uint16_t * i2w;
@@ -1320,9 +1329,9 @@ __locale_t attribute_hidden __duplocale(__locale_t dataset)
 		if ((i2w = calloc(n, sizeof(uint16_t)))
 		if ((i2w = calloc(n, sizeof(uint16_t)))
 			!= NULL
 			!= NULL
 			) {
 			) {
-			__memcpy(r, dataset, sizeof(__uclibc_locale_t));
+			memcpy(r, dataset, sizeof(__uclibc_locale_t));
 			r->collate.index2weight = i2w;
 			r->collate.index2weight = i2w;
-			__memcpy(i2w, dataset->collate.index2weight, n * sizeof(uint16_t));
+			memcpy(i2w, dataset->collate.index2weight, n * sizeof(uint16_t));
 		} else {
 		} else {
 			free(r);
 			free(r);
 			r = NULL;
 			r = NULL;
@@ -1330,8 +1339,8 @@ __locale_t attribute_hidden __duplocale(__locale_t dataset)
 	}
 	}
 	return r;
 	return r;
 }
 }
-
+libc_hidden_proto(duplocale)
-weak_alias(__duplocale, duplocale)
+libc_hidden_def(duplocale)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
@@ -1341,7 +1350,7 @@ weak_alias(__duplocale, duplocale)
 #warning REMINDER: When we allocate ctype tables, remember to free them.
 #warning REMINDER: When we allocate ctype tables, remember to free them.
 #endif
 #endif
 
 
-void __freelocale(__locale_t dataset)
+void freelocale(__locale_t dataset)
 {
 {
 	assert(dataset != __global_locale);
 	assert(dataset != __global_locale);
 	assert(dataset != LC_GLOBAL_LOCALE);
 	assert(dataset != LC_GLOBAL_LOCALE);
@@ -1350,13 +1359,11 @@ void __freelocale(__locale_t dataset)
 	free(dataset);				/* Free locale */
 	free(dataset);				/* Free locale */
 }
 }
 
 
-weak_alias(__freelocale, freelocale)
-
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_uselocale
 #ifdef L_uselocale
 
 
-__locale_t attribute_hidden __uselocale(__locale_t dataset)
+__locale_t uselocale(__locale_t dataset)
 {
 {
 	__locale_t old;
 	__locale_t old;
 
 
@@ -1379,8 +1386,8 @@ __locale_t attribute_hidden __uselocale(__locale_t dataset)
 	}
 	}
 	return old;
 	return old;
 }
 }
-
+libc_hidden_proto(uselocale)
-weak_alias(__uselocale, uselocale)
+libc_hidden_def(uselocale)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/

+ 25 - 12
libc/misc/mntent/mntent.c

@@ -1,14 +1,24 @@
-#define strtok_r __strtok_r
+/*
-#define strstr __strstr
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-#define atoi __atoi
+ *
-#define fseek __fseek
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#define fgets __fgets
+ */
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
 #include <mntent.h>
 #include <mntent.h>
 
 
+libc_hidden_proto(strstr)
+libc_hidden_proto(strtok_r)
+libc_hidden_proto(atoi)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(fseek)
+libc_hidden_proto(fgets)
+libc_hidden_proto(abort)
+libc_hidden_proto(fprintf)
+
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 # include <pthread.h>
 # include <pthread.h>
 static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
@@ -17,7 +27,7 @@ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
 #define UNLOCK	__pthread_mutex_unlock(&mylock)
 #define UNLOCK	__pthread_mutex_unlock(&mylock)
 
 
 /* Reentrant version of getmntent.  */
 /* Reentrant version of getmntent.  */
-struct mntent attribute_hidden *__getmntent_r (FILE *filep, 
+struct mntent *getmntent_r (FILE *filep, 
 	struct mntent *mnt, char *buff, int bufsize)
 	struct mntent *mnt, char *buff, int bufsize)
 {
 {
 	char *cp, *ptrptr;
 	char *cp, *ptrptr;
@@ -64,7 +74,8 @@ struct mntent attribute_hidden *__getmntent_r (FILE *filep,
 
 
 	return mnt;
 	return mnt;
 }
 }
-strong_alias(__getmntent_r,getmntent_r)
+libc_hidden_proto(getmntent_r)
+libc_hidden_def(getmntent_r)
 
 
 struct mntent *getmntent(FILE * filep)
 struct mntent *getmntent(FILE * filep)
 {
 {
@@ -79,7 +90,7 @@ struct mntent *getmntent(FILE * filep)
 		    abort();
 		    abort();
     }
     }
     
     
-    tmp = __getmntent_r(filep, &mnt, buff, BUFSIZ);
+    tmp = getmntent_r(filep, &mnt, buff, BUFSIZ);
     UNLOCK;
     UNLOCK;
     return(tmp);
     return(tmp);
 }
 }
@@ -101,16 +112,18 @@ char *hasmntopt(const struct mntent *mnt, const char *opt)
 	return strstr(mnt->mnt_opts, opt);
 	return strstr(mnt->mnt_opts, opt);
 }
 }
 
 
-FILE attribute_hidden *__setmntent(const char *name, const char *mode)
+FILE *setmntent(const char *name, const char *mode)
 {
 {
 	return fopen(name, mode);
 	return fopen(name, mode);
 }
 }
-strong_alias(__setmntent,setmntent)
+libc_hidden_proto(setmntent)
+libc_hidden_def(setmntent)
 
 
-int attribute_hidden __endmntent(FILE * filep)
+int endmntent(FILE * filep)
 {
 {
 	if (filep != NULL)
 	if (filep != NULL)
 		fclose(filep);
 		fclose(filep);
 	return 1;
 	return 1;
 }
 }
-strong_alias(__endmntent,endmntent)
+libc_hidden_proto(endmntent)
+libc_hidden_def(endmntent)

+ 3 - 2
libc/misc/regex/regcomp.c

@@ -835,8 +835,9 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
 
 
 #ifdef __UCLIBC_HAS_WCHAR__
 #ifdef __UCLIBC_HAS_WCHAR__
 # undef MB_CUR_MAX
 # undef MB_CUR_MAX
-# define	MB_CUR_MAX	(_stdlib_mb_cur_max_internal ())
+# define	MB_CUR_MAX	(_stdlib_mb_cur_max ())
-extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden;
+extern size_t _stdlib_mb_cur_max (void) __THROW __wur;
+libc_hidden_proto(_stdlib_mb_cur_max)
   dfa->mb_cur_max = MB_CUR_MAX;
   dfa->mb_cur_max = MB_CUR_MAX;
 #else
 #else
   dfa->mb_cur_max = 1;
   dfa->mb_cur_max = 1;

+ 37 - 32
libc/misc/regex/regex.c

@@ -23,6 +23,7 @@
 #endif
 #endif
 
 
 /* uClibc addons */
 /* uClibc addons */
+#define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
 
 
 #ifdef __UCLIBC__
 #ifdef __UCLIBC__
@@ -30,46 +31,50 @@
 #define _REGEX_RE_COMP
 #define _REGEX_RE_COMP
 #include <stdbool.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
 #ifdef __UCLIBC_HAS_WCHAR__
 #ifdef __UCLIBC_HAS_WCHAR__
 #define RE_ENABLE_I18N
 #define RE_ENABLE_I18N
-#define wcscoll __wcscoll
-#define wcrtomb __wcrtomb
-#define mbrtowc __mbrtowc
-#define iswctype __iswctype
-#define iswlower __iswlower
-#define iswalnum __iswalnum
-#define towlower __towlower
-#define towupper __towupper
-#define mbsinit __mbsinit
 #include <wchar.h>
 #include <wchar.h>
 #include <wctype.h>
 #include <wctype.h>
 
 
-/* attribute_hidden produces text relocation */
+#define __iswctype iswctype
-//extern int __wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __THROW /*attribute_hidden*/;
+#define __wcrtomb wcrtomb
+#define __btowc btowc
+#define __wctype wctype
+libc_hidden_proto(wcscoll)
+libc_hidden_proto(wcrtomb)
+libc_hidden_proto(mbrtowc)
+libc_hidden_proto(iswctype)
+libc_hidden_proto(iswlower)
+libc_hidden_proto(iswalnum)
+libc_hidden_proto(towlower)
+libc_hidden_proto(towupper)
+libc_hidden_proto(mbsinit)
+libc_hidden_proto(btowc)
+libc_hidden_proto(wctype)
 
 
-extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc,
-		       mbstate_t *__restrict __ps) attribute_hidden;
-
-extern wint_t __btowc (int __c) attribute_hidden;
-
-extern wctype_t __wctype (__const char *__property) attribute_hidden;
-
-//extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
 #endif
 #endif
 
 
-#define memcmp __memcmp
+#include <ctype.h>
-#define memcpy __memcpy
+#define __toupper toupper
-#define memmove __memmove
+#define __tolower tolower
-#define memset __memset
+#define __mempcpy mempcpy
-#define strchr __strchr
+libc_hidden_proto(toupper)
-#define strcmp __strcmp
+libc_hidden_proto(tolower)
-#define strlen __strlen
+libc_hidden_proto(memcmp)
-#define strncpy __strncpy
+libc_hidden_proto(memcpy)
-#define getenv __getenv
+libc_hidden_proto(memmove)
-#define strcasecmp __strcasecmp
+libc_hidden_proto(memset)
-
+libc_hidden_proto(strchr)
-extern void *__mempcpy (void *__restrict __dest,
+libc_hidden_proto(strcmp)
-			__const void *__restrict __src, size_t __n) attribute_hidden;
+libc_hidden_proto(strlen)
+libc_hidden_proto(strncpy)
+libc_hidden_proto(getenv)
+libc_hidden_proto(strcasecmp)
+libc_hidden_proto(mempcpy)
+libc_hidden_proto(abort)
+
 #endif
 #endif
 
 
 /* Make sure noone compiles this code with a C++ compiler.  */
 /* Make sure noone compiles this code with a C++ compiler.  */

+ 25 - 24
libc/misc/regex/regex_old.c

@@ -20,37 +20,29 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define HAVE_MEMPCPY
-#define memset __memset
-#define memcmp __memcmp
-#define strcmp __strcmp
-#define strlen __strlen
-#define wcslen __wcslen
-/* for some reason this does not work */
-#define memcpy __memcpy
-#define mbrtowc __mbrtowc
-#define wcrtomb __wcrtomb
-#define wcscoll __wcscoll
-#define wctype __wctype
-#define iswctype __iswctype
-#define iswalnum __iswalnum
-#define printf __printf
-#define btowc __btowc
-
 /* To exclude some unwanted junk.... */
 /* To exclude some unwanted junk.... */
 #undef emacs
 #undef emacs
-#define _REGEX_RE_COMP
+#define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
 #ifdef __UCLIBC__
 #ifdef __UCLIBC__
 # undef _LIBC
 # undef _LIBC
+# define _REGEX_RE_COMP
+# define HAVE_MEMPCPY
+# define STDC_HEADERS
+# define RE_TRANSLATE_TYPE char *
 #endif
 #endif
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
-#define STDC_HEADERS
+#include <stdio.h>
-#define RE_TRANSLATE_TYPE char *
 
 
-extern void *__mempcpy (void *__restrict __dest,
+libc_hidden_proto(memset)
-			__const void *__restrict __src, size_t __n) /*attribute_hidden*/;
+libc_hidden_proto(memcmp)
+libc_hidden_proto(memcpy)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strlen)
+libc_hidden_proto(printf)
+libc_hidden_proto(mempcpy)
+libc_hidden_proto(abort)
 
 
 /* AIX requires this to be the first thing in the file. */
 /* AIX requires this to be the first thing in the file. */
 #if defined _AIX && !defined REGEX_MALLOC
 #if defined _AIX && !defined REGEX_MALLOC
@@ -89,6 +81,15 @@ extern void *__mempcpy (void *__restrict __dest,
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
 #  include <wchar.h>
 #  include <wchar.h>
 #  include <wctype.h>
 #  include <wctype.h>
+libc_hidden_proto(wcslen)
+libc_hidden_proto(mbrtowc)
+libc_hidden_proto(wcrtomb)
+libc_hidden_proto(wcscoll)
+libc_hidden_proto(wctype)
+libc_hidden_proto(iswctype)
+libc_hidden_proto(iswalnum)
+libc_hidden_proto(btowc)
+
 # endif
 # endif
 
 
 # if defined _LIBC || defined __UCLIBC__
 # if defined _LIBC || defined __UCLIBC__
@@ -113,10 +114,10 @@ extern void *__mempcpy (void *__restrict __dest,
 	__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
 	__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
 #  define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
 #  define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
 
 
+# ifndef __UCLIBC__
 #  define btowc __btowc
 #  define btowc __btowc
 
 
 /* We are also using some library internals.  */
 /* We are also using some library internals.  */
-# ifndef __UCLIBC__
 #  include <locale/localeinfo.h>
 #  include <locale/localeinfo.h>
 #  include <locale/elem-hash.h>
 #  include <locale/elem-hash.h>
 #  include <langinfo.h>
 #  include <langinfo.h>
@@ -8280,7 +8281,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
       if (msg_size > errbuf_size)
       if (msg_size > errbuf_size)
         {
         {
 #if defined HAVE_MEMPCPY || defined _LIBC
 #if defined HAVE_MEMPCPY || defined _LIBC
-	  *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+	  *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
 #else
 #else
           memcpy (errbuf, msg, errbuf_size - 1);
           memcpy (errbuf, msg, errbuf_size - 1);
           errbuf[errbuf_size - 1] = 0;
           errbuf[errbuf_size - 1] = 0;

+ 4 - 4
libc/misc/search/hsearch.c

@@ -17,16 +17,16 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define hdestroy_r __hdestroy_r
-#define hsearch_r __hsearch_r
-#define hcreate_r __hcreate_r
-
 #ifndef _GNU_SOURCE
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
 #endif
 
 
 #include <search.h>
 #include <search.h>
 
 
+libc_hidden_proto(hdestroy_r)
+libc_hidden_proto(hsearch_r)
+libc_hidden_proto(hcreate_r)
+
 /* The non-reentrant version use a global space for storing the table.  */
 /* The non-reentrant version use a global space for storing the table.  */
 static struct hsearch_data htab;
 static struct hsearch_data htab;
 
 

Some files were not shown because too many files changed in this diff