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

Function uipc_ready_scan

freebsd/kern/uipc_usrreq.c:1185–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1183}
1184
1185static bool
1186uipc_ready_scan(struct socket *so, struct mbuf *m, int count, int *errorp)
1187{
1188 struct mbuf *mb, *n;
1189 struct sockbuf *sb;
1190
1191 SOCK_LOCK(so);
1192 if (SOLISTENING(so)) {
1193 SOCK_UNLOCK(so);
1194 return (false);
1195 }
1196 mb = NULL;
1197 sb = &so->so_rcv;
1198 SOCKBUF_LOCK(sb);
1199 if (sb->sb_fnrdy != NULL) {
1200 for (mb = sb->sb_mb, n = mb->m_nextpkt; mb != NULL;) {
1201 if (mb == m) {
1202 *errorp = sbready(sb, m, count);
1203 break;
1204 }
1205 mb = mb->m_next;
1206 if (mb == NULL) {
1207 mb = n;
1208 if (mb != NULL)
1209 n = mb->m_nextpkt;
1210 }
1211 }
1212 }
1213 SOCKBUF_UNLOCK(sb);
1214 SOCK_UNLOCK(so);
1215 return (mb != NULL);
1216}
1217
1218static int
1219uipc_ready(struct socket *so, struct mbuf *m, int count)

Callers 1

uipc_readyFunction · 0.85

Calls 1

sbreadyFunction · 0.85

Tested by

no test coverage detected