MCPcopy Create free account
hub / github.com/F-Stack/f-stack / soreceive_rcvoob

Function soreceive_rcvoob

freebsd/kern/uipc_socket.c:1831–1854  ·  view source on GitHub ↗

* The part of soreceive() that implements reading non-inline out-of-band * data from a socket. For more complete comments, see soreceive(), from * which this code originated. * * Note that soreceive_rcvoob(), unlike the remainder of soreceive(), is * unable to return an mbuf chain to the caller. */

Source from the content-addressed store, hash-verified

1829 * unable to return an mbuf chain to the caller.
1830 */
1831static int
1832soreceive_rcvoob(struct socket *so, struct uio *uio, int flags)
1833{
1834 struct protosw *pr = so->so_proto;
1835 struct mbuf *m;
1836 int error;
1837
1838 KASSERT(flags & MSG_OOB, ("soreceive_rcvoob: (flags & MSG_OOB) == 0"));
1839 VNET_SO_ASSERT(so);
1840
1841 m = m_get(M_WAITOK, MT_DATA);
1842 error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK);
1843 if (error)
1844 goto bad;
1845 do {
1846 error = uiomove(mtod(m, void *),
1847 (int) min(uio->uio_resid, m->m_len), uio);
1848 m = m_free(m);
1849 } while (uio->uio_resid && error == 0 && m);
1850bad:
1851 if (m != NULL)
1852 m_freem(m);
1853 return (error);
1854}
1855
1856/*
1857 * Following replacement or removal of the first mbuf on the first mbuf chain

Callers 2

uipc_socket.cFile · 0.85
soreceive_streamFunction · 0.85

Calls 5

minFunction · 0.85
uiomoveFunction · 0.70
m_freemFunction · 0.70
m_getFunction · 0.50
m_freeFunction · 0.50

Tested by

no test coverage detected