/freebsd/sys/kern/ |
H A D | uipc_sockbuf.c | 74 static void sbcompress_ktls_rx(struct sockbuf *sb, struct mbuf *m, 77 static struct mbuf *sbcut_internal(struct sockbuf *sb, int len); 78 static void sbflush_internal(struct sockbuf *sb); 107 sbready_compress(struct sockbuf *sb, struct mbuf *m0, struct mbuf *end) in sbready_compress() argument 112 SOCKBUF_LOCK_ASSERT(sb); in sbready_compress() 114 if ((sb->sb_flags & SB_NOCOALESCE) != 0) in sbready_compress() 157 sb->sb_mbcnt -= ext_size; in sbready_compress() 168 KASSERT(sb->sb_lastrecord != n, in sbready_compress() 175 if (sb->sb_mbtail == n) in sbready_compress() 176 sb->sb_mbtail = m; in sbready_compress() [all …]
|
H A D | kern_tslog.c | 80 struct sbuf *sb; in sysctl_debug_tslog() local 94 sb = sbuf_new_for_sysctl(NULL, NULL, 1024, req); in sysctl_debug_tslog() 101 sbuf_bcat(sb, loader_tslog_buf, loader_tslog_len); in sysctl_debug_tslog() 107 sbuf_printf(sb, "%p", timestamps[i].td); in sysctl_debug_tslog() 108 sbuf_printf(sb, " %llu", in sysctl_debug_tslog() 112 sbuf_cat(sb, " ENTER"); in sysctl_debug_tslog() 115 sbuf_cat(sb, " EXIT"); in sysctl_debug_tslog() 118 sbuf_cat(sb, " THREAD"); in sysctl_debug_tslog() 121 sbuf_cat(sb, " EVENT"); in sysctl_debug_tslog() 124 sbuf_printf(sb, " %s", timestamps[i].f ? timestamps[i].f : "(null)"); in sysctl_debug_tslog() [all …]
|
/freebsd/sys/geom/ |
H A D | geom_dump.c | 50 g_confdot_consumer(struct sbuf *sb, struct g_consumer *cp) in g_confdot_consumer() argument 53 sbuf_printf(sb, "z%p [label=\"r%dw%de%d\"];\n", in g_confdot_consumer() 56 sbuf_printf(sb, "z%p -> z%p;\n", cp, cp->provider); in g_confdot_consumer() 60 g_confdot_provider(struct sbuf *sb, struct g_provider *pp) in g_confdot_provider() argument 63 sbuf_printf(sb, "z%p [shape=hexagon,label=\"%s\\nr%dw%de%d\\nerr#%d\\n" in g_confdot_provider() 69 g_confdot_geom(struct sbuf *sb, struct g_geom *gp) in g_confdot_geom() argument 74 sbuf_printf(sb, "z%p [shape=box,label=\"%s\\n%s\\nr#%d\"];\n", in g_confdot_geom() 77 g_confdot_consumer(sb, cp); in g_confdot_geom() 78 sbuf_printf(sb, "z%p -> z%p;\n", gp, cp); in g_confdot_geom() 82 g_confdot_provider(sb, pp); in g_confdot_geom() [all …]
|
/freebsd/lib/libsbuf/tests/ |
H A D | sbuf_core_test.c | 47 struct sbuf *sb; in ATF_TC_BODY() local 51 sb = sbuf_new_auto(); in ATF_TC_BODY() 52 ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", in ATF_TC_BODY() 55 ATF_REQUIRE_MSG(sbuf_cat(sb, test_string) == 0, "sbuf_cat failed"); in ATF_TC_BODY() 63 ATF_REQUIRE_EQ_MSG(0, sbuf_finish(sb), "sbuf_finish failed: %s", in ATF_TC_BODY() 66 sbuf_putbuf(sb); in ATF_TC_BODY() 71 sbuf_clear(sb); in ATF_TC_BODY() 73 ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", in ATF_TC_BODY() 76 buf_len = sbuf_len(sb); in ATF_TC_BODY() 78 ATF_REQUIRE_STREQ_MSG(sbuf_data(sb), "", in ATF_TC_BODY() [all …]
|
H A D | sbuf_string_test.c | 58 struct sbuf *sb; in ATF_TC_BODY() local 69 sb = sbuf_new_auto(); in ATF_TC_BODY() 70 ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", in ATF_TC_BODY() 73 ATF_CHECK_MSG(sbuf_bcat(sb, test_buffer, sizeof(test_buffer)) == 0, in ATF_TC_BODY() 76 test_sbuf_len = sbuf_len(sb); in ATF_TC_BODY() 81 ATF_CHECK_MSG(sbuf_bcat(sb, test_buffer, sizeof(test_buffer)) == 0, in ATF_TC_BODY() 84 test_sbuf_len = sbuf_len(sb); in ATF_TC_BODY() 89 ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", in ATF_TC_BODY() 92 check_buffers_equal(sbuf_data(sb), test_buffer_tmp, in ATF_TC_BODY() 95 sbuf_delete(sb); in ATF_TC_BODY() [all …]
|
H A D | sbuf_stdio_test.c | 45 sbuf_vprintf_helper(struct sbuf *sb, const char * restrict format, ...) in sbuf_vprintf_helper() argument 52 rc = sbuf_vprintf(sb, format, ap); in sbuf_vprintf_helper() 62 struct sbuf *sb; in ATF_TC_BODY() local 66 sb = sbuf_new(NULL, buf, sizeof(buf), SBUF_FIXEDLEN); in ATF_TC_BODY() 67 ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", in ATF_TC_BODY() 72 sbuf_set_drain(sb, sbuf_printf_drain, NULL); in ATF_TC_BODY() 74 ATF_REQUIRE_EQ_MSG(0, sbuf_cat(sb, test_string), in ATF_TC_BODY() 77 ATF_CHECK_EQ(0, sbuf_finish(sb)); in ATF_TC_BODY() 82 sbuf_delete(sb); in ATF_TC_BODY() 88 struct sbuf *sb; in ATF_TC_BODY() local [all …]
|
/freebsd/sbin/growfs/ |
H A D | debug.c | 97 dbg_dump_hex(struct fs *sb, const char *comment, unsigned char *mem) in dbg_dump_hex() argument 107 for (i = 0; i < sb->fs_bsize; i += 24) { in dbg_dump_hex() 125 dbg_dump_fs(struct fs *sb, const char *comment) in dbg_dump_fs() argument 133 fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)sb, comment); in dbg_dump_fs() 137 sb->fs_sblkno); in dbg_dump_fs() 139 sb->fs_cblkno); in dbg_dump_fs() 141 sb->fs_iblkno); in dbg_dump_fs() 143 sb->fs_dblkno); in dbg_dump_fs() 146 sb->fs_old_cgoffset); in dbg_dump_fs() 148 sb->fs_old_cgmask); in dbg_dump_fs() [all …]
|
/freebsd/contrib/lib9p/ |
H A D | utils.c | 263 const struct descbits *db, struct sbuf *sb) in l9p_describe_bits() argument 270 sbuf_printf(sb, "%s0x%" PRIx64, str, value); in l9p_describe_bits() 277 sbuf_printf(sb, "%s%s", sep, db->db_name); in l9p_describe_bits() 293 sbuf_printf(sb, "%s?0x%" PRIx64, sep, value); in l9p_describe_bits() 298 sbuf_cat(sb, bracketbuf); in l9p_describe_bits() 307 l9p_describe_fid(const char *str, uint32_t fid, struct sbuf *sb) in l9p_describe_fid() argument 310 sbuf_printf(sb, "%s%" PRIu32, str, fid); in l9p_describe_fid() 317 l9p_describe_ugid(const char *str, uint32_t ugid, struct sbuf *sb) in l9p_describe_ugid() argument 320 sbuf_printf(sb, "%s%" PRIu32, str, ugid); in l9p_describe_ugid() 329 l9p_describe_mode(const char *str, uint32_t mode, struct sbuf *sb) in l9p_describe_mode() argument [all …]
|
/freebsd/sys/geom/vinum/ |
H A D | geom_vinum_list.c | 53 struct sbuf *sb; in gv_list() local 72 sb = sbuf_new(NULL, NULL, GV_CFG_LEN, SBUF_FIXEDLEN); in gv_list() 93 gv_lvi(v, sb, *flags); in gv_list() 97 gv_lpi(p, sb, *flags); in gv_list() 101 gv_lsi(s, sb, *flags); in gv_list() 105 gv_ldi(d, sb, *flags); in gv_list() 114 gv_ld(gp, req, sb); in gv_list() 115 sbuf_printf(sb, "\n"); in gv_list() 116 gv_lv(gp, req, sb); in gv_list() 117 sbuf_printf(sb, "\n"); in gv_list() [all …]
|
/freebsd/sys/sys/ |
H A D | sockbuf.h | 204 void sbappend(struct sockbuf *sb, struct mbuf *m, int flags); 205 void sbappend_locked(struct sockbuf *sb, struct mbuf *m, int flags); 206 void sbappendstream(struct sockbuf *sb, struct mbuf *m, int flags); 207 void sbappendstream_locked(struct sockbuf *sb, struct mbuf *m, int flags); 208 int sbappendaddr(struct sockbuf *sb, const struct sockaddr *asa, 210 int sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, 212 int sbappendaddr_nospacecheck_locked(struct sockbuf *sb, 214 void sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, 216 void sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0, 218 void sbappendrecord(struct sockbuf *sb, struct mbuf *m0); [all …]
|
H A D | stats.h | 495 #define HIST_HLPR_INFO_EXP_FIELDS(sb, se) \ argument 496 .exp.stepbase = (sb), .exp.stepexp = (se) 498 #define HIST_HLPR_INFO_LINEXP_FIELDS(nss, sb) \ argument 499 .linexp.linstepdiv = (nss), .linexp.stepbase = (sb) 652 struct statsblob *sb; /* Template schema */ member 715 int stats_v1_blob_init(struct statsblobv1 *sb, uint32_t tpl_id, uint32_t flags); 719 void stats_v1_blob_destroy(struct statsblobv1 *sb); 728 int stats_v1_blob_tostr(struct statsblobv1 *sb, struct sbuf *buf, 730 int stats_v1_blob_visit(struct statsblobv1 *sb, stats_blob_visitcb_t func, 734 int stats_v1_voi_update(struct statsblobv1 *sb, int32_t voi_id, [all …]
|
/freebsd/sys/cam/scsi/ |
H A D | smp_all.c | 197 smp_command_decode(uint8_t *smp_request, int request_len, struct sbuf *sb, in smp_command_decode() argument 215 sbuf_cat(sb, "..."); in smp_command_decode() 219 sbuf_printf(sb, "\n%s", line_prefix); in smp_command_decode() 222 sbuf_printf(sb, "%02x ", smp_request[i]); in smp_command_decode() 228 smp_command_sbuf(struct ccb_smpio *smpio, struct sbuf *sb, in smp_command_sbuf() argument 231 sbuf_printf(sb, "%s. ", smp_command_desc(smpio->smp_request[1])); in smp_command_sbuf() 239 smp_command_decode(smpio->smp_request, smpio->smp_request_len, sb, in smp_command_sbuf() 249 smp_error_sbuf(struct ccb_smpio *smpio, struct sbuf *sb) in smp_error_sbuf() argument 253 struct sbuf *sb) in smp_error_sbuf() 263 smp_command_sbuf(smpio, sb, path_str, 80 - strlen(path_str), 80); in smp_error_sbuf() [all …]
|
/freebsd/bin/pax/ |
H A D | file_subs.c | 86 file_mode = arcn->sb.st_mode & FILEBITS; in file_creat() 109 if (nodirs || chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) { in file_creat() 142 res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid); in file_close() 150 arcn->sb.st_mode &= ~(SETBITS); in file_close() 152 set_pmode(arcn->name, arcn->sb.st_mode); in file_close() 154 set_ftime(arcn->name, arcn->sb.st_mtime, arcn->sb.st_atime, 0); in file_close() 168 struct stat sb; in lnk_creat() local 174 if (lstat(arcn->ln_name, &sb) < 0) { in lnk_creat() 180 if (S_ISDIR(sb.st_mode)) { in lnk_creat() 186 return(mk_link(arcn->ln_name, &sb, arcn->name, 0)); in lnk_creat() [all …]
|
/freebsd/sys/dev/bnxt/bnxt_re/ |
H A D | qplib_sp.c | 84 struct creq_query_func_resp_sb *sb; in bnxt_qplib_get_dev_attr() local 100 sbuf.size = sizeof(*sb); in bnxt_qplib_get_dev_attr() 101 sbuf.sb = dma_zalloc_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_get_dev_attr() 103 if (!sbuf.sb) in bnxt_qplib_get_dev_attr() 106 sb = sbuf.sb; in bnxt_qplib_get_dev_attr() 115 attr->max_qp = le32_to_cpu(sb->max_qp); in bnxt_qplib_get_dev_attr() 120 sb->max_qp_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ? in bnxt_qplib_get_dev_attr() 121 BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_rd_atom; in bnxt_qplib_get_dev_attr() 123 sb->max_qp_init_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ? in bnxt_qplib_get_dev_attr() 124 BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_init_rd_atom; in bnxt_qplib_get_dev_attr() [all …]
|
/freebsd/contrib/elftoolchain/libpe/ |
H A D | libpe_buffer.c | 40 PE_SecBuf *sb; in libpe_alloc_buffer() local 42 if ((sb = malloc(sizeof(PE_SecBuf))) == NULL) { in libpe_alloc_buffer() 47 sb->sb_ps = ps; in libpe_alloc_buffer() 48 sb->sb_flags = 0; in libpe_alloc_buffer() 49 sb->sb_pb.pb_align = 1; in libpe_alloc_buffer() 50 sb->sb_pb.pb_off = 0; in libpe_alloc_buffer() 51 sb->sb_pb.pb_size = sz; in libpe_alloc_buffer() 53 if ((sb->sb_pb.pb_buf = malloc(sz)) == NULL) { in libpe_alloc_buffer() 54 free(sb); in libpe_alloc_buffer() 58 sb->sb_flags |= LIBPE_F_BUFFER_MALLOCED; in libpe_alloc_buffer() [all …]
|
/freebsd/sys/netinet/ |
H A D | sctp_sysctl.c | 685 struct sctpstat sb; local 703 memset(&sb, 0, sizeof(sb)); 706 if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { 707 sb.sctps_discontinuitytime.tv_sec = sarry->sctps_discontinuitytime.tv_sec; 708 sb.sctps_discontinuitytime.tv_usec = sarry->sctps_discontinuitytime.tv_usec; 710 sb.sctps_currestab += sarry->sctps_currestab; 711 sb.sctps_activeestab += sarry->sctps_activeestab; 712 sb.sctps_restartestab += sarry->sctps_restartestab; 713 sb.sctps_collisionestab += sarry->sctps_collisionestab; 714 sb.sctps_passiveestab += sarry->sctps_passiveestab; [all …]
|
H A D | accf_tls.c | 40 static int sbfull(struct sockbuf *sb); 47 sbfull(struct sockbuf *sb) in sbfull() argument 50 return (sbused(sb) >= sb->sb_hiwat || sb->sb_mbcnt >= sb->sb_mbmax); in sbfull() 73 struct sockbuf *sb = &so->so_rcv; in so_hastls() local 77 if ((sb->sb_state & SBS_CANTRCVMORE) || sbfull(sb)) in so_hastls() 90 avail = sbavail(sb); in so_hastls() 95 if (sbmget8(sb->sb_mb, 0) != 0x16) in so_hastls() 99 reclen = (uint16_t) sbmget8(sb->sb_mb, 3) << 8; in so_hastls() 100 reclen |= (uint16_t) sbmget8(sb->sb_mb, 4); in so_hastls()
|
/freebsd/sys/cam/ctl/ |
H A D | ctl_scsi_all.c | 100 struct scsi_inquiry_data *inq_data, struct sbuf *sb) in ctl_scsi_command_string() argument 104 sbuf_printf(sb, "%s. CDB: %s", in ctl_scsi_command_string() 125 struct scsi_inquiry_data *inq_data, struct sbuf *sb, in ctl_scsi_sense_sbuf() argument 130 if ((ctsio == NULL) || (sb == NULL)) in ctl_scsi_sense_sbuf() 136 sbuf_cat(sb, path_str); in ctl_scsi_sense_sbuf() 138 ctl_scsi_command_string(ctsio, inq_data, sb); in ctl_scsi_sense_sbuf() 140 sbuf_putc(sb, '\n'); in ctl_scsi_sense_sbuf() 143 scsi_sense_only_sbuf(&ctsio->sense_data, ctsio->sense_len, sb, in ctl_scsi_sense_sbuf() 154 struct sbuf sb; in ctl_scsi_sense_string() local 156 sbuf_new(&sb, st in ctl_scsi_sense_string() 170 struct sbuf sb; ctl_scsi_sense_print() local 187 struct sbuf sb; ctl_scsi_sense_print() local [all...] |
/freebsd/tests/sys/fs/fusefs/ |
H A D | getattr.cc | 79 struct stat sb; in TEST_F() local 100 EXPECT_EQ(0, stat(FULLPATH, &sb)); in TEST_F() 102 EXPECT_EQ(0, stat(FULLPATH, &sb)); in TEST_F() 115 struct stat sb; in TEST_F() local 133 EXPECT_EQ(0, stat(FULLPATH, &sb)); in TEST_F() 136 EXPECT_EQ(0, stat(FULLPATH, &sb)); in TEST_F() 148 struct stat sb; in TEST_F() local 165 ASSERT_EQ(0, stat(FULLPATH, &sb)) << strerror(errno); in TEST_F() 166 EXPECT_EQ((blksize_t)PAGE_SIZE, sb.st_blksize); in TEST_F() 173 struct stat sb; in TEST_F() local [all …]
|
/freebsd/sys/contrib/openzfs/module/os/freebsd/spl/ |
H A D | spl_sysevent.c | 47 struct sbuf *sb; in log_sysevent() local 52 sb = sbuf_new_auto(); in log_sysevent() 53 if (sb == NULL) in log_sysevent() 64 sbuf_printf(sb, " %s=%s", nvpair_name(elem), in log_sysevent() 73 sbuf_printf(sb, " %s=%hhu", nvpair_name(elem), value); in log_sysevent() 81 sbuf_printf(sb, " %s=%jd", nvpair_name(elem), in log_sysevent() 90 sbuf_printf(sb, " %s=%ju", nvpair_name(elem), in log_sysevent() 99 sbuf_printf(sb, " %s=%jd", nvpair_name(elem), in log_sysevent() 108 sbuf_printf(sb, " %s=%ju", nvpair_name(elem), in log_sysevent() 117 sbuf_printf(sb, " %s=%s", nvpair_name(elem), value); in log_sysevent() [all …]
|
/freebsd/sys/dev/axgbe/ |
H A D | xgbe-sysctl.c | 492 struct sbuf *sb; in sysctl_xgmac_reg_addr_handler() local 497 sb = sbuf_new_for_sysctl(NULL, NULL, buf_size, req); in sysctl_xgmac_reg_addr_handler() 498 if (sb == NULL) { in sysctl_xgmac_reg_addr_handler() 505 sbuf_printf(sb, "\nXGMAC reg_addr: 0x%x\n", in sysctl_xgmac_reg_addr_handler() 507 rc = sbuf_finish(sb); in sysctl_xgmac_reg_addr_handler() 508 sbuf_delete(sb); in sysctl_xgmac_reg_addr_handler() 529 struct sbuf *sb; in sysctl_get_drv_info_handler() local 533 sb = sbuf_new_for_sysctl(NULL, NULL, buf_size, req); in sysctl_get_drv_info_handler() 534 if (sb == NULL) { in sysctl_get_drv_info_handler() 539 sbuf_printf(sb, "\ndriver: %s", XGBE_DRV_NAME); in sysctl_get_drv_info_handler() [all …]
|
/freebsd/sys/cam/nvme/ |
H A D | nvme_all.c | 87 const struct nvme_namespace_data *data, struct sbuf *sb) in nvme_print_ident() argument 89 nvme_print_ident_short(cdata, data, sb); in nvme_print_ident() 90 sbuf_putc(sb, '\n'); in nvme_print_ident() 95 const struct nvme_namespace_data *data, struct sbuf *sb) in nvme_print_ident_short() argument 97 sbuf_putc(sb, '<'); in nvme_print_ident_short() 98 cam_strvis_sbuf(sb, cdata->mn, sizeof(cdata->mn), in nvme_print_ident_short() 100 sbuf_putc(sb, ' '); in nvme_print_ident_short() 101 cam_strvis_sbuf(sb, cdata->fr, sizeof(cdata->fr), in nvme_print_ident_short() 103 sbuf_putc(sb, ' '); in nvme_print_ident_short() 104 cam_strvis_sbuf(sb, cdata->sn, sizeof(cdata->sn), in nvme_print_ident_short() [all …]
|
/freebsd/sys/dev/led/ |
H A D | led.c | 89 led_state(struct ledsc *sc, struct sbuf **sb, int state) in led_state() argument 94 sc->spec = *sb; in led_state() 95 if (*sb != NULL) { in led_state() 96 sc->str = sbuf_data(*sb); in led_state() 110 *sb = sb2; in led_state() 115 led_parse(const char *s, struct sbuf **sb, int *state) in led_parse() argument 129 *sb = sbuf_new_auto(); in led_parse() 130 if (*sb == NULL) in led_parse() 142 sbuf_printf(*sb, "%c%c", 'A' + i, 'a' + i); in led_parse() 156 sbuf_cat(*sb, "Aa"); in led_parse() [all …]
|
/freebsd/sys/cam/ |
H A D | cam.c | 135 struct sbuf sb; in cam_strvis_flag() local 137 sbuf_new(&sb, dst, dstlen, SBUF_FIXEDLEN); in cam_strvis_flag() 138 cam_strvis_sbuf(&sb, src, srclen, flags); in cam_strvis_flag() 139 sbuf_finish(&sb); in cam_strvis_flag() 143 cam_strvis_sbuf(struct sbuf *sb, const uint8_t *src, int srclen, in cam_strvis_sbuf() argument 160 sbuf_printf(sb, "\\%c%c%c", in cam_strvis_sbuf() 171 sbuf_putc(sb, *src); in cam_strvis_sbuf() 173 sbuf_putc(sb, ' '); in cam_strvis_sbuf() 176 sbuf_putc(sb, ' '); in cam_strvis_sbuf() 184 sbuf_putc(sb, *src); in cam_strvis_sbuf() [all …]
|
/freebsd/sys/fs/procfs/ |
H A D | procfs_status.c | 91 sbuf_printf(sb, "\\%03o", *pc); in procfs_doprocstatus() 93 sbuf_putc(sb, *pc); in procfs_doprocstatus() 95 sbuf_printf(sb, " %d %d %d %d ", pid, ppid, pgid, sid); in procfs_doprocstatus() 97 sbuf_printf(sb, "%s ", devtoname(tp->t_dev)); in procfs_doprocstatus() 99 sbuf_printf(sb, "- "); in procfs_doprocstatus() 103 sbuf_printf(sb, "%sctty", sep); in procfs_doprocstatus() 107 sbuf_printf(sb, "%ssldr", sep); in procfs_doprocstatus() 112 sbuf_printf(sb, "noflags"); in procfs_doprocstatus() 131 sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld", in procfs_doprocstatus() 136 sbuf_printf(sb, " in procfs_doprocstatus() [all...] |