summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/svc_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc/svc_unix.c')
-rw-r--r--lib/libc/rpc/svc_unix.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/libc/rpc/svc_unix.c b/lib/libc/rpc/svc_unix.c
index dc680d0..ac92bc5 100644
--- a/lib/libc/rpc/svc_unix.c
+++ b/lib/libc/rpc/svc_unix.c
@@ -43,6 +43,7 @@ static char *rcsid = "$FreeBSD$";
* and a record/unix stream.
*/
+#include "namespace.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -52,6 +53,7 @@ static char *rcsid = "$FreeBSD$";
#include <sys/un.h>
#include <sys/uio.h>
#include <errno.h>
+#include "un-namespace.h"
/*
* Ops vector for AF_UNIX based rpc service handle
@@ -130,7 +132,7 @@ static int __msgread(sock, buf, cnt)
msg.msg_controllen = sizeof(struct cmessage);
msg.msg_flags = 0;
- return(recvmsg(sock, &msg, 0));
+ return(_recvmsg(sock, &msg, 0));
}
static int __msgwrite(sock, buf, cnt)
@@ -157,7 +159,7 @@ static int __msgwrite(sock, buf, cnt)
msg.msg_controllen = sizeof(struct cmessage);
msg.msg_flags = 0;
- return(sendmsg(sock, &msg, 0));
+ return(_sendmsg(sock, &msg, 0));
}
/*
@@ -194,7 +196,7 @@ svcunix_create(sock, sendsize, recvsize, path)
int len = sizeof(struct sockaddr_un);
if (sock == RPC_ANYSOCK) {
- if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
+ if ((sock = _socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
perror("svc_unix.c - AF_UNIX socket creation problem");
return ((SVCXPRT *)NULL);
}
@@ -207,10 +209,10 @@ svcunix_create(sock, sendsize, recvsize, path)
sizeof(addr.sun_len) + 1;
addr.sun_len = len;
- bind(sock, (struct sockaddr *)&addr, len);
+ _bind(sock, (struct sockaddr *)&addr, len);
- if ((getsockname(sock, (struct sockaddr *)&addr, &len) != 0) ||
- (listen(sock, 2) != 0)) {
+ if ((_getsockname(sock, (struct sockaddr *)&addr, &len) != 0) ||
+ (_listen(sock, 2) != 0)) {
perror("svc_unix.c - cannot getsockname or listen");
if (madesock)
(void)_close(sock);
@@ -301,7 +303,7 @@ rendezvous_request(xprt)
r = (struct unix_rendezvous *)xprt->xp_p1;
again:
len = sizeof(struct sockaddr_in);
- if ((sock = accept(xprt->xp_sock, (struct sockaddr *)&addr,
+ if ((sock = _accept(xprt->xp_sock, (struct sockaddr *)&addr,
&len)) < 0) {
if (errno == EINTR)
goto again;
@@ -359,7 +361,7 @@ static struct timeval wait_per_try = { 35, 0 };
* Note: we have to be careful here not to allow ourselves to become
* blocked too long in this routine. While we're waiting for data from one
* client, another client may be trying to connect. To avoid this situation,
- * some code from svc_run() is transplanted here: the select() loop checks
+ * some code from svc_run() is transplanted here: the _select() loop checks
* all RPC descriptors including the one we want and calls svc_getreqset2()
* to handle new requests if any are detected.
*/
@@ -391,8 +393,8 @@ readunix(xprt, buf, len)
/* XXX we know the other bits are still clear */
FD_SET(sock, fds);
- tv = delta; /* in case select() implements writeback */
- switch (select(svc_maxfd + 1, fds, NULL, NULL, &tv)) {
+ tv = delta; /* in case _select() implements writeback */
+ switch (_select(svc_maxfd + 1, fds, NULL, NULL, &tv)) {
case -1:
if (errno != EINTR)
goto fatal_err;
OpenPOWER on IntegriCloud