diff options
66 files changed, 362 insertions, 149 deletions
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c index c467fed69..e896e3449 100644 --- a/libc/inet/getaddrinfo.c +++ b/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.  */  #define getservbyname_r __getservbyname_r +#define gethostbyname_r __gethostbyname_r +#define gethostbyname2_r __gethostbyname2_r +#define gethostbyaddr_r __gethostbyaddr_r  #if 0 +#define uname __uname  #define stpcpy __stpcpy  /* strdupa is using these */  #define memcpy __memcpy @@ -767,8 +771,8 @@ static struct gaih gaih[] =      { 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)  {      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;  } +strong_alias(__getaddrinfo,getaddrinfo)  void  freeaddrinfo (struct addrinfo *ai) diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c index a5ebcb3e9..adb83a5ca 100644 --- a/libc/inet/getproto.c +++ b/libc/inet/getproto.c @@ -91,7 +91,7 @@ static void __initbuf(void)      }  } -void setprotoent(int f) +void attribute_hidden __setprotoent(int f)  {      LOCK;      if (protof == NULL) @@ -101,8 +101,9 @@ void setprotoent(int f)      proto_stayopen |= f;      UNLOCK;  } +strong_alias(__setprotoent,setprotoent) -void endprotoent(void) +void attribute_hidden __endprotoent(void)  {      LOCK;      if (protof) { @@ -112,8 +113,9 @@ void endprotoent(void)      proto_stayopen = 0;      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,  		  struct protoent **result)  { @@ -189,18 +191,19 @@ again:      UNLOCK;      return 0;  } +strong_alias(__getprotoent_r,getprotoent_r)  struct protoent * getprotoent(void)  {      struct protoent *result;      __initbuf(); -    getprotoent_r(&proto, static_aliases, SBUFSIZE, &result); +    __getprotoent_r(&proto, static_aliases, SBUFSIZE, &result);      return result;  } -int getprotobyname_r(const char *name, +int attribute_hidden __getprotobyname_r(const char *name,  		    struct protoent *result_buf,  		    char *buf, size_t buflen,  		    struct protoent **result) @@ -209,8 +212,8 @@ int getprotobyname_r(const char *name,      int ret;      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)  	    break;  	for (cp = result_buf->p_aliases; *cp != 0; cp++) @@ -219,10 +222,11 @@ int getprotobyname_r(const char *name,      }  found:      if (!proto_stayopen) -	endprotoent(); +	__endprotoent();      UNLOCK;      return *result?0:ret;  } +strong_alias(__getprotobyname_r,getprotobyname_r)  struct protoent * getprotobyname(const char *name) @@ -230,12 +234,12 @@ struct protoent * getprotobyname(const char *name)      struct protoent *result;      __initbuf(); -    getprotobyname_r(name, &proto, static_aliases, SBUFSIZE, &result); +    __getprotobyname_r(name, &proto, static_aliases, SBUFSIZE, &result);      return result;  } -int getprotobynumber_r (int proto_num, +int attribute_hidden __getprotobynumber_r (int proto_num,  			struct protoent *result_buf,  			char *buf, size_t buflen,  			struct protoent **result) @@ -243,22 +247,23 @@ int getprotobynumber_r (int proto_num,      int ret;      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)  	    break;      if (!proto_stayopen) -	endprotoent(); +	__endprotoent();      UNLOCK;      return *result?0:ret;  } +strong_alias(__getprotobynumber_r,getprotobynumber_r)  struct protoent * getprotobynumber(int proto_num)  {      struct protoent *result;      __initbuf(); -    getprotobynumber_r(proto_num, &proto, static_aliases, +    __getprotobynumber_r(proto_num, &proto, static_aliases,                         SBUFSIZE, &result);      return result;  } diff --git a/libc/inet/hostid.c b/libc/inet/hostid.c index 1a3e05113..bc9576e74 100644 --- a/libc/inet/hostid.c +++ b/libc/inet/hostid.c @@ -1,5 +1,7 @@  #define geteuid __geteuid  #define getuid __getuid +#define gethostbyname __gethostbyname +#define gethostname __gethostname  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index d2f90a270..af38c14a5 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -138,6 +138,8 @@  #define strstr __strstr  #define random __random  #define getservbyport __getservbyport +#define getdomainname __getdomainname +#define uname __uname  #define __FORCE_GLIBC  #include <features.h> @@ -159,6 +161,14 @@  #include <sys/utsname.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 REPLY_TIMEOUT 10  #define MAX_RETRIES 3 @@ -1069,7 +1079,7 @@ void attribute_hidden __close_nameservers(void)  #ifdef L_gethostbyname -struct hostent *gethostbyname(const char *name) +struct hostent attribute_hidden *__gethostbyname(const char *name)  {  	static struct hostent h;  	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 */];  	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;  } +strong_alias(__gethostbyname,gethostbyname)  #endif  #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)  {  #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__ */  	static struct hostent h;  	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 */];  	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;  #endif /* __UCLIBC_HAS_IPV6__ */ @@ -1405,7 +1426,14 @@ int res_querydomain(name, domain, class, type, answer, anslen)  #endif  #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 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 */];  	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;  } +strong_alias(__gethostbyaddr,gethostbyaddr)  #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))  #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,  	     unsigned int flags)  { @@ -1747,12 +1776,12 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,  			if (!(flags & NI_NUMERICHOST)) {  #ifdef __UCLIBC_HAS_IPV6__  				if (sa->sa_family == AF_INET6) -					h = gethostbyaddr ((const void *) +					h = __gethostbyaddr ((const void *)  						&(((const struct sockaddr_in6 *) sa)->sin6_addr),  						sizeof(struct in6_addr), AF_INET6);  				else  #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);  				if (h) { @@ -1892,12 +1921,13 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,  	errno = serrno;  	return 0;  } +strong_alias(__getnameinfo,getnameinfo)  #endif  #ifdef L_gethostbyname_r -int gethostbyname_r(const char * name, +int attribute_hidden __gethostbyname_r(const char * name,  			    struct hostent * result_buf,  			    char * buf, size_t buflen,  			    struct hostent ** result, @@ -2046,18 +2076,19 @@ int gethostbyname_r(const char * name,  	*h_errnop = NETDB_SUCCESS;  	return NETDB_SUCCESS;  } +strong_alias(__gethostbyname_r,gethostbyname_r)  #endif  #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,  			    char * buf, size_t buflen,  			    struct hostent ** result,  			    int * h_errnop)  {  #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;  #else /* __UCLIBC_HAS_IPV6__ */  	struct in6_addr *in; @@ -2070,7 +2101,7 @@ int gethostbyname2_r(const char *name, int family,  	char ** __nameserverXX;  	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)  		return EINVAL; @@ -2188,10 +2219,11 @@ int gethostbyname2_r(const char *name, int family,  	return NETDB_SUCCESS;  #endif /* __UCLIBC_HAS_IPV6__ */  } +strong_alias(__gethostbyname2_r,gethostbyname2_r)  #endif  #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,  			    char * buf, size_t buflen,  			    struct hostent ** result, @@ -2372,6 +2404,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type,  	*h_errnop = NETDB_SUCCESS;  	return NETDB_SUCCESS;  } +strong_alias(__gethostbyaddr_r,gethostbyaddr_r)  #endif  #ifdef L_res_comp diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c index 95733163c..87852f36e 100644 --- a/libc/inet/rpc/auth_unix.c +++ b/libc/inet/rpc/auth_unix.c @@ -41,6 +41,8 @@  #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 diff --git a/libc/inet/rpc/clnt_generic.c b/libc/inet/rpc/clnt_generic.c index 1b30d2e1c..518ca0fa8 100644 --- a/libc/inet/rpc/clnt_generic.c +++ b/libc/inet/rpc/clnt_generic.c @@ -33,6 +33,8 @@  #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  #include <features.h> diff --git a/libc/inet/rpc/clnt_raw.c b/libc/inet/rpc/clnt_raw.c index ff48523a9..aa7b44bb4 100644 --- a/libc/inet/rpc/clnt_raw.c +++ b/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_opaque_auth __xdr_opaque_auth  #define svc_getreq __svc_getreq +#define _seterr_reply __seterr_reply  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/rpc/clnt_simple.c b/libc/inet/rpc/clnt_simple.c index 9105fc266..7c17dc1f1 100644 --- a/libc/inet/rpc/clnt_simple.c +++ b/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 gethostbyname_r __gethostbyname_r  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c index 4221eff63..f006c3383 100644 --- a/libc/inet/rpc/clnt_tcp.c +++ b/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 xdrmem_create __xdrmem_create  #define pmap_getport __pmap_getport +#define _seterr_reply __seterr_reply  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c index b3d26fc21..c59a119b9 100644 --- a/libc/inet/rpc/clnt_udp.c +++ b/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_replymsg __xdr_replymsg  #define xdr_opaque_auth __xdr_opaque_auth -  #define pmap_getport __pmap_getport +#define _seterr_reply __seterr_reply  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c index 18b20af16..efdd39005 100644 --- a/libc/inet/rpc/clnt_unix.c +++ b/libc/inet/rpc/clnt_unix.c @@ -56,6 +56,7 @@  #define xdrmem_create __xdrmem_create  #define getegid __getegid  #define geteuid __geteuid +#define _seterr_reply __seterr_reply  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/rpc/getrpcport.c b/libc/inet/rpc/getrpcport.c index 518d190f8..48e58d9ab 100644 --- a/libc/inet/rpc/getrpcport.c +++ b/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 gethostbyname_r __gethostbyname_r  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index bd95a7e0c..bbcc7b354 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -39,6 +39,10 @@ static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";  #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 __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c index e5e8d42de..98a8bf32e 100644 --- a/libc/inet/rpc/rexec.c +++ b/libc/inet/rpc/rexec.c @@ -27,6 +27,10 @@   * SUCH DAMAGE.   */ +#define getnameinfo __getnameinfo +#define getaddrinfo __getaddrinfo +#define getsockname __getsockname +  #define __FORCE_GLIBC  #include <features.h>  #include <sys/types.h> diff --git a/libc/inet/rpc/rpc_prot.c b/libc/inet/rpc/rpc_prot.c index 60cd5ff19..afc1dccd1 100644 --- a/libc/inet/rpc/rpc_prot.c +++ b/libc/inet/rpc/rpc_prot.c @@ -240,8 +240,8 @@ rejected (enum reject_stat rjct_stat,  /*   * 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)  {    /* optimized for normal, SUCCESSful case */ @@ -285,3 +285,4 @@ _seterr_reply (struct rpc_msg *msg,        break;      }  } +strong_alias(__seterr_reply,_seterr_reply) diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c index 70a86969b..3c48122ac 100644 --- a/libc/inet/rpc/ruserpass.c +++ b/libc/inet/rpc/ruserpass.c @@ -32,6 +32,7 @@  #define getuid __getuid  #define getegid __getegid  #define geteuid __geteuid +#define gethostname __gethostname  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c index 888841a7d..32b3cc995 100644 --- a/libc/inet/rpc/svc_tcp.c +++ b/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_replymsg __xdr_replymsg  #define xprt_register __xprt_register +#define getsockname __getsockname  #define __FORCE_GLIBC  #define _GNU_SOURCE diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c index 8154ebf91..197084144 100644 --- a/libc/inet/rpc/svc_udp.c +++ b/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 xdr_callmsg __xdr_callmsg  #define xdr_replymsg __xdr_replymsg +#define getsockname __getsockname  #define __FORCE_GLIBC  #define _GNU_SOURCE diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c index 3f10117e5..79c27ac5f 100644 --- a/libc/inet/rpc/svc_unix.c +++ b/libc/inet/rpc/svc_unix.c @@ -46,6 +46,7 @@  #define xprt_register __xprt_register  #define getegid __getegid  #define geteuid __geteuid +#define getsockname __getsockname  #define __FORCE_GLIBC  #include <features.h> diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index 2215d2d99..1dbffa3d1 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -98,9 +98,11 @@ int getpeername(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)  #ifdef L_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) -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]; @@ -109,6 +111,7 @@ int getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)  	args[2] = (unsigned long) paddrlen;  	return __socketcall(SYS_GETSOCKNAME, args);  } +strong_alias(__getsockname,getsockname)  #endif  #endif diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c index 6bd36d749..09a87e4be 100644 --- a/libc/misc/ftw/ftw.c +++ b/libc/misc/ftw/ftw.c @@ -26,6 +26,7 @@  #define tsearch __tsearch  #define tdestroy __tdestroy  #define fchdir __fchdir +#define getcwd __getcwd  #define _GNU_SOURCE  #include <features.h> diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c index 35767280e..81575a679 100644 --- a/libc/misc/mntent/mntent.c +++ b/libc/misc/mntent/mntent.c @@ -14,7 +14,7 @@ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;  #define UNLOCK	__pthread_mutex_unlock(&mylock)  /* 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)  {  	char *cp, *ptrptr; @@ -61,6 +61,7 @@ struct mntent *getmntent_r (FILE *filep,  	return mnt;  } +strong_alias(__getmntent_r,getmntent_r)  struct mntent *getmntent(FILE * filep)  { @@ -75,7 +76,7 @@ struct mntent *getmntent(FILE * filep)  		    abort();      } -    tmp = getmntent_r(filep, &mnt, buff, BUFSIZ); +    tmp = __getmntent_r(filep, &mnt, buff, BUFSIZ);      UNLOCK;      return(tmp);  } @@ -97,14 +98,16 @@ char *hasmntopt(const struct mntent *mnt, const char *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);  } +strong_alias(__setmntent,setmntent) -int endmntent(FILE * filep) +int attribute_hidden __endmntent(FILE * filep)  {  	if (filep != NULL)  		fclose(filep);  	return 1;  } +strong_alias(__endmntent,endmntent) diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c index 0eefa85c9..5220ba57c 100644 --- a/libc/misc/regex/regex.c +++ b/libc/misc/regex/regex.c @@ -33,6 +33,7 @@  #ifdef __UCLIBC_HAS_WCHAR__  #define RE_ENABLE_I18N  #define wcscoll __wcscoll +#define wcrtomb __wcrtomb  #define mbrtowc __mbrtowc  #define iswctype __iswctype  #define iswlower __iswlower diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c index ab471ee1e..1f9d37780 100644 --- a/libc/misc/regex/regex_old.c +++ b/libc/misc/regex/regex_old.c @@ -29,6 +29,7 @@  /* for some reason this does not work */  #define memcpy __memcpy  #define mbrtowc __mbrtowc +#define wcrtomb __wcrtomb  #define wcscoll __wcscoll  #define iswctype __iswctype  #define iswalnum __iswalnum diff --git a/libc/misc/statfs/internal_statvfs.c b/libc/misc/statfs/internal_statvfs.c index 8f7e386c4..4e25edc3f 100644 --- a/libc/misc/statfs/internal_statvfs.c +++ b/libc/misc/statfs/internal_statvfs.c @@ -17,6 +17,13 @@     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA     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.  */    buf->f_bsize = fsbuf.f_bsize;    /* Linux does not support f_frsize, so set it to the full block size.  */ @@ -57,15 +64,15 @@        struct mntent mntbuf;        FILE *mtab; -      mtab = setmntent ("/proc/mounts", "r"); +      mtab = __setmntent ("/proc/mounts", "r");        if (mtab == NULL) -	mtab = setmntent (_PATH_MOUNTED, "r"); +	mtab = __setmntent (_PATH_MOUNTED, "r");        if (mtab != NULL)  	{  	  char tmpbuf[1024]; -	  while (getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf))) +	  while (__getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf)))  	    {  	      struct stat fsst; @@ -102,7 +109,7 @@  	    }  	  /* Close the file.  */ -	  endmntent (mtab); +	  __endmntent (mtab);  	}        __set_errno (save_errno); diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index 4d47cd745..59b3ef641 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -145,6 +145,8 @@  #include <locale.h>  #include <bits/uClibc_uintmaxtostr.h> +extern void __tzset (void) __THROW attribute_hidden; +  #ifdef __UCLIBC_HAS_XLOCALE__  #include <xlocale.h>  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; -	tzset(); +	__tzset();  	__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 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;  	p = format; @@ -1800,7 +1802,7 @@ static char *read_TZ_file(char *buf)  #endif /* __UCLIBC_HAS_TZ_FILE__ */ -void tzset(void) +void attribute_hidden __tzset(void)  {  	register const char *e;  	register char *s; @@ -1987,7 +1989,7 @@ void tzset(void)  #endif  	TZUNLOCK;  } - +strong_alias(__tzset,tzset)  #endif  /**********************************************************************/  /*  #ifdef L_utime */ @@ -2189,7 +2191,7 @@ time_t attribute_hidden _time_mktime(struct tm *timeptr, int store_on_success)  	TZLOCK; -	tzset(); +	__tzset();  	t = _time_mktime_tzi(timeptr, store_on_success, _time_tzinfo); diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index e03d4528f..374b53b93 100644 --- a/libc/misc/utmp/utent.c +++ b/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 *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; @@ -87,6 +65,26 @@ bummer:      UNLOCK;      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)  { @@ -148,8 +146,6 @@ struct utmp *getutline(const struct utmp *utmp_entry)      return NULL;  } -extern struct utmp *__getutid (__const struct utmp *__id) attribute_hidden; -  struct utmp *pututline (const struct utmp *utmp_entry)  {      LOCK; @@ -190,4 +186,3 @@ int utmpname (const char *new_ut_name)      UNLOCK;      return 0;  } - diff --git a/libc/misc/wchar/wstdio.c b/libc/misc/wchar/wstdio.c index 6d4c2732f..b0f259001 100644 --- a/libc/misc/wchar/wstdio.c +++ b/libc/misc/wchar/wstdio.c @@ -52,6 +52,7 @@  #define wcslen __wcslen  #define wcsrtombs __wcsrtombs  #define mbrtowc __mbrtowc +#define wcrtomb __wcrtomb  #define _GNU_SOURCE  #include <stdio.h> diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c index 7cac06f69..d8bf785d3 100644 --- a/libc/misc/wordexp/wordexp.c +++ b/libc/misc/wordexp/wordexp.c @@ -27,6 +27,8 @@  #define waitpid __waitpid  #define kill __kill  #define getuid __getuid +#define getpwnam_r __getpwnam_r +#define getpwuid_r __getpwuid_r  #define execve __execve  #define dup2 __dup2 diff --git a/libc/pwd_grp/pwd_grp.c b/libc/pwd_grp/pwd_grp.c index 601568599..ced5051f8 100644 --- a/libc/pwd_grp/pwd_grp.c +++ b/libc/pwd_grp/pwd_grp.c @@ -18,6 +18,8 @@   *   */ +#define setgroups __setgroups +  #define _GNU_SOURCE  #include <features.h>  #include <stdio.h> @@ -38,6 +40,15 @@  #include <pthread.h>  #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. */ @@ -73,7 +84,7 @@ extern int __pgsreader(int (*__parserfunc)(void *d, char *line), void *data,  /**********************************************************************/  #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,  				struct passwd **__restrict result)  { @@ -87,12 +98,13 @@ int fgetpwent_r(FILE *__restrict stream, struct passwd *__restrict resultbuf,  	return rv;  } +strong_alias(__fgetpwent_r,fgetpwent_r)  #endif  /**********************************************************************/  #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,  				struct group **__restrict result)  { @@ -106,12 +118,13 @@ int fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,  	return rv;  } +strong_alias(__fgetgrent_r,fgetgrent_r)  #endif  /**********************************************************************/  #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,  				struct spwd **__restrict result)  { @@ -125,6 +138,7 @@ int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,  	return rv;  } +strong_alias(__fgetspent_r,fgetspent_r)  #endif  /**********************************************************************/ @@ -134,13 +148,18 @@ int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,  /**********************************************************************/  #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)  {  	static char buffer[PWD_BUFFER_SIZE];  	static struct passwd resultbuf;  	struct passwd *result; -	fgetpwent_r(stream, &resultbuf, buffer, sizeof(buffer), &result); +	__fgetpwent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);  	return result;  } @@ -148,13 +167,18 @@ struct passwd *fgetpwent(FILE *stream)  /**********************************************************************/  #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)  {  	static char buffer[GRP_BUFFER_SIZE];  	static struct group resultbuf;  	struct group *result; -	fgetgrent_r(stream, &resultbuf, buffer, sizeof(buffer), &result); +	__fgetgrent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);  	return result;  } @@ -162,13 +186,17 @@ struct group *fgetgrent(FILE *stream)  /**********************************************************************/  #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)  {  	static char buffer[PWD_BUFFER_SIZE];  	static struct spwd resultbuf;  	struct spwd *result; -	fgetspent_r(stream, &resultbuf, buffer, sizeof(buffer), &result); +	__fgetspent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);  	return result;  } @@ -176,7 +204,7 @@ struct spwd *fgetspent(FILE *stream)  /**********************************************************************/  #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)  {  	int rv = ERANGE; @@ -203,6 +231,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,   DONE:  	return rv;  } +strong_alias(__sgetspent_r,sgetspent_r)  #endif  /**********************************************************************/ @@ -212,9 +241,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,  #endif  #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_ENTTYPE		struct passwd +#define GETXXKEY_R_ENTTYPE	struct passwd  #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->pw_name, key))  #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict  #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD @@ -222,9 +252,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,  #endif  #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_ENTTYPE		struct group +#define GETXXKEY_R_ENTTYPE	struct group  #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->gr_name, key))  #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict  #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP @@ -232,9 +263,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,  #endif  #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_ENTTYPE		struct spwd +#define GETXXKEY_R_ENTTYPE	struct spwd  #define GETXXKEY_R_TEST(ENT)	(!__strcmp((ENT)->sp_namp, key))  #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict  #define DO_GETXXKEY_R_PATHNAME  _PATH_SHADOW @@ -242,9 +274,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,  #endif  #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_ENTTYPE		struct passwd +#define GETXXKEY_R_ENTTYPE	struct passwd  #define GETXXKEY_R_TEST(ENT)	((ENT)->pw_uid == key)  #define DO_GETXXKEY_R_KEYTYPE	uid_t  #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD @@ -252,9 +285,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf,  #endif  #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_ENTTYPE		struct group +#define GETXXKEY_R_ENTTYPE	struct group  #define GETXXKEY_R_TEST(ENT)	((ENT)->gr_gid == key)  #define DO_GETXXKEY_R_KEYTYPE	gid_t  #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP @@ -270,7 +304,7 @@ struct passwd *getpwuid(uid_t uid)  	static struct passwd resultbuf;  	struct passwd *result; -	getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result); +	__getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);  	return result;  } @@ -278,13 +312,17 @@ struct passwd *getpwuid(uid_t uid)  /**********************************************************************/  #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)  {  	static char buffer[GRP_BUFFER_SIZE];  	static struct group resultbuf;  	struct group *result; -	getgrgid_r(gid, &resultbuf, buffer, sizeof(buffer), &result); +	__getgrgid_r(gid, &resultbuf, buffer, sizeof(buffer), &result);  	return result;  } @@ -306,8 +344,8 @@ int getspuid_r(uid_t uid, struct spwd *__restrict resultbuf,  	char pwd_buff[PWD_BUFFER_SIZE];  	*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; @@ -334,13 +372,18 @@ struct spwd *getspuid(uid_t uid)  /**********************************************************************/  #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)  {  	static char buffer[PWD_BUFFER_SIZE];  	static struct passwd resultbuf;  	struct passwd *result; -	getpwnam_r(name, &resultbuf, buffer, sizeof(buffer), &result); +	__getpwnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);  	return result;  } @@ -348,13 +391,18 @@ struct passwd *getpwnam(const char *name)  /**********************************************************************/  #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)  {  	static char buffer[GRP_BUFFER_SIZE];  	static struct group resultbuf;  	struct group *result; -	getgrnam_r(name, &resultbuf, buffer, sizeof(buffer), &result); +	__getgrnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);  	return result;  } @@ -368,7 +416,7 @@ struct spwd *getspnam(const char *name)  	static struct spwd resultbuf;  	struct spwd *result; -	getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result); +	__getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);  	return result;  } @@ -384,7 +432,7 @@ int getpw(uid_t uid, char *buf)  	if (!buf) {  		__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",  					resultbuf.pw_name, resultbuf.pw_passwd,  					(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,  			   struct passwd **__restrict result)  { @@ -462,6 +510,7 @@ int getpwent_r(struct passwd *__restrict resultbuf,  	return rv;  } +strong_alias(__getpwent_r,getpwent_r)  #endif  /**********************************************************************/ @@ -488,7 +537,7 @@ void endgrent(void)  	UNLOCK;  } -int getgrent_r(struct group *__restrict resultbuf, +int attribute_hidden __getgrent_r(struct group *__restrict resultbuf,  			   char *__restrict buffer, size_t buflen,  			   struct group **__restrict result)  { @@ -516,6 +565,7 @@ int getgrent_r(struct group *__restrict resultbuf,  	return rv;  } +strong_alias(__getgrent_r,getgrent_r)  #endif  /**********************************************************************/ @@ -542,7 +592,7 @@ void endspent(void)  	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)  {  	int rv; @@ -569,10 +619,15 @@ int getspent_r(struct spwd *resultbuf, char *buffer,  	return rv;  } +strong_alias(__getspent_r,getspent_r)  #endif  /**********************************************************************/  #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)  { @@ -580,7 +635,7 @@ struct passwd *getpwent(void)  	static struct passwd pwd;  	struct passwd *result; -	getpwent_r(&pwd, line_buff, sizeof(line_buff), &result); +	__getpwent_r(&pwd, line_buff, sizeof(line_buff), &result);  	return result;  } @@ -588,13 +643,17 @@ struct passwd *getpwent(void)  /**********************************************************************/  #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)  {  	static char line_buff[GRP_BUFFER_SIZE];  	static struct group gr;  	struct group *result; -	getgrent_r(&gr, line_buff, sizeof(line_buff), &result); +	__getgrent_r(&gr, line_buff, sizeof(line_buff), &result);  	return result;  } @@ -602,13 +661,16 @@ struct group *getgrent(void)  /**********************************************************************/  #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)  {  	static char line_buff[PWD_BUFFER_SIZE];  	static struct spwd spwd;  	struct spwd *result; -	getspent_r(&spwd, line_buff, sizeof(line_buff), &result); +	__getspent_r(&spwd, line_buff, sizeof(line_buff), &result);  	return result;  } @@ -616,13 +678,17 @@ struct spwd *getspent(void)  /**********************************************************************/  #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)  {  	static char line_buff[PWD_BUFFER_SIZE];  	static struct spwd spwd;  	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;  } diff --git a/libc/pwd_grp/pwd_grp_internal.c b/libc/pwd_grp/pwd_grp_internal.c index 0552c680b..8520cf45b 100644 --- a/libc/pwd_grp/pwd_grp_internal.c +++ b/libc/pwd_grp/pwd_grp_internal.c @@ -55,7 +55,7 @@  /**********************************************************************/  #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,  					char *__restrict buffer, size_t buflen,  					GETXXKEY_R_ENTTYPE **__restrict result) @@ -89,9 +89,11 @@ int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,  	return rv;  } +strong_alias(GETXXKEY_R_FUNC_HIDDEN,GETXXKEY_R_FUNC)  #endif  /**********************************************************************/ +#undef GETXXKEY_R_FUNC_HIDDEN  #undef GETXXKEY_R_FUNC  #undef GETXXKEY_R_PARSER  #undef GETXXKEY_R_ENTTYPE diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c index 4db939f93..555d9a267 100644 --- a/libc/stdio/scanf.c +++ b/libc/stdio/scanf.c @@ -47,7 +47,9 @@  #define mbsrtowcs __mbsrtowcs  #define mbrtowc __mbrtowc  #define ungetc __ungetc +#define ungetwc __ungetwc  #define iswspace __iswspace +#define wcrtomb __wcrtomb  #define _ISOC99_SOURCE			/* for LLONG_MAX primarily... */  #define _GNU_SOURCE diff --git a/libc/stdio/ungetwc.c b/libc/stdio/ungetwc.c index cf4b9c488..c6a99dd9d 100644 --- a/libc/stdio/ungetwc.c +++ b/libc/stdio/ungetwc.c @@ -12,7 +12,7 @@   * 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; @@ -46,3 +46,4 @@ wint_t ungetwc(wint_t c, register FILE *stream)  	return c;  } +strong_alias(__ungetwc,ungetwc) diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c index d835038ba..5275f53f7 100644 --- a/libc/stdio/vfprintf.c +++ b/libc/stdio/vfprintf.c @@ -94,6 +94,7 @@  #define wcsrtombs __wcsrtombs  #define mbsrtowcs __mbsrtowcs  #define btowc __btowc +#define wcrtomb __wcrtomb  #define _ISOC99_SOURCE			/* for ULLONG primarily... */  #define _GNU_SOURCE diff --git a/libc/stdlib/ptsname.c b/libc/stdlib/ptsname.c index d4e99a035..8cac95783 100644 --- a/libc/stdlib/ptsname.c +++ b/libc/stdlib/ptsname.c @@ -62,7 +62,7 @@ extern const char _ptyname2[];  /* Store at most BUFLEN characters of the pathname of the slave pseudo     terminal associated with the master FD is open on in BUF.     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;  #if !defined __UNIX98PTY_ONLY__ @@ -179,6 +179,7 @@ int ptsname_r (int fd, char *buf, size_t buflen)    errno = save_errno;    return 0;  } +strong_alias(__ptsname_r,ptsname_r)  /* Return the pathname of the pseudo terminal slave assoicated with     the master FD is open on, or NULL on errors. @@ -188,5 +189,5 @@ ptsname (int fd)  {    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;  } diff --git a/libc/stdlib/realpath.c b/libc/stdlib/realpath.c index 2a018b4b7..88677f7a7 100644 --- a/libc/stdlib/realpath.c +++ b/libc/stdlib/realpath.c @@ -14,6 +14,7 @@   */  #define readlink __readlink +#define getcwd __getcwd  #ifdef HAVE_CONFIG_H  #include <config.h> diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c index 0c78c4c70..3bfdcfea5 100644 --- a/libc/stdlib/stdlib.c +++ b/libc/stdlib/stdlib.c @@ -38,6 +38,7 @@  #define mbrlen __mbrlen  #define iswspace __iswspace  #define iswspace_l __iswspace_l +#define wcrtomb __wcrtomb  #define _ISOC99_SOURCE			/* for ULLONG primarily... */  #define _GNU_SOURCE diff --git a/libc/stdlib/unix_grantpt.c b/libc/stdlib/unix_grantpt.c index bf451a4d3..e087d18c8 100644 --- a/libc/stdlib/unix_grantpt.c +++ b/libc/stdlib/unix_grantpt.c @@ -44,7 +44,7 @@  #define vfork fork	  #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,     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)  	{ -	  rv = ptsname_r (fd, buf, buf_len); +	  rv = __ptsname_r (fd, buf, buf_len);  	  if (rv != 0 || memchr (buf, '\0', buf_len))  	    /* We either got an error, or we succeeded and the diff --git a/libc/sysdeps/linux/common/getcwd.c b/libc/sysdeps/linux/common/getcwd.c index d007993eb..4a1ea093e 100644 --- a/libc/sysdeps/linux/common/getcwd.c +++ b/libc/sysdeps/linux/common/getcwd.c @@ -153,7 +153,7 @@ int __syscall_getcwd(char * buf, unsigned long size)  #endif -char *getcwd(char *buf, size_t size) +char attribute_hidden *__getcwd(char *buf, size_t size)  {      int ret;      char *path; @@ -185,4 +185,4 @@ char *getcwd(char *buf, size_t size)  	free (path);      return NULL;  } - +strong_alias(__getcwd,getcwd) diff --git a/libc/sysdeps/linux/common/getdirname.c b/libc/sysdeps/linux/common/getdirname.c index 486ee9335..d791f34a3 100644 --- a/libc/sysdeps/linux/common/getdirname.c +++ b/libc/sysdeps/linux/common/getdirname.c @@ -17,6 +17,8 @@     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA     02111-1307 USA.  */ +#define getcwd __getcwd +  #include <features.h>  #include <unistd.h>  #include <sys/stat.h> diff --git a/libc/sysdeps/linux/common/getdnnm.c b/libc/sysdeps/linux/common/getdnnm.c index 3c48b4ca0..aa4215f84 100644 --- a/libc/sysdeps/linux/common/getdnnm.c +++ b/libc/sysdeps/linux/common/getdnnm.c @@ -1,3 +1,5 @@ +#define uname __uname +  #include <stdlib.h>  #include <string.h>  #include <unistd.h> @@ -6,8 +8,8 @@  #include <sys/utsname.h> -int -getdomainname(char *name, size_t len) +int attribute_hidden +__getdomainname(char *name, size_t len)  {    struct utsname uts; @@ -25,3 +27,4 @@ getdomainname(char *name, size_t len)    __strcpy(name, uts.domainname);    return 0;  } +strong_alias(__getdomainname,getdomainname) diff --git a/libc/sysdeps/linux/common/getgroups.c b/libc/sysdeps/linux/common/getgroups.c index 402d87e66..c863489b9 100644 --- a/libc/sysdeps/linux/common/getgroups.c +++ b/libc/sysdeps/linux/common/getgroups.c @@ -18,7 +18,7 @@  static inline _syscall2(int, __syscall_getgroups,  		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)) {  		__set_errno(EINVAL); @@ -36,3 +36,4 @@ int getgroups(int n, gid_t * groups)  		return ngids;  	}  } +strong_alias(__getgroups,getgroups) diff --git a/libc/sysdeps/linux/common/gethstnm.c b/libc/sysdeps/linux/common/gethstnm.c index 8a23e9516..cb6e5efce 100644 --- a/libc/sysdeps/linux/common/gethstnm.c +++ b/libc/sysdeps/linux/common/gethstnm.c @@ -1,10 +1,12 @@ +#define uname __uname +  #include <string.h>  #include <unistd.h>  #include <sys/utsname.h>  #include <errno.h> -int -gethostname(char *name, size_t len) +int attribute_hidden +__gethostname(char *name, size_t len)  {    struct utsname uts; @@ -22,3 +24,4 @@ gethostname(char *name, size_t len)    __strcpy(name, uts.nodename);    return 0;  } +strong_alias(__gethostname,gethostname) diff --git a/libc/sysdeps/linux/common/getpriority.c b/libc/sysdeps/linux/common/getpriority.c index ca8b375fb..3f695402d 100644 --- a/libc/sysdeps/linux/common/getpriority.c +++ b/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   * to avoid returning negative values.  */  #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; @@ -26,3 +26,4 @@ int getpriority(enum __priority_which which, id_t who)  		res = PZERO - res;  	return res;  } +strong_alias(__getpriority,getpriority) diff --git a/libc/sysdeps/linux/common/getsid.c b/libc/sysdeps/linux/common/getsid.c index 4bb539cd2..3e9c2d8ba 100644 --- a/libc/sysdeps/linux/common/getsid.c +++ b/libc/sysdeps/linux/common/getsid.c @@ -13,7 +13,8 @@  #define __NR___syscall_getsid __NR_getsid  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));  } +strong_alias(__getsid,getsid) diff --git a/libc/sysdeps/linux/common/nice.c b/libc/sysdeps/linux/common/nice.c index b21f63e08..20f7996a7 100644 --- a/libc/sysdeps/linux/common/nice.c +++ b/libc/sysdeps/linux/common/nice.c @@ -8,6 +8,9 @@   * GNU Library General Public License (LGPL) version 2 or later.   */ +#define getpriority __getpriority +#define setpriority __setpriority +  #include "syscalls.h"  #include <unistd.h>  #include <sys/resource.h> diff --git a/libc/sysdeps/linux/common/setegid.c b/libc/sysdeps/linux/common/setegid.c index 100a34568..d3175dad5 100644 --- a/libc/sysdeps/linux/common/setegid.c +++ b/libc/sysdeps/linux/common/setegid.c @@ -1,3 +1,6 @@ +#define setresgid __setresgid +#define setregid __setregid +  #define _GNU_SOURCE  #include <unistd.h>  #include <stdio.h> diff --git a/libc/sysdeps/linux/common/seteuid.c b/libc/sysdeps/linux/common/seteuid.c index e970e0711..f5ed35743 100644 --- a/libc/sysdeps/linux/common/seteuid.c +++ b/libc/sysdeps/linux/common/seteuid.c @@ -1,3 +1,6 @@ +#define setresuid __setresuid +#define setreuid __setreuid +  #define _GNU_SOURCE  #include <unistd.h>  #include <stdio.h> @@ -6,7 +9,7 @@  #include <sys/types.h>  #include <sys/syscall.h> -int seteuid(uid_t uid) +int attribute_hidden __seteuid(uid_t uid)  {      int result; @@ -26,3 +29,4 @@ int seteuid(uid_t uid)      return result;  } +strong_alias(__seteuid,seteuid) diff --git a/libc/sysdeps/linux/common/setgroups.c b/libc/sysdeps/linux/common/setgroups.c index d92840370..96428edb3 100644 --- a/libc/sysdeps/linux/common/setgroups.c +++ b/libc/sysdeps/linux/common/setgroups.c @@ -17,7 +17,7 @@  static inline _syscall2(int, __syscall_setgroups,  		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)) {  		__set_errno(EINVAL); @@ -36,3 +36,4 @@ int setgroups(size_t n, const gid_t * groups)  		return (__syscall_setgroups(n, kernel_groups));  	}  } +strong_alias(__setgroups,setgroups) diff --git a/libc/sysdeps/linux/common/setpgid.c b/libc/sysdeps/linux/common/setpgid.c index 0373dc3f7..6d73f08ec 100644 --- a/libc/sysdeps/linux/common/setpgid.c +++ b/libc/sysdeps/linux/common/setpgid.c @@ -14,7 +14,8 @@  static inline _syscall2(int, __syscall_setpgid,  		__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));  } +strong_alias(__setpgid,setpgid) diff --git a/libc/sysdeps/linux/common/setpgrp.c b/libc/sysdeps/linux/common/setpgrp.c index 0fa8fccc3..966bb4da6 100644 --- a/libc/sysdeps/linux/common/setpgrp.c +++ b/libc/sysdeps/linux/common/setpgrp.c @@ -1,3 +1,5 @@ +#define setpgid __setpgid +  #include <syscall.h>  #include <unistd.h> diff --git a/libc/sysdeps/linux/common/setpriority.c b/libc/sysdeps/linux/common/setpriority.c index 287ea8dd3..06476d88f 100644 --- a/libc/sysdeps/linux/common/setpriority.c +++ b/libc/sysdeps/linux/common/setpriority.c @@ -9,4 +9,6 @@  #include "syscalls.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) diff --git a/libc/sysdeps/linux/common/setregid.c b/libc/sysdeps/linux/common/setregid.c index 06c166182..cfd375744 100644 --- a/libc/sysdeps/linux/common/setregid.c +++ b/libc/sysdeps/linux/common/setregid.c @@ -14,7 +14,7 @@  static inline _syscall2(int, __syscall_setregid,  		__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))  		|| ((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));  } +strong_alias(__setregid,setregid) diff --git a/libc/sysdeps/linux/common/setresgid.c b/libc/sysdeps/linux/common/setresgid.c index 312994583..fbfa98be3 100644 --- a/libc/sysdeps/linux/common/setresgid.c +++ b/libc/sysdeps/linux/common/setresgid.c @@ -14,7 +14,7 @@  static inline _syscall3(int, __syscall_setresgid,  		__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))  		|| ((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));  } +strong_alias(__setresgid,setresgid)  #endif diff --git a/libc/sysdeps/linux/common/setresuid.c b/libc/sysdeps/linux/common/setresuid.c index d979b8968..6ed1423f5 100644 --- a/libc/sysdeps/linux/common/setresuid.c +++ b/libc/sysdeps/linux/common/setresuid.c @@ -14,7 +14,7 @@  static inline _syscall3(int, __syscall_setresuid,  		__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))  		|| ((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));  } +strong_alias(__setresuid,setresuid)  #endif diff --git a/libc/sysdeps/linux/common/setreuid.c b/libc/sysdeps/linux/common/setreuid.c index 7275c94e9..15ab5c01a 100644 --- a/libc/sysdeps/linux/common/setreuid.c +++ b/libc/sysdeps/linux/common/setreuid.c @@ -14,7 +14,7 @@  static inline _syscall2(int, __syscall_setreuid,  		__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))  		|| ((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));  } +strong_alias(__setreuid,setreuid) diff --git a/libc/sysdeps/linux/common/setsid.c b/libc/sysdeps/linux/common/setsid.c index 0e2e2a31e..b3e1e8706 100644 --- a/libc/sysdeps/linux/common/setsid.c +++ b/libc/sysdeps/linux/common/setsid.c @@ -9,4 +9,6 @@  #include "syscalls.h"  #include <unistd.h> -_syscall0(pid_t, setsid); +#define __NR___setsid __NR_setsid +attribute_hidden _syscall0(pid_t, __setsid); +strong_alias(__setsid,setsid) diff --git a/libc/sysdeps/linux/common/uname.c b/libc/sysdeps/linux/common/uname.c index b3c93e0af..3d252edc7 100644 --- a/libc/sysdeps/linux/common/uname.c +++ b/libc/sysdeps/linux/common/uname.c @@ -9,4 +9,6 @@  #include "syscalls.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) diff --git a/libc/sysdeps/linux/powerpc/ioctl.c b/libc/sysdeps/linux/powerpc/ioctl.c index 7058d44ee..a522ff6d4 100644 --- a/libc/sysdeps/linux/powerpc/ioctl.c +++ b/libc/sysdeps/linux/powerpc/ioctl.c @@ -16,6 +16,9 @@     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA     02111-1307 USA.  */ +#define tcsetattr __tcsetattr +#define tcgetattr __tcgetattr +  #include <stdarg.h>  #include <termios.h>  #include <unistd.h> diff --git a/libc/termios/tcgetattr.c b/libc/termios/tcgetattr.c index 1f1f0562b..8a9448bd7 100644 --- a/libc/termios/tcgetattr.c +++ b/libc/termios/tcgetattr.c @@ -32,7 +32,7 @@  #include "kernel_termios.h"  /* 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;      int retval; @@ -75,4 +75,4 @@ int tcgetattr (int fd, struct termios *termios_p)      return retval;  } - +strong_alias(__tcgetattr,tcgetattr) diff --git a/libc/termios/tcgetsid.c b/libc/termios/tcgetsid.c index 5e4addece..54d317724 100644 --- a/libc/termios/tcgetsid.c +++ b/libc/termios/tcgetsid.c @@ -16,6 +16,9 @@     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,     Boston, MA 02111-1307, USA.  */ +#define getsid __getsid +#define tcgetpgrp __tcgetpgrp +  #include <errno.h>  #include <termios.h>  #include <sys/ioctl.h> diff --git a/libc/termios/tcsetattr.c b/libc/termios/tcsetattr.c index 76d73796e..2bf2d2a29 100644 --- a/libc/termios/tcsetattr.c +++ b/libc/termios/tcsetattr.c @@ -47,7 +47,7 @@  /* 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;      unsigned long int cmd; @@ -114,3 +114,4 @@ int tcsetattr (int fd, int optional_actions, const struct termios *termios_p)      return retval;  } +strong_alias(__tcsetattr,tcsetattr) diff --git a/libc/termios/termios.c b/libc/termios/termios.c index cf3bd9bc6..dc0372fa3 100644 --- a/libc/termios/termios.c +++ b/libc/termios/termios.c @@ -23,6 +23,8 @@     much more current.   */ +#define tcgetattr __tcgetattr +  #include <errno.h>  #include <stddef.h>  #include <sys/ioctl.h> @@ -100,7 +102,7 @@ int tcsetpgrp ( int fd, pid_t pgrp_id)  #ifdef L_tcgetpgrp  /* Return the foreground process group ID of FD.  */ -pid_t tcgetpgrp ( int fd) +pid_t attribute_hidden __tcgetpgrp ( int fd)  {      int pgrp; @@ -108,6 +110,7 @@ pid_t tcgetpgrp ( int fd)  	return (pid_t) -1;      return (pid_t) pgrp;  } +strong_alias(__tcgetpgrp,tcgetpgrp)  #endif  /* 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  /* 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  	    && (speed < B57600 || speed > B460800)) @@ -157,6 +160,7 @@ int cfsetospeed  (struct termios *termios_p, speed_t speed)      return 0;  } +strong_alias(__cfsetospeed,cfsetospeed)  #endif  #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   *       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.  */ -int cfsetispeed ( struct termios *termios_p, speed_t speed) +int attribute_hidden __cfsetispeed ( struct termios *termios_p, speed_t speed)  {      if ((speed & ~CBAUD) != 0  	    && (speed < B57600 || speed > B460800)) @@ -184,9 +188,14 @@ int cfsetispeed ( struct termios *termios_p, speed_t speed)      return 0;  } +strong_alias(__cfsetispeed,cfsetispeed)  #endif  #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  {    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)      if (speed == speeds[cnt].internal)        { -	cfsetispeed (termios_p, speed); -	cfsetospeed (termios_p, speed); +	__cfsetispeed (termios_p, speed); +	__cfsetospeed (termios_p, speed);  	return 0;        }      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;        } diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c index 15093f8a5..43005a63a 100644 --- a/libc/termios/ttyname.c +++ b/libc/termios/ttyname.c @@ -26,13 +26,6 @@   */  #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[] =  /*   12345670123 */  "\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 */  "\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 stat st; @@ -116,3 +109,11 @@ int ttyname_r(int fd, char *ubuf, size_t ubuflen)  	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; +} diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c index a1dfabfe3..cd8a9de9c 100644 --- a/libc/unistd/daemon.c +++ b/libc/unistd/daemon.c @@ -24,6 +24,7 @@   */  #define dup2 __dup2 +#define setsid __setsid  #include <stdio.h>  #include <features.h> diff --git a/libc/unistd/getpass.c b/libc/unistd/getpass.c index 2af8f00a1..2b2d252c2 100644 --- a/libc/unistd/getpass.c +++ b/libc/unistd/getpass.c @@ -17,6 +17,8 @@     Boston, MA 02111-1307, USA.  */  #define setvbuf __setvbuf +#define tcsetattr __tcsetattr +#define tcgetattr __tcgetattr  #include <stdio.h>  #include <string.h>  | 
