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

Function sbspace

freebsd/sys/sockbuf.h:227–243  ·  view source on GitHub ↗

* How much space is there in a socket buffer (so->so_snd or so->so_rcv)? * This is problematical if the fields are unsigned, as the space might * still be negative (ccc > hiwat or mbcnt > mbmax). */

Source from the content-addressed store, hash-verified

225 * still be negative (ccc > hiwat or mbcnt > mbmax).
226 */
227static inline long
228sbspace(struct sockbuf *sb)
229{
230 int bleft, mleft; /* size should match sockbuf fields */
231
232#if 0
233 SOCKBUF_LOCK_ASSERT(sb);
234#endif
235
236 if (sb->sb_flags & SB_STOP)
237 return(0);
238
239 bleft = sb->sb_hiwat - sb->sb_ccc;
240 mleft = sb->sb_mbmax - sb->sb_mbcnt;
241
242 return ((bleft < mleft) ? bleft : mleft);
243}
244
245#define SB_EMPTY_FIXUP(sb) do { \
246 if ((sb)->sb_mb == NULL) { \

Callers 15

tcp_output.cFile · 0.50
sctp_getoptFunction · 0.50
tcp_twstartFunction · 0.50
tcp_do_segmentFunction · 0.50
tcp_respondFunction · 0.50
tcp_usr_sendFunction · 0.50
ctf_calc_rwinFunction · 0.50
rack_do_fastnewdataFunction · 0.50
rack.cFile · 0.50
bbr_do_fastnewdataFunction · 0.50
bbr.cFile · 0.50
vn_sendfileFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected