| version 1.6.2.3, 1993/12/10 13:16:44 |
version 1.7, 1993/10/26 22:36:25 |
|
|
| * $Id$ |
* $Id$ |
| */ |
*/ |
| |
|
| #include <sys/param.h> |
#include "param.h" |
| #include <sys/systm.h> |
#include "systm.h" |
| #include <sys/proc.h> |
#include "proc.h" |
| #include <sys/file.h> |
#include "file.h" |
| #include <sys/malloc.h> |
#include "malloc.h" |
| #include <sys/mbuf.h> |
#include "mbuf.h" |
| #include <sys/domain.h> |
#include "domain.h" |
| #include <sys/kernel.h> |
#include "kernel.h" |
| #include <sys/select.h> |
#include "select.h" |
| #include <sys/protosw.h> |
#include "protosw.h" |
| #include <sys/socket.h> |
#include "socket.h" |
| #include <sys/socketvar.h> |
#include "socketvar.h" |
| #include <sys/resourcevar.h> |
#include "resourcevar.h" |
| |
|
| #include <machine/cpu.h> |
|
| |
|
| /* |
/* |
| * Socket operation routines. |
* Socket operation routines. |
| Line 91 socreate(dom, aso, type, proto) |
|
| Line 89 socreate(dom, aso, type, proto) |
|
| sofree(so); |
sofree(so); |
| return (error); |
return (error); |
| } |
} |
| #ifdef COMPAT_SUNOS |
|
| if (p->p_emul == EMUL_SUNOS && type == SOCK_DGRAM) |
|
| so->so_options |= SO_BROADCAST; |
|
| #endif |
|
| *aso = so; |
*aso = so; |
| return (0); |
return (0); |
| } |
} |
|
|
| if ((m->m_flags & M_EXT) == 0) |
if ((m->m_flags & M_EXT) == 0) |
| goto nopages; |
goto nopages; |
| mlen = MCLBYTES; |
mlen = MCLBYTES; |
| len = min(min(mlen, resid), space); |
#ifdef MAPPED_MBUFS |
| |
len = min(MCLBYTES, resid); |
| |
#else |
| |
if (atomic && top == 0) { |
| |
len = min(MCLBYTES - max_hdr, resid); |
| |
m->m_data += max_hdr; |
| |
} else |
| |
len = min(MCLBYTES, resid); |
| |
#endif |
| |
len = min(len, space); |
| |
space -= len; |
| } else { |
} else { |
| nopages: |
nopages: |
| len = min(min(mlen, resid), space); |
len = min(min(mlen, resid), space); |
| |
space -= len; |
| /* |
/* |
| * For datagram protocols, leave room |
* For datagram protocols, leave room |
| * for protocol headers in first mbuf. |
* for protocol headers in first mbuf. |
|
|
| if (atomic && top == 0 && len < mlen) |
if (atomic && top == 0 && len < mlen) |
| MH_ALIGN(m, len); |
MH_ALIGN(m, len); |
| } |
} |
| space -= len; |
|
| error = uiomove(mtod(m, caddr_t), (int)len, uio); |
error = uiomove(mtod(m, caddr_t), (int)len, uio); |
| resid = uio->uio_resid; |
resid = uio->uio_resid; |
| m->m_len = len; |
m->m_len = len; |