summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2000-01-12 09:23:48 +0000
committerjasone <jasone@FreeBSD.org>2000-01-12 09:23:48 +0000
commit75903038bc52105bc7479fe5f2b75f22f10c1c50 (patch)
treec9e28eda650bbd7eaa3eb22c8d7c75d00a96a451 /lib/libc/rpc
parent688bb99b3f790aad607b949661d0361486bbe346 (diff)
downloadFreeBSD-src-75903038bc52105bc7479fe5f2b75f22f10c1c50.zip
FreeBSD-src-75903038bc52105bc7479fe5f2b75f22f10c1c50.tar.gz
Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read().
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/auth_time.c8
-rw-r--r--lib/libc/rpc/clnt_simple.c2
-rw-r--r--lib/libc/rpc/clnt_tcp.c10
-rw-r--r--lib/libc/rpc/clnt_udp.c2
-rw-r--r--lib/libc/rpc/clnt_unix.c6
-rw-r--r--lib/libc/rpc/get_myaddress.c6
-rw-r--r--lib/libc/rpc/key_call.c4
-rw-r--r--lib/libc/rpc/pmap_clnt.c4
-rw-r--r--lib/libc/rpc/pmap_getmaps.c2
-rw-r--r--lib/libc/rpc/pmap_getport.c2
-rw-r--r--lib/libc/rpc/pmap_rmt.c4
-rw-r--r--lib/libc/rpc/rtime.c4
-rw-r--r--lib/libc/rpc/svc_tcp.c14
-rw-r--r--lib/libc/rpc/svc_udp.c4
-rw-r--r--lib/libc/rpc/svc_unix.c4
15 files changed, 40 insertions, 36 deletions
diff --git a/lib/libc/rpc/auth_time.c b/lib/libc/rpc/auth_time.c
index 3128e6d..47f5212 100644
--- a/lib/libc/rpc/auth_time.c
+++ b/lib/libc/rpc/auth_time.c
@@ -28,6 +28,8 @@
*
* NOTE: This code has had the crap beaten out it in order to convert
* it from TI-RPC back to TD-RPC for use on FreeBSD.
+ *
+ * $FreeBSD$
*/
#include <stdio.h>
#include <syslog.h>
@@ -435,7 +437,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
msg("alarm caught it, must be unreachable.");
goto error;
}
- res = read(s, (char *)&thetime, sizeof(thetime));
+ res = _libc_read(s, (char *)&thetime, sizeof(thetime));
if (res != sizeof(thetime)) {
if (saw_alarm)
msg("timed out TCP call.");
@@ -447,7 +449,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
time_valid = 1;
}
save = errno;
- (void) close(s);
+ (void)_libc_close(s);
errno = save;
s = RPC_ANYSOCK;
@@ -466,7 +468,7 @@ error:
*/
if (s != RPC_ANYSOCK)
- (void) close(s);
+ (void)_libc_close(s);
if (clnt != NULL)
clnt_destroy(clnt);
diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c
index dd935d3..d9623a9 100644
--- a/lib/libc/rpc/clnt_simple.c
+++ b/lib/libc/rpc/clnt_simple.c
@@ -86,7 +86,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
} else {
crp->valid = 0;
if (crp->socket != -1)
- (void)close(crp->socket);
+ (void)_libc_close(crp->socket);
crp->socket = RPC_ANYSOCK;
if (crp->client) {
clnt_destroy(crp->client);
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c
index ebbaddc..6cddb7b 100644
--- a/lib/libc/rpc/clnt_tcp.c
+++ b/lib/libc/rpc/clnt_tcp.c
@@ -167,7 +167,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
if (*sockp != -1)
- (void)close(*sockp);
+ (void)_libc_close(*sockp);
goto fooy;
}
ct->ct_closeit = TRUE;
@@ -200,7 +200,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
XDR_ENCODE);
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
if (ct->ct_closeit) {
- (void)close(*sockp);
+ (void)_libc_close(*sockp);
}
goto fooy;
}
@@ -474,7 +474,7 @@ clnttcp_destroy(h)
(struct ct_data *) h->cl_private;
if (ct->ct_closeit) {
- (void)close(ct->ct_sock);
+ (void)_libc_close(ct->ct_sock);
}
XDR_DESTROY(&(ct->ct_xdrs));
mem_free((caddr_t)ct, sizeof(struct ct_data));
@@ -544,7 +544,7 @@ readtcp(ct, buf, len)
}
break;
}
- switch (len = read(ct->ct_sock, buf, len)) {
+ switch (len = _libc_read(ct->ct_sock, buf, len)) {
case 0:
/* premature eof */
@@ -570,7 +570,7 @@ writetcp(ct, buf, len)
register int i, cnt;
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
- if ((i = write(ct->ct_sock, buf, cnt)) == -1) {
+ if ((i = _libc_write(ct->ct_sock, buf, cnt)) == -1) {
ct->ct_error.re_errno = errno;
ct->ct_error.re_status = RPC_CANTSEND;
return (-1);
diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c
index 5756fc5..f7f7b50 100644
--- a/lib/libc/rpc/clnt_udp.c
+++ b/lib/libc/rpc/clnt_udp.c
@@ -559,7 +559,7 @@ clntudp_destroy(cl)
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
if (cu->cu_closeit) {
- (void)close(cu->cu_sock);
+ (void)_libc_close(cu->cu_sock);
}
XDR_DESTROY(&(cu->cu_outxdrs));
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
diff --git a/lib/libc/rpc/clnt_unix.c b/lib/libc/rpc/clnt_unix.c
index d7a490b..5deb8b0 100644
--- a/lib/libc/rpc/clnt_unix.c
+++ b/lib/libc/rpc/clnt_unix.c
@@ -158,7 +158,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
if (*sockp != -1)
- (void)close(*sockp);
+ (void)_libc_close(*sockp);
goto fooy;
}
ct->ct_closeit = TRUE;
@@ -191,7 +191,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
XDR_ENCODE);
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
if (ct->ct_closeit) {
- (void)close(*sockp);
+ (void)_libc_close(*sockp);
}
goto fooy;
}
@@ -465,7 +465,7 @@ clntunix_destroy(h)
(struct ct_data *) h->cl_private;
if (ct->ct_closeit) {
- (void)close(ct->ct_sock);
+ (void)_libc_close(ct->ct_sock);
}
XDR_DESTROY(&(ct->ct_xdrs));
mem_free((caddr_t)ct, sizeof(struct ct_data));
diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c
index a18a032..2c129a4 100644
--- a/lib/libc/rpc/get_myaddress.c
+++ b/lib/libc/rpc/get_myaddress.c
@@ -73,7 +73,7 @@ get_myaddress(addr)
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
- close(s);
+ _libc_close(s);
return(-1);
}
again:
@@ -83,7 +83,7 @@ again:
while (ifr < end) {
ifreq = *ifr;
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
- close(s);
+ _libc_close(s);
return(-1);
}
if (((ifreq.ifr_flags & IFF_UP) &&
@@ -107,6 +107,6 @@ again:
loopback = 1;
goto again;
}
- (void) close(s);
+ (void)_libc_close(s);
return (gotit ? 0 : -1);
}
diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c
index bcef22e..bb0d06b 100644
--- a/lib/libc/rpc/key_call.c
+++ b/lib/libc/rpc/key_call.c
@@ -28,6 +28,8 @@
*/
/*
* Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ *
+ * $FreeBSD$
*/
#ident "@(#)key_call.c 1.25 94/04/24 SMI"
@@ -367,7 +369,7 @@ int vers;
(void) clnt_control(kcp->client, CLSET_RETRY_TIMEOUT,
(char *)&wait_time);
if (clnt_control(kcp->client, CLGET_FD, (char *)&fd))
- fcntl(fd, F_SETFD, 1); /* make it "close on exec" */
+ _libc_fcntl(fd, F_SETFD, 1); /* make it "close on exec" */
return (kcp->client);
}
diff --git a/lib/libc/rpc/pmap_clnt.c b/lib/libc/rpc/pmap_clnt.c
index 67d1d89..f306a78 100644
--- a/lib/libc/rpc/pmap_clnt.c
+++ b/lib/libc/rpc/pmap_clnt.c
@@ -102,7 +102,7 @@ pmap_set(program, version, protocol, port)
}
CLNT_DESTROY(client);
if (socket != -1)
- (void)close(socket);
+ (void)_libc_close(socket);
return (rslt);
}
@@ -144,6 +144,6 @@ pmap_unset(program, version)
tottimeout);
CLNT_DESTROY(client);
if (socket != -1)
- (void)close(socket);
+ (void)_libc_close(socket);
return (rslt);
}
diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c
index 098ba17..06dabfe 100644
--- a/lib/libc/rpc/pmap_getmaps.c
+++ b/lib/libc/rpc/pmap_getmaps.c
@@ -80,7 +80,7 @@ pmap_getmaps(address)
CLNT_DESTROY(client);
}
if (socket != -1)
- (void)close(socket);
+ (void)_libc_close(socket);
address->sin_port = 0;
return (head);
}
diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c
index 29a26ca..7e4c38b 100644
--- a/lib/libc/rpc/pmap_getport.c
+++ b/lib/libc/rpc/pmap_getport.c
@@ -85,7 +85,7 @@ pmap_getport(address, program, version, protocol)
CLNT_DESTROY(client);
}
if (socket != -1)
- (void)close(socket);
+ (void)_libc_close(socket);
address->sin_port = 0;
return (port);
}
diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c
index 355f34b..da63488 100644
--- a/lib/libc/rpc/pmap_rmt.c
+++ b/lib/libc/rpc/pmap_rmt.c
@@ -98,7 +98,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
stat = RPC_FAILED;
}
if (socket != -1)
- (void)close(socket);
+ (void)_libc_close(socket);
addr->sin_port = 0;
return (stat);
}
@@ -408,7 +408,7 @@ done_broad:
if (fds != &readfds)
free(fds);
if (sock >= 0)
- (void)close(sock);
+ (void)_libc_close(sock);
AUTH_DESTROY(unix_auth);
return (stat);
}
diff --git a/lib/libc/rpc/rtime.c b/lib/libc/rpc/rtime.c
index 4e65c03..25b11ca 100644
--- a/lib/libc/rpc/rtime.c
+++ b/lib/libc/rpc/rtime.c
@@ -129,7 +129,7 @@ rtime(addrp, timep, timeout)
do_close(s);
return(-1);
}
- res = read(s, (char *)&thetime, sizeof(thetime));
+ res = _libc_read(s, (char *)&thetime, sizeof(thetime));
do_close(s);
if (res < 0) {
return(-1);
@@ -152,6 +152,6 @@ do_close(s)
int save;
save = errno;
- (void) close(s);
+ (void)_libc_close(s);
errno = save;
}
diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c
index 90e37a0..da34518 100644
--- a/lib/libc/rpc/svc_tcp.c
+++ b/lib/libc/rpc/svc_tcp.c
@@ -145,7 +145,7 @@ svctcp_create(sock, sendsize, recvsize)
if (ioctl(sock, FIONBIO, &on) < 0) {
perror("svc_tcp.c - cannot turn on non-blocking mode");
if (madesock)
- (void)close(sock);
+ (void)_libc_close(sock);
return ((SVCXPRT *)NULL);
}
memset(&addr, 0, sizeof (addr));
@@ -159,7 +159,7 @@ svctcp_create(sock, sendsize, recvsize)
(listen(sock, 2) != 0)) {
perror("svctcp_.c - cannot getsockname or listen");
if (madesock)
- (void)close(sock);
+ (void)_libc_close(sock);
return ((SVCXPRT *)NULL);
}
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
@@ -257,7 +257,7 @@ rendezvous_request(xprt)
* Guard against FTP bounce attacks.
*/
if (addr.sin_port == htons(20)) {
- close(sock);
+ _libc_close(sock);
return (FALSE);
}
/*
@@ -265,7 +265,7 @@ rendezvous_request(xprt)
*/
off = 0;
if (ioctl(sock, FIONBIO, &off) < 0) {
- close(sock);
+ _libc_close(sock);
return (FALSE);
}
/*
@@ -291,7 +291,7 @@ svctcp_destroy(xprt)
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
xprt_unregister(xprt);
- (void)close(xprt->xp_sock);
+ (void)_libc_close(xprt->xp_sock);
if (xprt->xp_port != 0) {
/* a rendezvouser socket */
xprt->xp_port = 0;
@@ -376,7 +376,7 @@ readtcp(xprt, buf, len)
}
}
} while (!FD_ISSET(sock, fds));
- if ((len = read(sock, buf, len)) > 0) {
+ if ((len = _libc_read(sock, buf, len)) > 0) {
if (fds != NULL)
free(fds);
return (len);
@@ -401,7 +401,7 @@ writetcp(xprt, buf, len)
register int i, cnt;
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
- if ((i = write(xprt->xp_sock, buf, cnt)) < 0) {
+ if ((i = _libc_write(xprt->xp_sock, buf, cnt)) < 0) {
((struct tcp_conn *)(xprt->xp_p1))->strm_stat =
XPRT_DIED;
return (-1);
diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c
index 4b76f2d..c30d224 100644
--- a/lib/libc/rpc/svc_udp.c
+++ b/lib/libc/rpc/svc_udp.c
@@ -123,7 +123,7 @@ svcudp_bufcreate(sock, sendsz, recvsz)
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
perror("svcudp_create - cannot getsockname");
if (madesock)
- (void)close(sock);
+ (void)_libc_close(sock);
return ((SVCXPRT *)NULL);
}
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
@@ -259,7 +259,7 @@ svcudp_destroy(xprt)
register struct svcudp_data *su = su_data(xprt);
xprt_unregister(xprt);
- (void)close(xprt->xp_sock);
+ (void)_libc_close(xprt->xp_sock);
XDR_DESTROY(&(su->su_xdrs));
mem_free(rpc_buffer(xprt), su->su_iosz);
mem_free((caddr_t)su, sizeof(struct svcudp_data));
diff --git a/lib/libc/rpc/svc_unix.c b/lib/libc/rpc/svc_unix.c
index 365f1a5..63a3bad 100644
--- a/lib/libc/rpc/svc_unix.c
+++ b/lib/libc/rpc/svc_unix.c
@@ -213,7 +213,7 @@ svcunix_create(sock, sendsize, recvsize, path)
(listen(sock, 2) != 0)) {
perror("svc_unix.c - cannot getsockname or listen");
if (madesock)
- (void)close(sock);
+ (void)_libc_close(sock);
return ((SVCXPRT *)NULL);
}
r = (struct unix_rendezvous *)mem_alloc(sizeof(*r));
@@ -333,7 +333,7 @@ svcunix_destroy(xprt)
register struct unix_conn *cd = (struct unix_conn *)xprt->xp_p1;
xprt_unregister(xprt);
- (void)close(xprt->xp_sock);
+ (void)_libc_close(xprt->xp_sock);
if (xprt->xp_port != 0) {
/* a rendezvouser socket */
xprt->xp_port = 0;
OpenPOWER on IntegriCloud