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

Function sbuf_len

freebsd/kern/subr_sbuf.c:849–865  ·  view source on GitHub ↗

* Return the length of the sbuf data. */

Source from the content-addressed store, hash-verified

847 * Return the length of the sbuf data.
848 */
849ssize_t
850sbuf_len(struct sbuf *s)
851{
852
853 assert_sbuf_integrity(s);
854 /* don't care if it's finished or not */
855 KASSERT(s->s_drain_func == NULL,
856 ("%s makes no sense on sbuf %p with drain", __func__, s));
857
858 if (s->s_error != 0)
859 return (-1);
860
861 /* If finished, nulterm is already in len, else add one. */
862 if (SBUF_NULINCLUDED(s) && !SBUF_ISFINISHED(s))
863 return (s->s_len + 1);
864 return (s->s_len);
865}
866
867/*
868 * Clear an sbuf, free its buffer if necessary.

Callers 15

kstat_sysctl_ioFunction · 0.85
kstat_sysctl_rawFunction · 0.85
sysctl_tcp_hc_listFunction · 0.85
siftr_manage_opsFunction · 0.85
stats_tpl_sample_ratesFunction · 0.85
rctl_write_outbufFunction · 0.85
rctl_racct_to_sbufFunction · 0.85
sys_rctl_get_rulesFunction · 0.85
sys_rctl_get_limitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected