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