Deleted Added
sdiff udiff text old ( 165889 ) new ( 166171 )
full compact
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California.
4 * Copyright (c) 2004 The FreeBSD Foundation
5 * Copyright (c) 2004-2006 Robert N. M. Watson
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 81 unchanged lines hidden (view full) ---

90 * calls to explicitly manage socket references, soref(), and sorele().
91 * Currently, these are generally required only when transitioning a socket
92 * from a listen queue to a file descriptor, in order to prevent garbage
93 * collection of the socket at an untimely moment. For a number of reasons,
94 * these interfaces are not preferred, and should be avoided.
95 */
96
97#include <sys/cdefs.h>
98__FBSDID("$FreeBSD: head/sys/kern/uipc_socket.c 165889 2007-01-08 17:49:59Z rwatson $");
99
100#include "opt_inet.h"
101#include "opt_mac.h"
102#include "opt_zero.h"
103#include "opt_compat.h"
104
105#include <sys/param.h>
106#include <sys/systm.h>

--- 943 unchanged lines hidden (view full) ---

1050 if (flags & MSG_EOR)
1051 top->m_flags |= M_EOR;
1052 } else {
1053#ifdef ZERO_COPY_SOCKETS
1054 error = sosend_copyin(uio, &top, atomic, &space, flags);
1055 if (error)
1056 goto out;
1057#else
1058 top = m_uiotombuf(uio, M_WAITOK, space, max_hdr,
1059 (M_PKTHDR | ((flags & MSG_EOR) ? M_EOR : 0)));
1060 if (top == NULL) {
1061 error = EFAULT; /* only possible error */
1062 goto out;
1063 }
1064 space -= resid - uio->uio_resid;
1065#endif

--- 159 unchanged lines hidden (view full) ---

1225#ifdef ZERO_COPY_SOCKETS
1226 error = sosend_copyin(uio, &top, atomic,
1227 &space, flags);
1228 if (error != 0) {
1229 SOCKBUF_LOCK(&so->so_snd);
1230 goto release;
1231 }
1232#else
1233 top = m_uiotombuf(uio, M_WAITOK, space,
1234 (atomic ? max_hdr : 0),
1235 (atomic ? M_PKTHDR : 0) |
1236 ((flags & MSG_EOR) ? M_EOR : 0));
1237 if (top == NULL) {
1238 SOCKBUF_LOCK(&so->so_snd);
1239 error = EFAULT; /* only possible error */
1240 goto release;

--- 1460 unchanged lines hidden ---