Peter S. Mazinger пре 18 година
родитељ
комит
53b5f21c9c
66 измењених фајлова са 362 додато и 149 уклоњено
  1. 7 2
      libc/inet/getaddrinfo.c
  2. 19 14
      libc/inet/getproto.c
  3. 2 0
      libc/inet/hostid.c
  4. 47 14
      libc/inet/resolv.c
  5. 2 0
      libc/inet/rpc/auth_unix.c
  6. 2 0
      libc/inet/rpc/clnt_generic.c
  7. 1 0
      libc/inet/rpc/clnt_raw.c
  8. 1 0
      libc/inet/rpc/clnt_simple.c
  9. 1 0
      libc/inet/rpc/clnt_tcp.c
  10. 1 1
      libc/inet/rpc/clnt_udp.c
  11. 1 0
      libc/inet/rpc/clnt_unix.c
  12. 1 0
      libc/inet/rpc/getrpcport.c
  13. 4 0
      libc/inet/rpc/rcmd.c
  14. 4 0
      libc/inet/rpc/rexec.c
  15. 3 2
      libc/inet/rpc/rpc_prot.c
  16. 1 0
      libc/inet/rpc/ruserpass.c
  17. 1 0
      libc/inet/rpc/svc_tcp.c
  18. 1 0
      libc/inet/rpc/svc_udp.c
  19. 1 0
      libc/inet/rpc/svc_unix.c
  20. 5 2
      libc/inet/socketcalls.c
  21. 1 0
      libc/misc/ftw/ftw.c
  22. 7 4
      libc/misc/mntent/mntent.c
  23. 1 0
      libc/misc/regex/regex.c
  24. 1 0
      libc/misc/regex/regex_old.c
  25. 11 4
      libc/misc/statfs/internal_statvfs.c
  26. 7 5
      libc/misc/time/time.c
  27. 21 26
      libc/misc/utmp/utent.c
  28. 1 0
      libc/misc/wchar/wstdio.c
  29. 2 0
      libc/misc/wordexp/wordexp.c
  30. 98 32
      libc/pwd_grp/pwd_grp.c
  31. 3 1
      libc/pwd_grp/pwd_grp_internal.c
  32. 2 0
      libc/stdio/scanf.c
  33. 2 1
      libc/stdio/ungetwc.c
  34. 1 0
      libc/stdio/vfprintf.c
  35. 3 2
      libc/stdlib/ptsname.c
  36. 1 0
      libc/stdlib/realpath.c
  37. 1 0
      libc/stdlib/stdlib.c
  38. 2 2
      libc/stdlib/unix_grantpt.c
  39. 2 2
      libc/sysdeps/linux/common/getcwd.c
  40. 2 0
      libc/sysdeps/linux/common/getdirname.c
  41. 5 2
      libc/sysdeps/linux/common/getdnnm.c
  42. 2 1
      libc/sysdeps/linux/common/getgroups.c
  43. 5 2
      libc/sysdeps/linux/common/gethstnm.c
  44. 2 1
      libc/sysdeps/linux/common/getpriority.c
  45. 2 1
      libc/sysdeps/linux/common/getsid.c
  46. 3 0
      libc/sysdeps/linux/common/nice.c
  47. 3 0
      libc/sysdeps/linux/common/setegid.c
  48. 5 1
      libc/sysdeps/linux/common/seteuid.c
  49. 2 1
      libc/sysdeps/linux/common/setgroups.c
  50. 2 1
      libc/sysdeps/linux/common/setpgid.c
  51. 2 0
      libc/sysdeps/linux/common/setpgrp.c
  52. 3 1
      libc/sysdeps/linux/common/setpriority.c
  53. 2 1
      libc/sysdeps/linux/common/setregid.c
  54. 2 1
      libc/sysdeps/linux/common/setresgid.c
  55. 2 1
      libc/sysdeps/linux/common/setresuid.c
  56. 2 1
      libc/sysdeps/linux/common/setreuid.c
  57. 3 1
      libc/sysdeps/linux/common/setsid.c
  58. 3 1
      libc/sysdeps/linux/common/uname.c
  59. 3 0
      libc/sysdeps/linux/powerpc/ioctl.c
  60. 2 2
      libc/termios/tcgetattr.c
  61. 3 0
      libc/termios/tcgetsid.c
  62. 2 1
      libc/termios/tcsetattr.c
  63. 16 7
      libc/termios/termios.c
  64. 9 8
      libc/termios/ttyname.c
  65. 1 0
      libc/unistd/daemon.c
  66. 2 0
      libc/unistd/getpass.c

+ 7 - 2
libc/inet/getaddrinfo.c

@@ -45,7 +45,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 /* This software is Copyright 1996 by Craig Metz, All Rights Reserved.  */
 /* This software is Copyright 1996 by Craig Metz, All Rights Reserved.  */
 
 
 #define getservbyname_r __getservbyname_r
 #define getservbyname_r __getservbyname_r
+#define gethostbyname_r __gethostbyname_r
+#define gethostbyname2_r __gethostbyname2_r
+#define gethostbyaddr_r __gethostbyaddr_r
 #if 0
 #if 0
+#define uname __uname
 #define stpcpy __stpcpy
 #define stpcpy __stpcpy
 /* strdupa is using these */
 /* strdupa is using these */
 #define memcpy __memcpy
 #define memcpy __memcpy
@@ -767,8 +771,8 @@ static struct gaih gaih[] =
     { PF_UNSPEC, NULL }
     { PF_UNSPEC, NULL }
 };
 };
 
 
-int
-getaddrinfo (const char *name, const char *service,
+int attribute_hidden
+__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;
@@ -866,6 +870,7 @@ getaddrinfo (const char *name, const char *service,
 
 
     return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME;
     return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME;
 }
 }
+strong_alias(__getaddrinfo,getaddrinfo)
 
 
 void
 void
 freeaddrinfo (struct addrinfo *ai)
 freeaddrinfo (struct addrinfo *ai)

+ 19 - 14
libc/inet/getproto.c

@@ -91,7 +91,7 @@ static void __initbuf(void)
     }
     }
 }
 }
 
 
-void setprotoent(int f)
+void attribute_hidden __setprotoent(int f)
 {
 {
     LOCK;
     LOCK;
     if (protof == NULL)
     if (protof == NULL)
@@ -101,8 +101,9 @@ void setprotoent(int f)
     proto_stayopen |= f;
     proto_stayopen |= f;
     UNLOCK;
     UNLOCK;
 }
 }
+strong_alias(__setprotoent,setprotoent)
 
 
-void endprotoent(void)
+void attribute_hidden __endprotoent(void)
 {
 {
     LOCK;
     LOCK;
     if (protof) {
     if (protof) {
@@ -112,8 +113,9 @@ void endprotoent(void)
     proto_stayopen = 0;
     proto_stayopen = 0;
     UNLOCK;
     UNLOCK;
 }
 }
+strong_alias(__endprotoent,endprotoent)
 
 
-int getprotoent_r(struct protoent *result_buf,
+int attribute_hidden __getprotoent_r(struct protoent *result_buf,
 		  char *buf, size_t buflen,
 		  char *buf, size_t buflen,
 		  struct protoent **result)
 		  struct protoent **result)
 {
 {
@@ -189,18 +191,19 @@ again:
     UNLOCK;
     UNLOCK;
     return 0;
     return 0;
 }
 }
+strong_alias(__getprotoent_r,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 getprotobyname_r(const char *name,
+int attribute_hidden __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)
@@ -209,8 +212,8 @@ int getprotobyname_r(const char *name,
     int ret;
     int ret;
 
 
     LOCK;
     LOCK;
-    setprotoent(proto_stayopen);
-    while (!(ret=getprotoent_r(result_buf, buf, buflen, result))) {
+    __setprotoent(proto_stayopen);
+    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++)
@@ -219,10 +222,11 @@ int getprotobyname_r(const char *name,
     }
     }
 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)
 
 
 
 
 struct protoent * getprotobyname(const char *name)
 struct protoent * getprotobyname(const char *name)
@@ -230,12 +234,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 getprotobynumber_r (int proto_num,
+int attribute_hidden __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)
@@ -243,22 +247,23 @@ int getprotobynumber_r (int proto_num,
     int ret;
     int ret;
 
 
     LOCK;
     LOCK;
-    setprotoent(proto_stayopen);
-    while (!(ret=getprotoent_r(result_buf, buf, buflen, result)))
+    __setprotoent(proto_stayopen);
+    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)
 
 
 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;
 }
 }

+ 2 - 0
libc/inet/hostid.c

@@ -1,5 +1,7 @@
 #define geteuid __geteuid
 #define geteuid __geteuid
 #define getuid __getuid
 #define getuid __getuid
+#define gethostbyname __gethostbyname
+#define gethostname __gethostname
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 47 - 14
libc/inet/resolv.c

@@ -138,6 +138,8 @@
 #define strstr __strstr
 #define strstr __strstr
 #define random __random
 #define random __random
 #define getservbyport __getservbyport
 #define getservbyport __getservbyport
+#define getdomainname __getdomainname
+#define uname __uname
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
@@ -159,6 +161,14 @@
 #include <sys/utsname.h>
 #include <sys/utsname.h>
 #include <sys/un.h>
 #include <sys/un.h>
 
 
+extern int __gethostbyname_r (__const char *__restrict __name,
+			    struct hostent *__restrict __result_buf,
+			    char *__restrict __buf, size_t __buflen,
+			    struct hostent **__restrict __result,
+			    int *__restrict __h_errnop) attribute_hidden;
+
+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
@@ -1069,7 +1079,7 @@ void attribute_hidden __close_nameservers(void)
 
 
 #ifdef L_gethostbyname
 #ifdef L_gethostbyname
 
 
-struct hostent *gethostbyname(const char *name)
+struct hostent attribute_hidden *__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) +
@@ -1077,18 +1087,29 @@ struct hostent *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)
 #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) +
@@ -1096,7 +1117,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__ */
@@ -1405,7 +1426,14 @@ int res_querydomain(name, domain, class, type, answer, anslen)
 #endif
 #endif
 
 
 #ifdef L_gethostbyaddr
 #ifdef L_gethostbyaddr
-struct hostent *gethostbyaddr (const void *addr, socklen_t len, int type)
+extern int __gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
+			    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[
@@ -1417,10 +1445,11 @@ struct hostent *gethostbyaddr (const void *addr, socklen_t len, int type)
 		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)
 #endif
 #endif
 
 
 
 
@@ -1706,7 +1735,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 getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
+int attribute_hidden __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)
 {
 {
@@ -1747,12 +1776,12 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
 			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) {
@@ -1892,12 +1921,13 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
 	errno = serrno;
 	errno = serrno;
 	return 0;
 	return 0;
 }
 }
+strong_alias(__getnameinfo,getnameinfo)
 #endif
 #endif
 
 
 
 
 #ifdef L_gethostbyname_r
 #ifdef L_gethostbyname_r
 
 
-int gethostbyname_r(const char * name,
+int attribute_hidden __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,
@@ -2046,18 +2076,19 @@ int 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)
 #endif
 #endif
 
 
 #ifdef L_gethostbyname2_r
 #ifdef L_gethostbyname2_r
 
 
-int gethostbyname2_r(const char *name, int family,
+int attribute_hidden __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;
@@ -2070,7 +2101,7 @@ int 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;
@@ -2188,10 +2219,11 @@ int 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)
 #endif
 #endif
 
 
 #ifdef L_gethostbyaddr_r
 #ifdef L_gethostbyaddr_r
-int gethostbyaddr_r (const void *addr, socklen_t len, int type,
+int attribute_hidden __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,
@@ -2372,6 +2404,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type,
 	*h_errnop = NETDB_SUCCESS;
 	*h_errnop = NETDB_SUCCESS;
 	return NETDB_SUCCESS;
 	return NETDB_SUCCESS;
 }
 }
+strong_alias(__gethostbyaddr_r,gethostbyaddr_r)
 #endif
 #endif
 
 
 #ifdef L_res_comp
 #ifdef L_res_comp

+ 2 - 0
libc/inet/rpc/auth_unix.c

@@ -41,6 +41,8 @@
 #define sysconf __sysconf
 #define sysconf __sysconf
 #define getegid __getegid
 #define getegid __getegid
 #define geteuid __geteuid
 #define geteuid __geteuid
+#define getgroups __getgroups
+#define gethostname __gethostname
 #define xdrmem_create __xdrmem_create
 #define xdrmem_create __xdrmem_create
 #define xdr_authunix_parms __xdr_authunix_parms
 #define xdr_authunix_parms __xdr_authunix_parms
 #define xdr_opaque_auth __xdr_opaque_auth
 #define xdr_opaque_auth __xdr_opaque_auth

+ 2 - 0
libc/inet/rpc/clnt_generic.c

@@ -33,6 +33,8 @@
 #define clnttcp_create __clnttcp_create
 #define clnttcp_create __clnttcp_create
 #define clntudp_create __clntudp_create
 #define clntudp_create __clntudp_create
 #define clntunix_create __clntunix_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>

+ 1 - 0
libc/inet/rpc/clnt_raw.c

@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
 #define xdr_replymsg __xdr_replymsg
 #define xdr_replymsg __xdr_replymsg
 #define xdr_opaque_auth __xdr_opaque_auth
 #define xdr_opaque_auth __xdr_opaque_auth
 #define svc_getreq __svc_getreq
 #define svc_getreq __svc_getreq
+#define _seterr_reply __seterr_reply
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 1 - 0
libc/inet/rpc/clnt_simple.c

@@ -39,6 +39,7 @@ static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro";
  */
  */
 
 
 #define clntudp_create __clntudp_create
 #define clntudp_create __clntudp_create
+#define gethostbyname_r __gethostbyname_r
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 1 - 0
libc/inet/rpc/clnt_tcp.c

@@ -59,6 +59,7 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
 #define xdr_opaque_auth __xdr_opaque_auth
 #define xdr_opaque_auth __xdr_opaque_auth
 #define xdrmem_create __xdrmem_create
 #define xdrmem_create __xdrmem_create
 #define pmap_getport __pmap_getport
 #define pmap_getport __pmap_getport
+#define _seterr_reply __seterr_reply
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 1 - 1
libc/inet/rpc/clnt_udp.c

@@ -45,8 +45,8 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
 #define xdr_callhdr __xdr_callhdr
 #define xdr_callhdr __xdr_callhdr
 #define xdr_replymsg __xdr_replymsg
 #define xdr_replymsg __xdr_replymsg
 #define xdr_opaque_auth __xdr_opaque_auth
 #define xdr_opaque_auth __xdr_opaque_auth
-
 #define pmap_getport __pmap_getport
 #define pmap_getport __pmap_getport
+#define _seterr_reply __seterr_reply
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 1 - 0
libc/inet/rpc/clnt_unix.c

@@ -56,6 +56,7 @@
 #define xdrmem_create __xdrmem_create
 #define xdrmem_create __xdrmem_create
 #define getegid __getegid
 #define getegid __getegid
 #define geteuid __geteuid
 #define geteuid __geteuid
+#define _seterr_reply __seterr_reply
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 1 - 0
libc/inet/rpc/getrpcport.c

@@ -36,6 +36,7 @@ static  char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI";
  */
  */
 
 
 #define pmap_getport __pmap_getport
 #define pmap_getport __pmap_getport
+#define gethostbyname_r __gethostbyname_r
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 4 - 0
libc/inet/rpc/rcmd.c

@@ -39,6 +39,10 @@ static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";
 #define sysconf __sysconf
 #define sysconf __sysconf
 #define getline __getline
 #define getline __getline
 #define geteuid __geteuid
 #define geteuid __geteuid
+#define seteuid __seteuid
+#define getpwnam_r __getpwnam_r
+#define gethostbyname __gethostbyname
+#define gethostbyname_r __gethostbyname_r
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 4 - 0
libc/inet/rpc/rexec.c

@@ -27,6 +27,10 @@
  * SUCH DAMAGE.
  * SUCH DAMAGE.
  */
  */
 
 
+#define getnameinfo __getnameinfo
+#define getaddrinfo __getaddrinfo
+#define getsockname __getsockname
+
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>
 #include <sys/types.h>
 #include <sys/types.h>

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

@@ -240,8 +240,8 @@ rejected (enum reject_stat rjct_stat,
 /*
 /*
  * given a reply message, fills in the error
  * given a reply message, fills in the error
  */
  */
-void
-_seterr_reply (struct rpc_msg *msg,
+void attribute_hidden
+__seterr_reply (struct rpc_msg *msg,
 	       struct rpc_err *error)
 	       struct rpc_err *error)
 {
 {
   /* optimized for normal, SUCCESSful case */
   /* optimized for normal, SUCCESSful case */
@@ -285,3 +285,4 @@ _seterr_reply (struct rpc_msg *msg,
       break;
       break;
     }
     }
 }
 }
+strong_alias(__seterr_reply,_seterr_reply)

+ 1 - 0
libc/inet/rpc/ruserpass.c

@@ -32,6 +32,7 @@
 #define getuid __getuid
 #define getuid __getuid
 #define getegid __getegid
 #define getegid __getegid
 #define geteuid __geteuid
 #define geteuid __geteuid
+#define gethostname __gethostname
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 1 - 0
libc/inet/rpc/svc_tcp.c

@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 #define xdr_callmsg __xdr_callmsg
 #define xdr_callmsg __xdr_callmsg
 #define xdr_replymsg __xdr_replymsg
 #define xdr_replymsg __xdr_replymsg
 #define xprt_register __xprt_register
 #define xprt_register __xprt_register
+#define getsockname __getsockname
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE

+ 1 - 0
libc/inet/rpc/svc_udp.c

@@ -43,6 +43,7 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
 #define xdrmem_create __xdrmem_create
 #define xdrmem_create __xdrmem_create
 #define xdr_callmsg __xdr_callmsg
 #define xdr_callmsg __xdr_callmsg
 #define xdr_replymsg __xdr_replymsg
 #define xdr_replymsg __xdr_replymsg
+#define getsockname __getsockname
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #define _GNU_SOURCE

+ 1 - 0
libc/inet/rpc/svc_unix.c

@@ -46,6 +46,7 @@
 #define xprt_register __xprt_register
 #define xprt_register __xprt_register
 #define getegid __getegid
 #define getegid __getegid
 #define geteuid __geteuid
 #define geteuid __geteuid
+#define getsockname __getsockname
 
 
 #define __FORCE_GLIBC
 #define __FORCE_GLIBC
 #include <features.h>
 #include <features.h>

+ 5 - 2
libc/inet/socketcalls.c

@@ -98,9 +98,11 @@ int getpeername(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
 
 
 #ifdef L_getsockname
 #ifdef L_getsockname
 #ifdef __NR_getsockname
 #ifdef __NR_getsockname
-_syscall3(int, getsockname, int, sockfd, struct sockaddr *, addr, socklen_t *,paddrlen);
+#define __NR___getsockname __NR_getsockname
+attribute_hidden _syscall3(int, __getsockname, int, sockfd, struct sockaddr *, addr, socklen_t *,paddrlen);
+strong_alias(__getsockname,getsockname)
 #elif defined(__NR_socketcall)
 #elif defined(__NR_socketcall)
-int getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
+int attribute_hidden __getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
 {
 {
 	unsigned long args[3];
 	unsigned long args[3];
 
 
@@ -109,6 +111,7 @@ int getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
 	args[2] = (unsigned long) paddrlen;
 	args[2] = (unsigned long) paddrlen;
 	return __socketcall(SYS_GETSOCKNAME, args);
 	return __socketcall(SYS_GETSOCKNAME, args);
 }
 }
+strong_alias(__getsockname,getsockname)
 #endif
 #endif
 #endif
 #endif
 
 

+ 1 - 0
libc/misc/ftw/ftw.c

@@ -26,6 +26,7 @@
 #define tsearch __tsearch
 #define tsearch __tsearch
 #define tdestroy __tdestroy
 #define tdestroy __tdestroy
 #define fchdir __fchdir
 #define fchdir __fchdir
+#define getcwd __getcwd
 
 
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>

+ 7 - 4
libc/misc/mntent/mntent.c

@@ -14,7 +14,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 *getmntent_r (FILE *filep, 
+struct mntent attribute_hidden *__getmntent_r (FILE *filep, 
 	struct mntent *mnt, char *buff, int bufsize)
 	struct mntent *mnt, char *buff, int bufsize)
 {
 {
 	char *cp, *ptrptr;
 	char *cp, *ptrptr;
@@ -61,6 +61,7 @@ struct mntent *getmntent_r (FILE *filep,
 
 
 	return mnt;
 	return mnt;
 }
 }
+strong_alias(__getmntent_r,getmntent_r)
 
 
 struct mntent *getmntent(FILE * filep)
 struct mntent *getmntent(FILE * filep)
 {
 {
@@ -75,7 +76,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);
 }
 }
@@ -97,14 +98,16 @@ char *hasmntopt(const struct mntent *mnt, const char *opt)
 	return strstr(mnt->mnt_opts, opt);
 	return strstr(mnt->mnt_opts, opt);
 }
 }
 
 
-FILE *setmntent(const char *name, const char *mode)
+FILE attribute_hidden *__setmntent(const char *name, const char *mode)
 {
 {
 	return fopen(name, mode);
 	return fopen(name, mode);
 }
 }
+strong_alias(__setmntent,setmntent)
 
 
-int endmntent(FILE * filep)
+int attribute_hidden __endmntent(FILE * filep)
 {
 {
 	if (filep != NULL)
 	if (filep != NULL)
 		fclose(filep);
 		fclose(filep);
 	return 1;
 	return 1;
 }
 }
+strong_alias(__endmntent,endmntent)

+ 1 - 0
libc/misc/regex/regex.c

@@ -33,6 +33,7 @@
 #ifdef __UCLIBC_HAS_WCHAR__
 #ifdef __UCLIBC_HAS_WCHAR__
 #define RE_ENABLE_I18N
 #define RE_ENABLE_I18N
 #define wcscoll __wcscoll
 #define wcscoll __wcscoll
+#define wcrtomb __wcrtomb
 #define mbrtowc __mbrtowc
 #define mbrtowc __mbrtowc
 #define iswctype __iswctype
 #define iswctype __iswctype
 #define iswlower __iswlower
 #define iswlower __iswlower

+ 1 - 0
libc/misc/regex/regex_old.c

@@ -29,6 +29,7 @@
 /* for some reason this does not work */
 /* for some reason this does not work */
 #define memcpy __memcpy
 #define memcpy __memcpy
 #define mbrtowc __mbrtowc
 #define mbrtowc __mbrtowc
+#define wcrtomb __wcrtomb
 #define wcscoll __wcscoll
 #define wcscoll __wcscoll
 #define iswctype __iswctype
 #define iswctype __iswctype
 #define iswalnum __iswalnum
 #define iswalnum __iswalnum

+ 11 - 4
libc/misc/statfs/internal_statvfs.c

@@ -17,6 +17,13 @@
    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.  */
 
 
+extern FILE *__setmntent (__const char *__file, __const char *__mode) __THROW attribute_hidden;
+extern struct mntent *__getmntent_r (FILE *__restrict __stream,
+				   struct mntent *__restrict __result,
+				   char *__restrict __buffer,
+				   int __bufsize) __THROW attribute_hidden;
+extern int __endmntent (FILE *__stream) __THROW attribute_hidden;
+
   /* Now fill in the fields we have information for.  */
   /* Now fill in the fields we have information for.  */
   buf->f_bsize = fsbuf.f_bsize;
   buf->f_bsize = fsbuf.f_bsize;
   /* Linux does not support f_frsize, so set it to the full block size.  */
   /* Linux does not support f_frsize, so set it to the full block size.  */
@@ -57,15 +64,15 @@
       struct mntent mntbuf;
       struct mntent mntbuf;
       FILE *mtab;
       FILE *mtab;
 
 
-      mtab = setmntent ("/proc/mounts", "r");
+      mtab = __setmntent ("/proc/mounts", "r");
       if (mtab == NULL)
       if (mtab == NULL)
-	mtab = setmntent (_PATH_MOUNTED, "r");
+	mtab = __setmntent (_PATH_MOUNTED, "r");
 
 
       if (mtab != NULL)
       if (mtab != NULL)
 	{
 	{
 	  char tmpbuf[1024];
 	  char tmpbuf[1024];
 
 
-	  while (getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf)))
+	  while (__getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf)))
 	    {
 	    {
 	      struct stat fsst;
 	      struct stat fsst;
 
 
@@ -102,7 +109,7 @@
 	    }
 	    }
 
 
 	  /* Close the file.  */
 	  /* Close the file.  */
-	  endmntent (mtab);
+	  __endmntent (mtab);
 	}
 	}
 
 
       __set_errno (save_errno);
       __set_errno (save_errno);

+ 7 - 5
libc/misc/time/time.c

@@ -145,6 +145,8 @@
 #include <locale.h>
 #include <locale.h>
 #include <bits/uClibc_uintmaxtostr.h>
 #include <bits/uClibc_uintmaxtostr.h>
 
 
+extern void __tzset (void) __THROW attribute_hidden;
+
 #ifdef __UCLIBC_HAS_XLOCALE__
 #ifdef __UCLIBC_HAS_XLOCALE__
 #include <xlocale.h>
 #include <xlocale.h>
 extern int __strncasecmp_l (__const char *__s1, __const char *__s2,
 extern int __strncasecmp_l (__const char *__s1, __const char *__s2,
@@ -563,7 +565,7 @@ struct tm attribute_hidden *__localtime_r(register const time_t *__restrict time
 {
 {
 	TZLOCK;
 	TZLOCK;
 
 
-	tzset();
+	__tzset();
 
 
 	__time_localtime_tzi(timer, result, _time_tzinfo);
 	__time_localtime_tzi(timer, result, _time_tzinfo);
 
 
@@ -989,7 +991,7 @@ size_t attribute_hidden __UCXL(strftime)(char *__restrict s, size_t maxsize,
 	unsigned char mod;
 	unsigned char mod;
 	unsigned char code;
 	unsigned char code;
 
 
-	tzset();					/* We'll, let's get this out of the way. */
+	__tzset();					/* We'll, let's get this out of the way. */
 
 
 	lvl = 0;
 	lvl = 0;
 	p = format;
 	p = format;
@@ -1800,7 +1802,7 @@ static char *read_TZ_file(char *buf)
 
 
 #endif /* __UCLIBC_HAS_TZ_FILE__ */
 #endif /* __UCLIBC_HAS_TZ_FILE__ */
 
 
-void tzset(void)
+void attribute_hidden __tzset(void)
 {
 {
 	register const char *e;
 	register const char *e;
 	register char *s;
 	register char *s;
@@ -1987,7 +1989,7 @@ void tzset(void)
 #endif
 #endif
 	TZUNLOCK;
 	TZUNLOCK;
 }
 }
-
+strong_alias(__tzset,tzset)
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
 /*  #ifdef L_utime */
 /*  #ifdef L_utime */
@@ -2189,7 +2191,7 @@ time_t attribute_hidden _time_mktime(struct tm *timeptr, int store_on_success)
 
 
 	TZLOCK;
 	TZLOCK;
 
 
-	tzset();
+	__tzset();
 
 
 	t = _time_mktime_tzi(timeptr, store_on_success, _time_tzinfo);
 	t = _time_mktime_tzi(timeptr, store_on_success, _time_tzinfo);
 
 

+ 21 - 26
libc/misc/utmp/utent.c

@@ -37,29 +37,7 @@ static struct utmp static_utmp;
 static const char default_file_name[] = _PATH_UTMP;
 static const char default_file_name[] = _PATH_UTMP;
 static const char *static_ut_name = (const char *) default_file_name;
 static const char *static_ut_name = (const char *) default_file_name;
 
 
-
-
-static struct utmp *__getutent(int utmp_fd)
-
-{
-    if (utmp_fd == -1) {
-	setutent();
-    }
-    if (utmp_fd == -1) {
-	return NULL;
-    }
-
-    LOCK;
-    if (__read(utmp_fd, (char *) &static_utmp, sizeof(struct utmp)) != sizeof(struct utmp)) 
-    {
-	return NULL;
-    }
-
-    UNLOCK;
-    return &static_utmp;
-}
-
-void setutent(void)
+void attribute_hidden __setutent(void)
 {
 {
     int ret;
     int ret;
 
 
@@ -87,6 +65,26 @@ bummer:
     UNLOCK;
     UNLOCK;
     return;
     return;
 }
 }
+strong_alias(__setutent,setutent)
+
+static struct utmp *__getutent(int utmp_fd)
+{
+    if (utmp_fd == -1) {
+	__setutent();
+    }
+    if (utmp_fd == -1) {
+	return NULL;
+    }
+
+    LOCK;
+    if (__read(utmp_fd, (char *) &static_utmp, sizeof(struct utmp)) != sizeof(struct utmp)) 
+    {
+	return NULL;
+    }
+
+    UNLOCK;
+    return &static_utmp;
+}
 
 
 void endutent(void)
 void endutent(void)
 {
 {
@@ -148,8 +146,6 @@ struct utmp *getutline(const struct utmp *utmp_entry)
     return NULL;
     return NULL;
 }
 }
 
 
-extern struct utmp *__getutid (__const struct utmp *__id) attribute_hidden;
-
 struct utmp *pututline (const struct utmp *utmp_entry)
 struct utmp *pututline (const struct utmp *utmp_entry)
 {
 {
     LOCK;
     LOCK;
@@ -190,4 +186,3 @@ int utmpname (const char *new_ut_name)
     UNLOCK;
     UNLOCK;
     return 0;
     return 0;
 }
 }
-

+ 1 - 0
libc/misc/wchar/wstdio.c

@@ -52,6 +52,7 @@
 #define wcslen __wcslen
 #define wcslen __wcslen
 #define wcsrtombs __wcsrtombs
 #define wcsrtombs __wcsrtombs
 #define mbrtowc __mbrtowc
 #define mbrtowc __mbrtowc
+#define wcrtomb __wcrtomb
 
 
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdio.h>

+ 2 - 0
libc/misc/wordexp/wordexp.c

@@ -27,6 +27,8 @@
 #define waitpid __waitpid
 #define waitpid __waitpid
 #define kill __kill
 #define kill __kill
 #define getuid __getuid
 #define getuid __getuid
+#define getpwnam_r __getpwnam_r
+#define getpwuid_r __getpwuid_r
 #define execve __execve
 #define execve __execve
 #define dup2 __dup2
 #define dup2 __dup2
 
 

+ 98 - 32
libc/pwd_grp/pwd_grp.c

@@ -18,6 +18,8 @@
  *
  *
  */
  */
 
 
+#define setgroups __setgroups
+
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -38,6 +40,15 @@
 #include <pthread.h>
 #include <pthread.h>
 #endif
 #endif
 
 
+extern int __getspnam_r (__const char *__name, struct spwd *__result_buf,
+		       char *__buffer, size_t __buflen,
+		       struct spwd **__result) attribute_hidden;
+
+extern int __getpwuid_r (__uid_t __uid,
+		       struct passwd *__restrict __resultbuf,
+		       char *__restrict __buffer, size_t __buflen,
+		       struct passwd **__restrict __result) attribute_hidden;
+
 /**********************************************************************/
 /**********************************************************************/
 /* Sizes for staticly allocated buffers. */
 /* Sizes for staticly allocated buffers. */
 
 
@@ -73,7 +84,7 @@ extern int __pgsreader(int (*__parserfunc)(void *d, char *line), void *data,
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_fgetpwent_r
 #ifdef L_fgetpwent_r
 
 
-int fgetpwent_r(FILE *__restrict stream, struct passwd *__restrict resultbuf,
+int attribute_hidden __fgetpwent_r(FILE *__restrict stream, struct passwd *__restrict resultbuf,
 				char *__restrict buffer, size_t buflen,
 				char *__restrict buffer, size_t buflen,
 				struct passwd **__restrict result)
 				struct passwd **__restrict result)
 {
 {
@@ -87,12 +98,13 @@ int fgetpwent_r(FILE *__restrict stream, struct passwd *__restrict resultbuf,
 
 
 	return rv;
 	return rv;
 }
 }
+strong_alias(__fgetpwent_r,fgetpwent_r)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_fgetgrent_r
 #ifdef L_fgetgrent_r
 
 
-int fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
+int attribute_hidden __fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
 				char *__restrict buffer, size_t buflen,
 				char *__restrict buffer, size_t buflen,
 				struct group **__restrict result)
 				struct group **__restrict result)
 {
 {
@@ -106,12 +118,13 @@ int fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
 
 
 	return rv;
 	return rv;
 }
 }
+strong_alias(__fgetgrent_r,fgetgrent_r)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_fgetspent_r
 #ifdef L_fgetspent_r
 
 
-int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
+int attribute_hidden __fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
 				char *__restrict buffer, size_t buflen,
 				char *__restrict buffer, size_t buflen,
 				struct spwd **__restrict result)
 				struct spwd **__restrict result)
 {
 {
@@ -125,6 +138,7 @@ int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
 
 
 	return rv;
 	return rv;
 }
 }
+strong_alias(__fgetspent_r,fgetspent_r)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
@@ -134,13 +148,18 @@ int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_fgetpwent
 #ifdef L_fgetpwent
 
 
+extern int __fgetpwent_r (FILE *__restrict __stream,
+			struct passwd *__restrict __resultbuf,
+			char *__restrict __buffer, size_t __buflen,
+			struct passwd **__restrict __result) attribute_hidden;
+
 struct passwd *fgetpwent(FILE *stream)
 struct passwd *fgetpwent(FILE *stream)
 {
 {
 	static char buffer[PWD_BUFFER_SIZE];
 	static char buffer[PWD_BUFFER_SIZE];
 	static struct passwd resultbuf;
 	static struct passwd resultbuf;
 	struct passwd *result;
 	struct passwd *result;
 
 
-	fgetpwent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
+	__fgetpwent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -148,13 +167,18 @@ struct passwd *fgetpwent(FILE *stream)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_fgetgrent
 #ifdef L_fgetgrent
 
 
+extern int __fgetgrent_r (FILE *__restrict __stream,
+			struct group *__restrict __resultbuf,
+			char *__restrict __buffer, size_t __buflen,
+			struct group **__restrict __result) attribute_hidden;
+
 struct group *fgetgrent(FILE *stream)
 struct group *fgetgrent(FILE *stream)
 {
 {
 	static char buffer[GRP_BUFFER_SIZE];
 	static char buffer[GRP_BUFFER_SIZE];
 	static struct group resultbuf;
 	static struct group resultbuf;
 	struct group *result;
 	struct group *result;
 
 
-	fgetgrent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
+	__fgetgrent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -162,13 +186,17 @@ struct group *fgetgrent(FILE *stream)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_fgetspent
 #ifdef L_fgetspent
 
 
+extern int __fgetspent_r (FILE *__stream, struct spwd *__result_buf,
+			char *__buffer, size_t __buflen,
+			struct spwd **__result) attribute_hidden;
+
 struct spwd *fgetspent(FILE *stream)
 struct spwd *fgetspent(FILE *stream)
 {
 {
 	static char buffer[PWD_BUFFER_SIZE];
 	static char buffer[PWD_BUFFER_SIZE];
 	static struct spwd resultbuf;
 	static struct spwd resultbuf;
 	struct spwd *result;
 	struct spwd *result;
 
 
-	fgetspent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
+	__fgetspent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -176,7 +204,7 @@ struct spwd *fgetspent(FILE *stream)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_sgetspent_r
 #ifdef L_sgetspent_r
 
 
-int sgetspent_r(const char *string, struct spwd *result_buf,
+int attribute_hidden __sgetspent_r(const char *string, struct spwd *result_buf,
 				char *buffer, size_t buflen, struct spwd **result)
 				char *buffer, size_t buflen, struct spwd **result)
 {
 {
 	int rv = ERANGE;
 	int rv = ERANGE;
@@ -203,6 +231,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
  DONE:
  DONE:
 	return rv;
 	return rv;
 }
 }
+strong_alias(__sgetspent_r,sgetspent_r)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
@@ -212,9 +241,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
 #endif
 #endif
 
 
 #ifdef L_getpwnam_r
 #ifdef L_getpwnam_r
-#define GETXXKEY_R_FUNC			getpwnam_r
+#define GETXXKEY_R_FUNC_HIDDEN	__getpwnam_r
+#define GETXXKEY_R_FUNC		getpwnam_r
 #define GETXXKEY_R_PARSER   	__parsepwent
 #define GETXXKEY_R_PARSER   	__parsepwent
-#define GETXXKEY_R_ENTTYPE		struct passwd
+#define GETXXKEY_R_ENTTYPE	struct passwd
 #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->pw_name, key))
 #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->pw_name, key))
 #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict
 #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict
 #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD
 #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD
@@ -222,9 +252,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
 #endif
 #endif
 
 
 #ifdef L_getgrnam_r
 #ifdef L_getgrnam_r
-#define GETXXKEY_R_FUNC			getgrnam_r
+#define GETXXKEY_R_FUNC_HIDDEN	__getgrnam_r
+#define GETXXKEY_R_FUNC		getgrnam_r
 #define GETXXKEY_R_PARSER   	__parsegrent
 #define GETXXKEY_R_PARSER   	__parsegrent
-#define GETXXKEY_R_ENTTYPE		struct group
+#define GETXXKEY_R_ENTTYPE	struct group
 #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->gr_name, key))
 #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->gr_name, key))
 #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict
 #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
@@ -232,9 +263,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
 #endif
 #endif
 
 
 #ifdef L_getspnam_r
 #ifdef L_getspnam_r
-#define GETXXKEY_R_FUNC			getspnam_r
+#define GETXXKEY_R_FUNC_HIDDEN	__getspnam_r
+#define GETXXKEY_R_FUNC		getspnam_r
 #define GETXXKEY_R_PARSER   	__parsespent
 #define GETXXKEY_R_PARSER   	__parsespent
-#define GETXXKEY_R_ENTTYPE		struct spwd
+#define GETXXKEY_R_ENTTYPE	struct spwd
 #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->sp_namp, key))
 #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->sp_namp, key))
 #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict
 #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict
 #define DO_GETXXKEY_R_PATHNAME  _PATH_SHADOW
 #define DO_GETXXKEY_R_PATHNAME  _PATH_SHADOW
@@ -242,9 +274,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
 #endif
 #endif
 
 
 #ifdef L_getpwuid_r
 #ifdef L_getpwuid_r
-#define GETXXKEY_R_FUNC			getpwuid_r
+#define GETXXKEY_R_FUNC_HIDDEN	__getpwuid_r
+#define GETXXKEY_R_FUNC		getpwuid_r
 #define GETXXKEY_R_PARSER   	__parsepwent
 #define GETXXKEY_R_PARSER   	__parsepwent
-#define GETXXKEY_R_ENTTYPE		struct passwd
+#define GETXXKEY_R_ENTTYPE	struct passwd
 #define GETXXKEY_R_TEST(ENT)	((ENT)->pw_uid == key)
 #define GETXXKEY_R_TEST(ENT)	((ENT)->pw_uid == key)
 #define DO_GETXXKEY_R_KEYTYPE	uid_t
 #define DO_GETXXKEY_R_KEYTYPE	uid_t
 #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD
 #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD
@@ -252,9 +285,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
 #endif
 #endif
 
 
 #ifdef L_getgrgid_r
 #ifdef L_getgrgid_r
-#define GETXXKEY_R_FUNC			getgrgid_r
+#define GETXXKEY_R_FUNC_HIDDEN	__getgrgid_r
+#define GETXXKEY_R_FUNC		getgrgid_r
 #define GETXXKEY_R_PARSER   	__parsegrent
 #define GETXXKEY_R_PARSER   	__parsegrent
-#define GETXXKEY_R_ENTTYPE		struct group
+#define GETXXKEY_R_ENTTYPE	struct group
 #define GETXXKEY_R_TEST(ENT)	((ENT)->gr_gid == key)
 #define GETXXKEY_R_TEST(ENT)	((ENT)->gr_gid == key)
 #define DO_GETXXKEY_R_KEYTYPE	gid_t
 #define DO_GETXXKEY_R_KEYTYPE	gid_t
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
@@ -270,7 +304,7 @@ struct passwd *getpwuid(uid_t uid)
 	static struct passwd resultbuf;
 	static struct passwd resultbuf;
 	struct passwd *result;
 	struct passwd *result;
 
 
-	getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
+	__getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -278,13 +312,17 @@ struct passwd *getpwuid(uid_t uid)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_getgrgid
 #ifdef L_getgrgid
 
 
+extern int __getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
+		       char *__restrict __buffer, size_t __buflen,
+		       struct group **__restrict __result) attribute_hidden;
+
 struct group *getgrgid(gid_t gid)
 struct group *getgrgid(gid_t gid)
 {
 {
 	static char buffer[GRP_BUFFER_SIZE];
 	static char buffer[GRP_BUFFER_SIZE];
 	static struct group resultbuf;
 	static struct group resultbuf;
 	struct group *result;
 	struct group *result;
 
 
-	getgrgid_r(gid, &resultbuf, buffer, sizeof(buffer), &result);
+	__getgrgid_r(gid, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -306,8 +344,8 @@ int getspuid_r(uid_t uid, struct spwd *__restrict resultbuf,
 	char pwd_buff[PWD_BUFFER_SIZE];
 	char pwd_buff[PWD_BUFFER_SIZE];
 
 
 	*result = NULL;
 	*result = NULL;
-	if (!(rv = getpwuid_r(uid, &password, pwd_buff, sizeof(pwd_buff), &pp))) {
-		rv = getspnam_r(password.pw_name, resultbuf, buffer, buflen, result);
+	if (!(rv = __getpwuid_r(uid, &password, pwd_buff, sizeof(pwd_buff), &pp))) {
+		rv = __getspnam_r(password.pw_name, resultbuf, buffer, buflen, result);
 	}
 	}
 
 
 	return rv;
 	return rv;
@@ -334,13 +372,18 @@ struct spwd *getspuid(uid_t uid)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_getpwnam
 #ifdef L_getpwnam
 
 
+extern int __getpwnam_r (__const char *__restrict __name,
+		       struct passwd *__restrict __resultbuf,
+		       char *__restrict __buffer, size_t __buflen,
+		       struct passwd **__restrict __result) attribute_hidden;
+
 struct passwd *getpwnam(const char *name)
 struct passwd *getpwnam(const char *name)
 {
 {
 	static char buffer[PWD_BUFFER_SIZE];
 	static char buffer[PWD_BUFFER_SIZE];
 	static struct passwd resultbuf;
 	static struct passwd resultbuf;
 	struct passwd *result;
 	struct passwd *result;
 
 
-	getpwnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
+	__getpwnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -348,13 +391,18 @@ struct passwd *getpwnam(const char *name)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_getgrnam
 #ifdef L_getgrnam
 
 
+extern int __getgrnam_r (__const char *__restrict __name,
+		       struct group *__restrict __resultbuf,
+		       char *__restrict __buffer, size_t __buflen,
+		       struct group **__restrict __result) attribute_hidden;
+
 struct group *getgrnam(const char *name)
 struct group *getgrnam(const char *name)
 {
 {
 	static char buffer[GRP_BUFFER_SIZE];
 	static char buffer[GRP_BUFFER_SIZE];
 	static struct group resultbuf;
 	static struct group resultbuf;
 	struct group *result;
 	struct group *result;
 
 
-	getgrnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
+	__getgrnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -368,7 +416,7 @@ struct spwd *getspnam(const char *name)
 	static struct spwd resultbuf;
 	static struct spwd resultbuf;
 	struct spwd *result;
 	struct spwd *result;
 
 
-	getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
+	__getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -384,7 +432,7 @@ int getpw(uid_t uid, char *buf)
 
 
 	if (!buf) {
 	if (!buf) {
 		__set_errno(EINVAL);
 		__set_errno(EINVAL);
-	} else if (!getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result)) {
+	} else if (!__getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result)) {
 		if (sprintf(buf, "%s:%s:%lu:%lu:%s:%s:%s\n",
 		if (sprintf(buf, "%s:%s:%lu:%lu:%s:%s:%s\n",
 					resultbuf.pw_name, resultbuf.pw_passwd,
 					resultbuf.pw_name, resultbuf.pw_passwd,
 					(unsigned long)(resultbuf.pw_uid),
 					(unsigned long)(resultbuf.pw_uid),
@@ -434,7 +482,7 @@ void endpwent(void)
 }
 }
 
 
 
 
-int getpwent_r(struct passwd *__restrict resultbuf, 
+int attribute_hidden __getpwent_r(struct passwd *__restrict resultbuf, 
 			   char *__restrict buffer, size_t buflen,
 			   char *__restrict buffer, size_t buflen,
 			   struct passwd **__restrict result)
 			   struct passwd **__restrict result)
 {
 {
@@ -462,6 +510,7 @@ int getpwent_r(struct passwd *__restrict resultbuf,
 
 
 	return rv;
 	return rv;
 }
 }
+strong_alias(__getpwent_r,getpwent_r)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
@@ -488,7 +537,7 @@ void endgrent(void)
 	UNLOCK;
 	UNLOCK;
 }
 }
 
 
-int getgrent_r(struct group *__restrict resultbuf,
+int attribute_hidden __getgrent_r(struct group *__restrict resultbuf,
 			   char *__restrict buffer, size_t buflen,
 			   char *__restrict buffer, size_t buflen,
 			   struct group **__restrict result)
 			   struct group **__restrict result)
 {
 {
@@ -516,6 +565,7 @@ int getgrent_r(struct group *__restrict resultbuf,
 
 
 	return rv;
 	return rv;
 }
 }
+strong_alias(__getgrent_r,getgrent_r)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
@@ -542,7 +592,7 @@ void endspent(void)
 	UNLOCK;
 	UNLOCK;
 }
 }
 
 
-int getspent_r(struct spwd *resultbuf, char *buffer, 
+int attribute_hidden __getspent_r(struct spwd *resultbuf, char *buffer, 
 			   size_t buflen, struct spwd **result)
 			   size_t buflen, struct spwd **result)
 {
 {
 	int rv;
 	int rv;
@@ -569,10 +619,15 @@ int getspent_r(struct spwd *resultbuf, char *buffer,
 
 
 	return rv;
 	return rv;
 }
 }
+strong_alias(__getspent_r,getspent_r)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_getpwent
 #ifdef L_getpwent
+	
+extern int __getpwent_r (struct passwd *__restrict __resultbuf,
+		       char *__restrict __buffer, size_t __buflen,
+		       struct passwd **__restrict __result) attribute_hidden;
 
 
 struct passwd *getpwent(void)
 struct passwd *getpwent(void)
 {
 {
@@ -580,7 +635,7 @@ struct passwd *getpwent(void)
 	static struct passwd pwd;
 	static struct passwd pwd;
 	struct passwd *result;
 	struct passwd *result;
 
 
-	getpwent_r(&pwd, line_buff, sizeof(line_buff), &result);
+	__getpwent_r(&pwd, line_buff, sizeof(line_buff), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -588,13 +643,17 @@ struct passwd *getpwent(void)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_getgrent
 #ifdef L_getgrent
 
 
+extern int __getgrent_r (struct group *__restrict __resultbuf,
+		       char *__restrict __buffer, size_t __buflen,
+		       struct group **__restrict __result) attribute_hidden;
+
 struct group *getgrent(void)
 struct group *getgrent(void)
 {
 {
 	static char line_buff[GRP_BUFFER_SIZE];
 	static char line_buff[GRP_BUFFER_SIZE];
 	static struct group gr;
 	static struct group gr;
 	struct group *result;
 	struct group *result;
 
 
-	getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
+	__getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -602,13 +661,16 @@ struct group *getgrent(void)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_getspent
 #ifdef L_getspent
 
 
+extern int __getspent_r (struct spwd *__result_buf, char *__buffer,
+		       size_t __buflen, struct spwd **__result) attribute_hidden;
+
 struct spwd *getspent(void)
 struct spwd *getspent(void)
 {
 {
 	static char line_buff[PWD_BUFFER_SIZE];
 	static char line_buff[PWD_BUFFER_SIZE];
 	static struct spwd spwd;
 	static struct spwd spwd;
 	struct spwd *result;
 	struct spwd *result;
 
 
-	getspent_r(&spwd, line_buff, sizeof(line_buff), &result);
+	__getspent_r(&spwd, line_buff, sizeof(line_buff), &result);
 	return result;
 	return result;
 }
 }
 
 
@@ -616,13 +678,17 @@ struct spwd *getspent(void)
 /**********************************************************************/
 /**********************************************************************/
 #ifdef L_sgetspent
 #ifdef L_sgetspent
 
 
+extern int __sgetspent_r (__const char *__string, struct spwd *__result_buf,
+			char *__buffer, size_t __buflen,
+			struct spwd **__result) attribute_hidden;
+
 struct spwd *sgetspent(const char *string)
 struct spwd *sgetspent(const char *string)
 {
 {
 	static char line_buff[PWD_BUFFER_SIZE];
 	static char line_buff[PWD_BUFFER_SIZE];
 	static struct spwd spwd;
 	static struct spwd spwd;
 	struct spwd *result;
 	struct spwd *result;
 
 
-	sgetspent_r(string, &spwd, line_buff, sizeof(line_buff), &result);
+	__sgetspent_r(string, &spwd, line_buff, sizeof(line_buff), &result);
 	return result;
 	return result;
 }
 }
 
 

+ 3 - 1
libc/pwd_grp/pwd_grp_internal.c

@@ -55,7 +55,7 @@
 /**********************************************************************/
 /**********************************************************************/
 #ifdef GETXXKEY_R_FUNC
 #ifdef GETXXKEY_R_FUNC
 
 
-int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+int attribute_hidden GETXXKEY_R_FUNC_HIDDEN(DO_GETXXKEY_R_KEYTYPE key,
 					GETXXKEY_R_ENTTYPE *__restrict resultbuf,
 					GETXXKEY_R_ENTTYPE *__restrict resultbuf,
 					char *__restrict buffer, size_t buflen,
 					char *__restrict buffer, size_t buflen,
 					GETXXKEY_R_ENTTYPE **__restrict result)
 					GETXXKEY_R_ENTTYPE **__restrict result)
@@ -89,9 +89,11 @@ int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
 
 
 	return rv;
 	return rv;
 }
 }
+strong_alias(GETXXKEY_R_FUNC_HIDDEN,GETXXKEY_R_FUNC)
 
 
 #endif
 #endif
 /**********************************************************************/
 /**********************************************************************/
+#undef GETXXKEY_R_FUNC_HIDDEN
 #undef GETXXKEY_R_FUNC
 #undef GETXXKEY_R_FUNC
 #undef GETXXKEY_R_PARSER
 #undef GETXXKEY_R_PARSER
 #undef GETXXKEY_R_ENTTYPE
 #undef GETXXKEY_R_ENTTYPE

+ 2 - 0
libc/stdio/scanf.c

@@ -47,7 +47,9 @@
 #define mbsrtowcs __mbsrtowcs
 #define mbsrtowcs __mbsrtowcs
 #define mbrtowc __mbrtowc
 #define mbrtowc __mbrtowc
 #define ungetc __ungetc
 #define ungetc __ungetc
+#define ungetwc __ungetwc
 #define iswspace __iswspace
 #define iswspace __iswspace
+#define wcrtomb __wcrtomb
 
 
 #define _ISOC99_SOURCE			/* for LLONG_MAX primarily... */
 #define _ISOC99_SOURCE			/* for LLONG_MAX primarily... */
 #define _GNU_SOURCE
 #define _GNU_SOURCE

+ 2 - 1
libc/stdio/ungetwc.c

@@ -12,7 +12,7 @@
  * as reset stream->__ungot_width[1] for use by _stdio_adjpos().
  * as reset stream->__ungot_width[1] for use by _stdio_adjpos().
  */
  */
 
 
-wint_t ungetwc(wint_t c, register FILE *stream)
+wint_t attribute_hidden __ungetwc(wint_t c, register FILE *stream)
 {
 {
 	__STDIO_AUTO_THREADLOCK_VAR;
 	__STDIO_AUTO_THREADLOCK_VAR;
 
 
@@ -46,3 +46,4 @@ wint_t ungetwc(wint_t c, register FILE *stream)
 
 
 	return c;
 	return c;
 }
 }
+strong_alias(__ungetwc,ungetwc)

+ 1 - 0
libc/stdio/vfprintf.c

@@ -94,6 +94,7 @@
 #define wcsrtombs __wcsrtombs
 #define wcsrtombs __wcsrtombs
 #define mbsrtowcs __mbsrtowcs
 #define mbsrtowcs __mbsrtowcs
 #define btowc __btowc
 #define btowc __btowc
+#define wcrtomb __wcrtomb
 
 
 #define _ISOC99_SOURCE			/* for ULLONG primarily... */
 #define _ISOC99_SOURCE			/* for ULLONG primarily... */
 #define _GNU_SOURCE
 #define _GNU_SOURCE

+ 3 - 2
libc/stdlib/ptsname.c

@@ -62,7 +62,7 @@ extern const char _ptyname2[];
 /* Store at most BUFLEN characters of the pathname of the slave pseudo
 /* Store at most BUFLEN characters of the pathname of the slave pseudo
    terminal associated with the master FD is open on in BUF.
    terminal associated with the master FD is open on in BUF.
    Return 0 on success, otherwise an error number.  */
    Return 0 on success, otherwise an error number.  */
-int ptsname_r (int fd, char *buf, size_t buflen)
+int attribute_hidden __ptsname_r (int fd, char *buf, size_t buflen)
 {
 {
   int save_errno = errno;
   int save_errno = errno;
 #if !defined __UNIX98PTY_ONLY__
 #if !defined __UNIX98PTY_ONLY__
@@ -179,6 +179,7 @@ int ptsname_r (int fd, char *buf, size_t buflen)
   errno = save_errno;
   errno = save_errno;
   return 0;
   return 0;
 }
 }
+strong_alias(__ptsname_r,ptsname_r)
 
 
 /* Return the pathname of the pseudo terminal slave assoicated with
 /* Return the pathname of the pseudo terminal slave assoicated with
    the master FD is open on, or NULL on errors.
    the master FD is open on, or NULL on errors.
@@ -188,5 +189,5 @@ ptsname (int fd)
 {
 {
   static char buffer[sizeof (_PATH_DEVPTS) + 20];
   static char buffer[sizeof (_PATH_DEVPTS) + 20];
 
 
-  return ptsname_r (fd, buffer, sizeof (buffer)) != 0 ? NULL : buffer;
+  return __ptsname_r (fd, buffer, sizeof (buffer)) != 0 ? NULL : buffer;
 }
 }

+ 1 - 0
libc/stdlib/realpath.c

@@ -14,6 +14,7 @@
  */
  */
 
 
 #define readlink __readlink
 #define readlink __readlink
+#define getcwd __getcwd
 
 
 #ifdef HAVE_CONFIG_H
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #include <config.h>

+ 1 - 0
libc/stdlib/stdlib.c

@@ -38,6 +38,7 @@
 #define mbrlen __mbrlen
 #define mbrlen __mbrlen
 #define iswspace __iswspace
 #define iswspace __iswspace
 #define iswspace_l __iswspace_l
 #define iswspace_l __iswspace_l
+#define wcrtomb __wcrtomb
 
 
 #define _ISOC99_SOURCE			/* for ULLONG primarily... */
 #define _ISOC99_SOURCE			/* for ULLONG primarily... */
 #define _GNU_SOURCE
 #define _GNU_SOURCE

+ 2 - 2
libc/stdlib/unix_grantpt.c

@@ -44,7 +44,7 @@
 #define vfork fork	
 #define vfork fork	
 #endif
 #endif
 
 
-extern int ptsname_r (int fd, char *buf, size_t buflen);
+extern int __ptsname_r (int fd, char *buf, size_t buflen) attribute_hidden;
 
 
 /* Return the result of ptsname_r in the buffer pointed to by PTS,
 /* Return the result of ptsname_r in the buffer pointed to by PTS,
    which should be of length BUF_LEN.  If it is too long to fit in
    which should be of length BUF_LEN.  If it is too long to fit in
@@ -62,7 +62,7 @@ pts_name (int fd, char **pts, size_t buf_len)
 
 
       if (buf_len)
       if (buf_len)
 	{
 	{
-	  rv = ptsname_r (fd, buf, buf_len);
+	  rv = __ptsname_r (fd, buf, buf_len);
 
 
 	  if (rv != 0 || memchr (buf, '\0', buf_len))
 	  if (rv != 0 || memchr (buf, '\0', buf_len))
 	    /* We either got an error, or we succeeded and the
 	    /* We either got an error, or we succeeded and the

+ 2 - 2
libc/sysdeps/linux/common/getcwd.c

@@ -153,7 +153,7 @@ int __syscall_getcwd(char * buf, unsigned long size)
 
 
 #endif
 #endif
 
 
-char *getcwd(char *buf, size_t size)
+char attribute_hidden *__getcwd(char *buf, size_t size)
 {
 {
     int ret;
     int ret;
     char *path;
     char *path;
@@ -185,4 +185,4 @@ char *getcwd(char *buf, size_t size)
 	free (path);
 	free (path);
     return NULL;
     return NULL;
 }
 }
-
+strong_alias(__getcwd,getcwd)

+ 2 - 0
libc/sysdeps/linux/common/getdirname.c

@@ -17,6 +17,8 @@
    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 getcwd __getcwd
+
 #include <features.h>
 #include <features.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/stat.h>

+ 5 - 2
libc/sysdeps/linux/common/getdnnm.c

@@ -1,3 +1,5 @@
+#define uname __uname
+
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -6,8 +8,8 @@
 #include <sys/utsname.h>
 #include <sys/utsname.h>
 
 
 
 
-int
-getdomainname(char *name, size_t len)
+int attribute_hidden
+__getdomainname(char *name, size_t len)
 {
 {
   struct utsname uts;
   struct utsname uts;
 
 
@@ -25,3 +27,4 @@ getdomainname(char *name, size_t len)
   __strcpy(name, uts.domainname);
   __strcpy(name, uts.domainname);
   return 0;
   return 0;
 }
 }
+strong_alias(__getdomainname,getdomainname)

+ 2 - 1
libc/sysdeps/linux/common/getgroups.c

@@ -18,7 +18,7 @@
 static inline _syscall2(int, __syscall_getgroups,
 static inline _syscall2(int, __syscall_getgroups,
 		int, size, __kernel_gid_t *, list);
 		int, size, __kernel_gid_t *, list);
 
 
-int getgroups(int n, gid_t * groups)
+int attribute_hidden __getgroups(int n, gid_t * groups)
 {
 {
 	if (unlikely(n < 0)) {
 	if (unlikely(n < 0)) {
 		__set_errno(EINVAL);
 		__set_errno(EINVAL);
@@ -36,3 +36,4 @@ int getgroups(int n, gid_t * groups)
 		return ngids;
 		return ngids;
 	}
 	}
 }
 }
+strong_alias(__getgroups,getgroups)

+ 5 - 2
libc/sysdeps/linux/common/gethstnm.c

@@ -1,10 +1,12 @@
+#define uname __uname
+
 #include <string.h>
 #include <string.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <sys/utsname.h>
 #include <sys/utsname.h>
 #include <errno.h>
 #include <errno.h>
 
 
-int
-gethostname(char *name, size_t len)
+int attribute_hidden
+__gethostname(char *name, size_t len)
 {
 {
   struct utsname uts;
   struct utsname uts;
 
 
@@ -22,3 +24,4 @@ gethostname(char *name, size_t len)
   __strcpy(name, uts.nodename);
   __strcpy(name, uts.nodename);
   return 0;
   return 0;
 }
 }
+strong_alias(__gethostname,gethostname)

+ 2 - 1
libc/sysdeps/linux/common/getpriority.c

@@ -17,7 +17,7 @@ static inline _syscall2(int, __syscall_getpriority,
 /* The return value of __syscall_getpriority is biased by this value
 /* The return value of __syscall_getpriority is biased by this value
  * to avoid returning negative values.  */
  * to avoid returning negative values.  */
 #define PZERO 20
 #define PZERO 20
-int getpriority(enum __priority_which which, id_t who)
+int attribute_hidden __getpriority(enum __priority_which which, id_t who)
 {
 {
 	int res;
 	int res;
 
 
@@ -26,3 +26,4 @@ int getpriority(enum __priority_which which, id_t who)
 		res = PZERO - res;
 		res = PZERO - res;
 	return res;
 	return res;
 }
 }
+strong_alias(__getpriority,getpriority)

+ 2 - 1
libc/sysdeps/linux/common/getsid.c

@@ -13,7 +13,8 @@
 #define __NR___syscall_getsid __NR_getsid
 #define __NR___syscall_getsid __NR_getsid
 static inline _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid);
 static inline _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid);
 
 
-pid_t getsid(pid_t pid)
+pid_t attribute_hidden __getsid(pid_t pid)
 {
 {
 	return (__syscall_getsid(pid));
 	return (__syscall_getsid(pid));
 }
 }
+strong_alias(__getsid,getsid)

+ 3 - 0
libc/sysdeps/linux/common/nice.c

@@ -8,6 +8,9 @@
  * GNU Library General Public License (LGPL) version 2 or later.
  * GNU Library General Public License (LGPL) version 2 or later.
  */
  */
 
 
+#define getpriority __getpriority
+#define setpriority __setpriority
+
 #include "syscalls.h"
 #include "syscalls.h"
 #include <unistd.h>
 #include <unistd.h>
 #include <sys/resource.h>
 #include <sys/resource.h>

+ 3 - 0
libc/sysdeps/linux/common/setegid.c

@@ -1,3 +1,6 @@
+#define setresgid __setresgid
+#define setregid __setregid
+
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <unistd.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <stdio.h>

+ 5 - 1
libc/sysdeps/linux/common/seteuid.c

@@ -1,3 +1,6 @@
+#define setresuid __setresuid
+#define setreuid __setreuid
+
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <unistd.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <stdio.h>
@@ -6,7 +9,7 @@
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
 #include <sys/syscall.h>
 
 
-int seteuid(uid_t uid)
+int attribute_hidden __seteuid(uid_t uid)
 {
 {
     int result;
     int result;
 
 
@@ -26,3 +29,4 @@ int seteuid(uid_t uid)
 
 
     return result;
     return result;
 }
 }
+strong_alias(__seteuid,seteuid)

+ 2 - 1
libc/sysdeps/linux/common/setgroups.c

@@ -17,7 +17,7 @@
 static inline _syscall2(int, __syscall_setgroups,
 static inline _syscall2(int, __syscall_setgroups,
 		size_t, size, const __kernel_gid_t *, list);
 		size_t, size, const __kernel_gid_t *, list);
 
 
-int setgroups(size_t n, const gid_t * groups)
+int attribute_hidden __setgroups(size_t n, const gid_t * groups)
 {
 {
 	if (n > (size_t) sysconf(_SC_NGROUPS_MAX)) {
 	if (n > (size_t) sysconf(_SC_NGROUPS_MAX)) {
 		__set_errno(EINVAL);
 		__set_errno(EINVAL);
@@ -36,3 +36,4 @@ int setgroups(size_t n, const gid_t * groups)
 		return (__syscall_setgroups(n, kernel_groups));
 		return (__syscall_setgroups(n, kernel_groups));
 	}
 	}
 }
 }
+strong_alias(__setgroups,setgroups)

+ 2 - 1
libc/sysdeps/linux/common/setpgid.c

@@ -14,7 +14,8 @@
 static inline _syscall2(int, __syscall_setpgid,
 static inline _syscall2(int, __syscall_setpgid,
 		__kernel_pid_t, pid, __kernel_pid_t, pgid);
 		__kernel_pid_t, pid, __kernel_pid_t, pgid);
 
 
-int setpgid(pid_t pid, pid_t pgid)
+int attribute_hidden __setpgid(pid_t pid, pid_t pgid)
 {
 {
 	return (__syscall_setpgid(pid, pgid));
 	return (__syscall_setpgid(pid, pgid));
 }
 }
+strong_alias(__setpgid,setpgid)

+ 2 - 0
libc/sysdeps/linux/common/setpgrp.c

@@ -1,3 +1,5 @@
+#define setpgid __setpgid
+
 #include <syscall.h>
 #include <syscall.h>
 #include <unistd.h>
 #include <unistd.h>
 
 

+ 3 - 1
libc/sysdeps/linux/common/setpriority.c

@@ -9,4 +9,6 @@
 
 
 #include "syscalls.h"
 #include "syscalls.h"
 #include <sys/resource.h>
 #include <sys/resource.h>
-_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio);
+#define __NR___setpriority __NR_setpriority
+attribute_hidden _syscall3(int, __setpriority, __priority_which_t, which, id_t, who, int, prio);
+strong_alias(__setpriority,setpriority)

+ 2 - 1
libc/sysdeps/linux/common/setregid.c

@@ -14,7 +14,7 @@
 static inline _syscall2(int, __syscall_setregid,
 static inline _syscall2(int, __syscall_setregid,
 		__kernel_gid_t, rgid, __kernel_gid_t, egid);
 		__kernel_gid_t, rgid, __kernel_gid_t, egid);
 
 
-int setregid(gid_t rgid, gid_t egid)
+int attribute_hidden __setregid(gid_t rgid, gid_t egid)
 {
 {
 	if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
 	if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
 		|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
 		|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
@@ -23,3 +23,4 @@ int setregid(gid_t rgid, gid_t egid)
 	}
 	}
 	return (__syscall_setregid(rgid, egid));
 	return (__syscall_setregid(rgid, egid));
 }
 }
+strong_alias(__setregid,setregid)

+ 2 - 1
libc/sysdeps/linux/common/setresgid.c

@@ -14,7 +14,7 @@
 static inline _syscall3(int, __syscall_setresgid,
 static inline _syscall3(int, __syscall_setresgid,
 		__kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid);
 		__kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid);
 
 
-int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
+int attribute_hidden __setresgid(gid_t rgid, gid_t egid, gid_t sgid)
 {
 {
 	if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
 	if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
 		|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
 		|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
@@ -24,4 +24,5 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
 	}
 	}
 	return (__syscall_setresgid(rgid, egid, sgid));
 	return (__syscall_setresgid(rgid, egid, sgid));
 }
 }
+strong_alias(__setresgid,setresgid)
 #endif
 #endif

+ 2 - 1
libc/sysdeps/linux/common/setresuid.c

@@ -14,7 +14,7 @@
 static inline _syscall3(int, __syscall_setresuid,
 static inline _syscall3(int, __syscall_setresuid,
 		__kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid);
 		__kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid);
 
 
-int setresuid(uid_t ruid, uid_t euid, uid_t suid)
+int attribute_hidden __setresuid(uid_t ruid, uid_t euid, uid_t suid)
 {
 {
 	if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
 	if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
 		|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
 		|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
@@ -24,4 +24,5 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid)
 	}
 	}
 	return (__syscall_setresuid(ruid, euid, suid));
 	return (__syscall_setresuid(ruid, euid, suid));
 }
 }
+strong_alias(__setresuid,setresuid)
 #endif
 #endif

+ 2 - 1
libc/sysdeps/linux/common/setreuid.c

@@ -14,7 +14,7 @@
 static inline _syscall2(int, __syscall_setreuid,
 static inline _syscall2(int, __syscall_setreuid,
 		__kernel_uid_t, ruid, __kernel_uid_t, euid);
 		__kernel_uid_t, ruid, __kernel_uid_t, euid);
 
 
-int setreuid(uid_t ruid, uid_t euid)
+int attribute_hidden __setreuid(uid_t ruid, uid_t euid)
 {
 {
 	if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
 	if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
 		|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))) {
 		|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))) {
@@ -23,3 +23,4 @@ int setreuid(uid_t ruid, uid_t euid)
 	}
 	}
 	return (__syscall_setreuid(ruid, euid));
 	return (__syscall_setreuid(ruid, euid));
 }
 }
+strong_alias(__setreuid,setreuid)

+ 3 - 1
libc/sysdeps/linux/common/setsid.c

@@ -9,4 +9,6 @@
 
 
 #include "syscalls.h"
 #include "syscalls.h"
 #include <unistd.h>
 #include <unistd.h>
-_syscall0(pid_t, setsid);
+#define __NR___setsid __NR_setsid
+attribute_hidden _syscall0(pid_t, __setsid);
+strong_alias(__setsid,setsid)

+ 3 - 1
libc/sysdeps/linux/common/uname.c

@@ -9,4 +9,6 @@
 
 
 #include "syscalls.h"
 #include "syscalls.h"
 #include <sys/utsname.h>
 #include <sys/utsname.h>
-_syscall1(int, uname, struct utsname *, buf);
+#define __NR___uname __NR_uname
+attribute_hidden _syscall1(int, __uname, struct utsname *, buf);
+strong_alias(__uname,uname)

+ 3 - 0
libc/sysdeps/linux/powerpc/ioctl.c

@@ -16,6 +16,9 @@
    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 tcsetattr __tcsetattr
+#define tcgetattr __tcgetattr
+
 #include <stdarg.h>
 #include <stdarg.h>
 #include <termios.h>
 #include <termios.h>
 #include <unistd.h>
 #include <unistd.h>

+ 2 - 2
libc/termios/tcgetattr.c

@@ -32,7 +32,7 @@
 #include "kernel_termios.h"
 #include "kernel_termios.h"
 
 
 /* Put the state of FD into *TERMIOS_P.  */
 /* Put the state of FD into *TERMIOS_P.  */
-int tcgetattr (int fd, struct termios *termios_p)
+int attribute_hidden __tcgetattr (int fd, struct termios *termios_p)
 {
 {
     struct __kernel_termios k_termios;
     struct __kernel_termios k_termios;
     int retval;
     int retval;
@@ -75,4 +75,4 @@ int tcgetattr (int fd, struct termios *termios_p)
 
 
     return retval;
     return retval;
 }
 }
-
+strong_alias(__tcgetattr,tcgetattr)

+ 3 - 0
libc/termios/tcgetsid.c

@@ -16,6 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
    Boston, MA 02111-1307, USA.  */
 
 
+#define getsid __getsid
+#define tcgetpgrp __tcgetpgrp
+
 #include <errno.h>
 #include <errno.h>
 #include <termios.h>
 #include <termios.h>
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>

+ 2 - 1
libc/termios/tcsetattr.c

@@ -47,7 +47,7 @@
 
 
 
 
 /* Set the state of FD to *TERMIOS_P.  */
 /* Set the state of FD to *TERMIOS_P.  */
-int tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
+int attribute_hidden __tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
 {
 {
     struct __kernel_termios k_termios;
     struct __kernel_termios k_termios;
     unsigned long int cmd;
     unsigned long int cmd;
@@ -114,3 +114,4 @@ int tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
 
 
     return retval;
     return retval;
 }
 }
+strong_alias(__tcsetattr,tcsetattr)

+ 16 - 7
libc/termios/termios.c

@@ -23,6 +23,8 @@
    much more current.
    much more current.
  */
  */
 
 
+#define tcgetattr __tcgetattr
+
 #include <errno.h>
 #include <errno.h>
 #include <stddef.h>
 #include <stddef.h>
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
@@ -100,7 +102,7 @@ int tcsetpgrp ( int fd, pid_t pgrp_id)
 
 
 #ifdef L_tcgetpgrp
 #ifdef L_tcgetpgrp
 /* Return the foreground process group ID of FD.  */
 /* Return the foreground process group ID of FD.  */
-pid_t tcgetpgrp ( int fd)
+pid_t attribute_hidden __tcgetpgrp ( int fd)
 {
 {
     int pgrp;
     int pgrp;
 
 
@@ -108,6 +110,7 @@ pid_t tcgetpgrp ( int fd)
 	return (pid_t) -1;
 	return (pid_t) -1;
     return (pid_t) pgrp;
     return (pid_t) pgrp;
 }
 }
+strong_alias(__tcgetpgrp,tcgetpgrp)
 #endif
 #endif
 
 
 /* This is a gross hack around a kernel bug.  If the cfsetispeed functions is
 /* This is a gross hack around a kernel bug.  If the cfsetispeed functions is
@@ -143,7 +146,7 @@ speed_t cfgetispeed (const struct termios *termios_p)
 
 
 #ifdef L_cfsetospeed
 #ifdef L_cfsetospeed
 /* Set the output baud rate stored in *TERMIOS_P to SPEED.  */
 /* Set the output baud rate stored in *TERMIOS_P to SPEED.  */
-int cfsetospeed  (struct termios *termios_p, speed_t speed)
+int attribute_hidden __cfsetospeed  (struct termios *termios_p, speed_t speed)
 {
 {
     if ((speed & ~CBAUD) != 0
     if ((speed & ~CBAUD) != 0
 	    && (speed < B57600 || speed > B460800))
 	    && (speed < B57600 || speed > B460800))
@@ -157,6 +160,7 @@ int cfsetospeed  (struct termios *termios_p, speed_t speed)
 
 
     return 0;
     return 0;
 }
 }
+strong_alias(__cfsetospeed,cfsetospeed)
 #endif
 #endif
 
 
 #ifdef L_cfsetispeed
 #ifdef L_cfsetispeed
@@ -164,7 +168,7 @@ int cfsetospeed  (struct termios *termios_p, speed_t speed)
  *    Although for Linux there is no difference between input and output
  *    Although for Linux there is no difference between input and output
  *       speed, the numerical 0 is a special case for the input baud rate.  It
  *       speed, the numerical 0 is a special case for the input baud rate.  It
  *          should set the input baud rate to the output baud rate.  */
  *          should set the input baud rate to the output baud rate.  */
-int cfsetispeed ( struct termios *termios_p, speed_t speed)
+int attribute_hidden __cfsetispeed ( struct termios *termios_p, speed_t speed)
 {
 {
     if ((speed & ~CBAUD) != 0
     if ((speed & ~CBAUD) != 0
 	    && (speed < B57600 || speed > B460800))
 	    && (speed < B57600 || speed > B460800))
@@ -184,9 +188,14 @@ int cfsetispeed ( struct termios *termios_p, speed_t speed)
 
 
     return 0;
     return 0;
 }
 }
+strong_alias(__cfsetispeed,cfsetispeed)
 #endif
 #endif
 
 
 #ifdef L_cfsetspeed
 #ifdef L_cfsetspeed
+
+extern int __cfsetospeed (struct termios *__termios_p, speed_t __speed) __THROW attribute_hidden;
+extern int __cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW attribute_hidden;
+
 struct speed_struct
 struct speed_struct
 {
 {
   speed_t value;
   speed_t value;
@@ -278,14 +287,14 @@ int cfsetspeed (struct termios *termios_p, speed_t speed)
   for (cnt = 0; cnt < sizeof (speeds) / sizeof (speeds[0]); ++cnt)
   for (cnt = 0; cnt < sizeof (speeds) / sizeof (speeds[0]); ++cnt)
     if (speed == speeds[cnt].internal)
     if (speed == speeds[cnt].internal)
       {
       {
-	cfsetispeed (termios_p, speed);
-	cfsetospeed (termios_p, speed);
+	__cfsetispeed (termios_p, speed);
+	__cfsetospeed (termios_p, speed);
 	return 0;
 	return 0;
       }
       }
     else if (speed == speeds[cnt].value)
     else if (speed == speeds[cnt].value)
       {
       {
-	cfsetispeed (termios_p, speeds[cnt].internal);
-	cfsetospeed (termios_p, speeds[cnt].internal);
+	__cfsetispeed (termios_p, speeds[cnt].internal);
+	__cfsetospeed (termios_p, speeds[cnt].internal);
 	return 0;
 	return 0;
       }
       }
 
 

+ 9 - 8
libc/termios/ttyname.c

@@ -26,13 +26,6 @@
  */
  */
 #define TTYNAME_BUFLEN		32
 #define TTYNAME_BUFLEN		32
 
 
-char *ttyname(int fd)
-{
-	static char name[TTYNAME_BUFLEN];
-
-	return ttyname_r(fd, name, TTYNAME_BUFLEN) ? NULL : name;
-}
-
 static const char dirlist[] =
 static const char dirlist[] =
 /*   12345670123 */
 /*   12345670123 */
 "\010/dev/vc/\0"	/* Try /dev/vc first (be devfs compatible) */
 "\010/dev/vc/\0"	/* Try /dev/vc first (be devfs compatible) */
@@ -41,7 +34,7 @@ static const char dirlist[] =
 "\011/dev/pts/\0"	/* and try /dev/pts next */
 "\011/dev/pts/\0"	/* and try /dev/pts next */
 "\005/dev/\0";		/* and try walking through /dev last */
 "\005/dev/\0";		/* and try walking through /dev last */
 
 
-int ttyname_r(int fd, char *ubuf, size_t ubuflen)
+int attribute_hidden __ttyname_r(int fd, char *ubuf, size_t ubuflen)
 {
 {
 	struct dirent *d;
 	struct dirent *d;
 	struct stat st;
 	struct stat st;
@@ -116,3 +109,11 @@ int ttyname_r(int fd, char *ubuf, size_t ubuflen)
 
 
 	return rv;
 	return rv;
 }
 }
+strong_alias(__ttyname_r,ttyname_r)
+
+char *ttyname(int fd)
+{
+	static char name[TTYNAME_BUFLEN];
+
+	return __ttyname_r(fd, name, TTYNAME_BUFLEN) ? NULL : name;
+}

+ 1 - 0
libc/unistd/daemon.c

@@ -24,6 +24,7 @@
  */
  */
 
 
 #define dup2 __dup2
 #define dup2 __dup2
+#define setsid __setsid
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <features.h>
 #include <features.h>

+ 2 - 0
libc/unistd/getpass.c

@@ -17,6 +17,8 @@
    Boston, MA 02111-1307, USA.  */
    Boston, MA 02111-1307, USA.  */
 
 
 #define setvbuf __setvbuf
 #define setvbuf __setvbuf
+#define tcsetattr __tcsetattr
+#define tcgetattr __tcgetattr
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <string.h>
 #include <string.h>