summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_socket.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-07-24 15:20:08 +0000
committerrwatson <rwatson@FreeBSD.org>2006-07-24 15:20:08 +0000
commit40868fda8a777cd2639ad89e252401b8b27c8c91 (patch)
treeb3a0ac6c1795bad8df68bc26486cfcd7d7e796ec /sys/kern/sys_socket.c
parent0dd0f8ec80a478a694b1ee6de99c7b84a2d3aa2b (diff)
downloadFreeBSD-src-40868fda8a777cd2639ad89e252401b8b27c8c91.zip
FreeBSD-src-40868fda8a777cd2639ad89e252401b8b27c8c91.tar.gz
soreceive_generic(), and sopoll_generic(). Add new functions sosend(),
soreceive(), and sopoll(), which are wrappers for pru_sosend, pru_soreceive, and pru_sopoll, and are now used univerally by socket consumers rather than either directly invoking the old so*() functions or directly invoking the protocol switch method (about an even split prior to this commit). This completes an architectural change that was begun in 1996 to permit protocols to provide substitute implementations, as now used by UDP. Consumers now uniformly invoke sosend(), soreceive(), and sopoll() to perform these operations on sockets -- in particular, distributed file systems and socket system calls. Architectural head nod: sam, gnn, wollman
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r--sys/kern/sys_socket.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index 7c352be..4d0a1ac 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -88,7 +88,7 @@ soo_read(fp, uio, active_cred, flags, td)
return (error);
}
#endif
- error = so->so_proto->pr_usrreqs->pru_soreceive(so, 0, uio, 0, 0, 0);
+ error = soreceive(so, 0, uio, 0, 0, 0);
NET_UNLOCK_GIANT();
return (error);
}
@@ -115,8 +115,7 @@ soo_write(fp, uio, active_cred, flags, td)
return (error);
}
#endif
- error = so->so_proto->pr_usrreqs->pru_sosend(so, 0, uio, 0, 0, 0,
- uio->uio_td);
+ error = sosend(so, 0, uio, 0, 0, 0, uio->uio_td);
if (error == EPIPE && (so->so_options & SO_NOSIGPIPE) == 0) {
PROC_LOCK(uio->uio_td->td_proc);
psignal(uio->uio_td->td_proc, SIGPIPE);
@@ -243,8 +242,7 @@ soo_poll(fp, events, active_cred, td)
return (error);
}
#endif
- error = (so->so_proto->pr_usrreqs->pru_sopoll)
- (so, events, fp->f_cred, td);
+ error = sopoll(so, events, fp->f_cred, td);
NET_UNLOCK_GIANT();
return (error);
OpenPOWER on IntegriCloud