uipc_syscalls.c (163913) | uipc_syscalls.c (163915) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * sendfile(2) and related extensions: 6 * Copyright (c) 1998, David Greenman. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * sendfile(2) and related extensions: 6 * Copyright (c) 1998, David Greenman. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/kern/uipc_syscalls.c 163913 2006-11-02 16:53:26Z andre $"); | 36__FBSDID("$FreeBSD: head/sys/kern/uipc_syscalls.c 163915 2006-11-02 17:37:22Z andre $"); |
37 38#include "opt_compat.h" 39#include "opt_ktrace.h" 40#include "opt_mac.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> --- 1916 unchanged lines hidden (view full) --- 1961#endif 1962 1963 /* If headers are specified copy them into mbufs. */ 1964 if (hdr_uio != NULL) { 1965 hdr_uio->uio_td = td; 1966 hdr_uio->uio_rw = UIO_WRITE; 1967 if (hdr_uio->uio_resid > 0) { 1968 m = m_uiotombuf(hdr_uio, (mnw ? M_NOWAIT : M_WAITOK), | 37 38#include "opt_compat.h" 39#include "opt_ktrace.h" 40#include "opt_mac.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> --- 1916 unchanged lines hidden (view full) --- 1961#endif 1962 1963 /* If headers are specified copy them into mbufs. */ 1964 if (hdr_uio != NULL) { 1965 hdr_uio->uio_td = td; 1966 hdr_uio->uio_rw = UIO_WRITE; 1967 if (hdr_uio->uio_resid > 0) { 1968 m = m_uiotombuf(hdr_uio, (mnw ? M_NOWAIT : M_WAITOK), |
1969 0, 0); | 1969 0, 0, 0); |
1970 if (m == NULL) { 1971 error = mnw ? EAGAIN : ENOBUFS; 1972 goto done; 1973 } | 1970 if (m == NULL) { 1971 error = mnw ? EAGAIN : ENOBUFS; 1972 goto done; 1973 } |
1974 /* XXX: This should not be a header mbuf. */ 1975 m_demote(m, 0); | |
1976 headersize = hdr_uio->uio_resid; 1977 if (compat) 1978 sbytes += headersize; 1979 } 1980 } 1981 1982 /* Protect against multiple writers to the socket. */ 1983 SOCKBUF_LOCK(&so->so_snd); --- 340 unchanged lines hidden --- | 1974 headersize = hdr_uio->uio_resid; 1975 if (compat) 1976 sbytes += headersize; 1977 } 1978 } 1979 1980 /* Protect against multiple writers to the socket. */ 1981 SOCKBUF_LOCK(&so->so_snd); --- 340 unchanged lines hidden --- |