/freebsd/contrib/ofed/libibmad/ |
H A D | dump.c | 47 void mad_dump_int(char *buf, int bufsz, void *val, int valsz) in mad_dump_int() argument 51 snprintf(buf, bufsz, "%d", *(uint32_t *) val & 0xff); in mad_dump_int() 54 snprintf(buf, bufsz, "%d", *(uint32_t *) val & 0xffff); in mad_dump_int() 58 snprintf(buf, bufsz, "%d", *(uint32_t *) val); in mad_dump_int() 64 snprintf(buf, bufsz, "%" PRIu64, *(uint64_t *) val); in mad_dump_int() 72 void mad_dump_uint(char *buf, int bufsz, void *val, int valsz) in mad_dump_uint() argument 76 snprintf(buf, bufsz, "%u", *(uint32_t *) val & 0xff); in mad_dump_uint() 79 snprintf(buf, bufsz, "%u", *(uint32_t *) val & 0xffff); in mad_dump_uint() 83 snprintf(buf, bufsz, "%u", *(uint32_t *) val); in mad_dump_uint() 89 snprintf(buf, bufsz, "%" PRIu64, *(uint64_t *) val); in mad_dump_uint() [all …]
|
/freebsd/contrib/libder/tests/ |
H A D | test_pubkey.c | 51 test_construction(struct libder_ctx*ctx, const uint8_t *buf, size_t bufsz) in test_construction() argument 82 assert(outsz == bufsz); in test_construction() 83 assert(memcmp(out, buf, bufsz) == 0); in test_construction() 96 size_t bufsz, outsz, rootsz; in main() local 111 bufsz = sb.st_size; in main() 112 buf = malloc(bufsz); in main() 115 readsz = read(fd, buf, bufsz); in main() 118 assert(readsz == bufsz); in main() 121 rootsz = bufsz; in main() 126 assert(rootsz == bufsz); in main() [all …]
|
H A D | test_privkey.c | 67 test_construction(struct libder_ctx *ctx, const uint8_t *buf, size_t bufsz) in test_construction() argument 113 assert(outsz == bufsz); in test_construction() 115 assert(memcmp(out, buf, bufsz) == 0); in test_construction() 128 size_t bufsz, outsz, rootsz; in main() local 143 bufsz = sb.st_size; in main() 144 buf = malloc(bufsz); in main() 147 readsz = read(fd, buf, bufsz); in main() 150 assert(readsz == bufsz); in main() 153 rootsz = bufsz; in main() 158 assert(rootsz == bufsz); in main() [all …]
|
/freebsd/crypto/openssl/apps/lib/ |
H A D | app_params.c | 13 static int describe_param_type(char *buf, size_t bufsz, const OSSL_PARAM *param) in describe_param_type() argument 45 printed_len = BIO_snprintf(buf, bufsz, "%s: ", param->key); in describe_param_type() 48 bufsz -= printed_len; in describe_param_type() 50 printed_len = BIO_snprintf(buf, bufsz, "%s%s", type_mod, type); in describe_param_type() 53 bufsz -= printed_len; in describe_param_type() 56 printed_len = BIO_snprintf(buf, bufsz, " [%d]", param->data_type); in describe_param_type() 59 bufsz -= printed_len; in describe_param_type() 63 printed_len = BIO_snprintf(buf, bufsz, " (arbitrary size)"); in describe_param_type() 65 printed_len = BIO_snprintf(buf, bufsz, " (max %zu bytes large)", in describe_param_type() 69 bufsz -= printed_len; in describe_param_type()
|
/freebsd/contrib/libder/libder/ |
H A D | libder_write.c | 16 size_t bufsz; member 158 left = mwrite->bufsz - mwrite->offset; in memory_write() 176 size_t *bufsz) in libder_write() argument 186 if ((buf == NULL && *bufsz != 0) || (buf != NULL && *bufsz == 0)) in libder_write() 202 if (*bufsz == 0) { in libder_write() 203 *bufsz = needed; in libder_write() 207 } else if (needed > *bufsz) { in libder_write() 208 *bufsz = needed; in libder_write() 214 mwrite.bufsz = *bufsz; in libder_write() 226 *bufsz = mwrite.offset; in libder_write()
|
/freebsd/contrib/mandoc/ |
H A D | compat_getline.c | 25 getline(char **buf, size_t *bufsz, FILE *fp) in getline() argument 31 if (buf == NULL || bufsz == NULL) { in getline() 37 *bufsz = 0; in getline() 43 if (pos + 1 >= *bufsz) { in getline() 44 nbufsz = *bufsz ? *bufsz * 2 : BUFSIZ; in getline() 48 *bufsz = nbufsz; in getline()
|
/freebsd/tests/sys/kern/tty/ |
H A D | readsz.c | 32 size_t bufsz = 0, reps; in main() local 64 bufsz = strtonum(optarg, 1, SSIZE_MAX, &errstr); in main() 73 if (bufsz == 0) { in main() 75 bufsz = reps; in main() 77 bufsz = LINE_MAX; in main() 80 buf = malloc(bufsz); in main() 92 readsz = MIN(bufsz, reps); in main() 94 readsz = bufsz; in main()
|
/freebsd/sys/contrib/dev/iwlwifi/mvm/ |
H A D | debugfs-vif.c | 144 int bufsz = sizeof(buf); in iwl_dbgfs_tx_pwr_lmt_read() local 147 pos = scnprintf(buf, bufsz, "bss limit = %d\n", in iwl_dbgfs_tx_pwr_lmt_read() 161 int bufsz = sizeof(buf); in iwl_dbgfs_pm_params_read() local 164 pos = iwl_mvm_power_mac_dbgfs_read(mvm, vif, buf, bufsz); in iwl_dbgfs_pm_params_read() 179 int bufsz = sizeof(buf); in iwl_dbgfs_mac_params_read() local 189 pos += scnprintf(buf+pos, bufsz-pos, "type: ibss\n"); in iwl_dbgfs_mac_params_read() 192 pos += scnprintf(buf+pos, bufsz-pos, "type: bss\n"); in iwl_dbgfs_mac_params_read() 195 pos += scnprintf(buf+pos, bufsz-pos, "type: ap\n"); in iwl_dbgfs_mac_params_read() 198 pos += scnprintf(buf+pos, bufsz-pos, "type: p2p client\n"); in iwl_dbgfs_mac_params_read() 201 pos += scnprintf(buf+pos, bufsz-pos, "type: p2p go\n"); in iwl_dbgfs_mac_params_read() [all …]
|
H A D | debugfs.c | 319 int bufsz = sizeof(buf); in iwl_dbgfs_sar_geo_profile_read() 333 pos = scnprintf(buf, bufsz, in iwl_dbgfs_sar_geo_profile_read() 336 pos += scnprintf(buf + pos, bufsz - pos, in iwl_dbgfs_sar_geo_profile_read() 338 pos += scnprintf(buf + pos, bufsz - pos, in iwl_dbgfs_sar_geo_profile_read() 343 pos += scnprintf(buf + pos, bufsz - pos, in iwl_dbgfs_sar_geo_profile_read() 379 int i, pos = 0, bufsz = sizeof(buf); in iwl_dbgfs_stations_read() 384 pos += scnprintf(buf + pos, bufsz - pos, "%.2d: ", i); in iwl_dbgfs_stations_read() 388 pos += scnprintf(buf + pos, bufsz - pos, "N/A\n"); in iwl_dbgfs_stations_read() 390 pos += scnprintf(buf + pos, bufsz - pos, "%ld\n", in iwl_dbgfs_stations_read() 393 pos += scnprintf(buf + pos, bufsz in iwl_dbgfs_stations_read() 310 int bufsz = sizeof(buf); iwl_dbgfs_sar_geo_profile_read() local 372 int i, pos = 0, bufsz = sizeof(buf); iwl_dbgfs_stations_read() local 403 static const size_t bufsz = 2048; iwl_dbgfs_rs_data_read() local 495 int bufsz = sizeof(buf); iwl_dbgfs_disable_power_off_read() local 535 iwl_mvm_coex_dump_mbox(struct iwl_bt_coex_profile_notif * notif,char * buf,int pos,int bufsz) iwl_mvm_coex_dump_mbox() argument 599 int ret, pos = 0, bufsz = sizeof(char) * 1024; iwl_dbgfs_bt_notif_read() local 643 int bufsz = sizeof(buf); iwl_dbgfs_bt_cmd_read() local 718 static const size_t bufsz = 1024; iwl_dbgfs_fw_ver_read() local 755 static const size_t bufsz = 1024; iwl_dbgfs_tas_get_status_read() local 938 size_t bufsz; iwl_dbgfs_phy_integration_ver_read() local 971 size_t bufsz; iwl_dbgfs_fw_rx_stats_read() local 1159 static const size_t bufsz = 1024; iwl_dbgfs_frame_stats_read() local 1279 const size_t bufsz = sizeof(buf); iwl_dbgfs_scan_ant_rxchain_read() local 1527 const size_t bufsz = sizeof(buf); iwl_dbgfs_fw_dbg_conf_read() local 1597 MVM_DEBUGFS_WRITE_FILE_OPS(name,bufsz) global() argument 1599 MVM_DEBUGFS_READ_WRITE_FILE_OPS(name,bufsz) global() argument 1698 MVM_DEBUGFS_WRITE_LINK_STA_FILE_OPS(name,bufsz) global() argument 1714 MVM_DEBUGFS_READ_WRITE_LINK_STA_FILE_OPS(name,bufsz) global() argument 1738 const size_t bufsz = sizeof(buf); iwl_dbgfs_prph_reg_read() local 1888 size_t bufsz = sizeof(buf); iwl_dbgfs_uapsd_noagg_bssids_read() local [all...] |
H A D | power.c | 715 int bufsz) in iwl_mvm_power_mac_dbgfs_read() 725 pos += scnprintf(buf+pos, bufsz-pos, "power_scheme = %d\n", in iwl_mvm_power_mac_dbgfs_read() 727 pos += scnprintf(buf+pos, bufsz-pos, "flags = 0x%x\n", in iwl_mvm_power_mac_dbgfs_read() 729 pos += scnprintf(buf+pos, bufsz-pos, "keep_alive = %d\n", in iwl_mvm_power_mac_dbgfs_read() 735 pos += scnprintf(buf+pos, bufsz-pos, "skip_over_dtim = %d\n", in iwl_mvm_power_mac_dbgfs_read() 738 pos += scnprintf(buf+pos, bufsz-pos, "skip_dtim_periods = %d\n", in iwl_mvm_power_mac_dbgfs_read() 741 pos += scnprintf(buf+pos, bufsz-pos, "rx_data_timeout = %d\n", in iwl_mvm_power_mac_dbgfs_read() 743 pos += scnprintf(buf+pos, bufsz-pos, "tx_data_timeout = %d\n", in iwl_mvm_power_mac_dbgfs_read() 747 pos += scnprintf(buf+pos, bufsz-pos, in iwl_mvm_power_mac_dbgfs_read() 754 pos += scnprintf(buf+pos, bufsz in iwl_mvm_power_mac_dbgfs_read() 702 iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm * mvm,struct ieee80211_vif * vif,char * buf,int bufsz) iwl_mvm_power_mac_dbgfs_read() argument [all...] |
/freebsd/contrib/elftoolchain/libelf/ |
H A D | libelf_open.c | 53 size_t bufsz, datasz; in _libelf_read_special_file() local 58 bufsz = _LIBELF_INITSIZE; in _libelf_read_special_file() 59 if ((buf = malloc(bufsz)) == NULL) in _libelf_read_special_file() 68 if (datasz == bufsz) { in _libelf_read_special_file() 69 bufsz *= 2; in _libelf_read_special_file() 70 if ((t = realloc(buf, bufsz)) == NULL) in _libelf_read_special_file() 76 assert(bufsz - datasz > 0); in _libelf_read_special_file() 78 if ((readsz = read(fd, t, bufsz - datasz)) <= 0) in _libelf_read_special_file() 81 } while (datasz < bufsz); in _libelf_read_special_file() 95 if (bufsz > datasz) { in _libelf_read_special_file()
|
/freebsd/tests/sys/geom/class/eli/ |
H A D | unaligned_io.c | 53 size_t bufsz, iosz; in main() local 76 bufsz = iosz + secsz; in main() 77 buf1 = mmap(NULL, bufsz, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, in main() 81 buf2 = mmap(NULL, bufsz, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, in main() 86 arc4random_buf(buf1, bufsz); in main() 87 n = pwrite(fd, buf1, bufsz, 0); in main() 88 if (n < 0 || (size_t)n != bufsz) in main() 118 arc4random_buf(buf1, bufsz); in main()
|
/freebsd/tools/bus_space/ |
H A D | bus.c | 130 bs_read(int rid, off_t ofs, void *buf, ssize_t bufsz) in bs_read() argument 140 if (ofs < 0 || ofs > r->size - bufsz) { in bs_read() 147 switch (bufsz) { in bs_read() 165 s = read(r->fd, buf, bufsz); in bs_read() 166 if (s != bufsz) in bs_read() 228 bs_write(int rid, off_t ofs, void *buf, ssize_t bufsz) in bs_write() argument 238 if (ofs < 0 || ofs > r->size - bufsz) { in bs_write() 245 switch (bufsz) { in bs_write() 263 s = write(r->fd, buf, bufsz); in bs_write() 264 if (s != bufsz) in bs_write()
|
/freebsd/bin/pkill/tests/ |
H A D | spin_helper.c | 60 size_t bufsz = ARG_MAX - in exec_largeargs() local 74 s = malloc(bufsz + 1); in exec_largeargs() 76 s = realloc(s, bufsz + 1); in exec_largeargs() 79 memset(s, 'x', bufsz); in exec_largeargs() 80 s[bufsz] = '\0'; in exec_largeargs() 84 bufsz--; in exec_largeargs()
|
/freebsd/tools/test/stress2/misc/ |
H A D | mmap42.sh | 33 size_t bufsz; 42 bufsz = sb.st_size; 43 buf = obuf = mmap(NULL, bufsz, PROT_READ, MAP_SHARED, mfd, 0); 53 while (bufsz > 0) { 54 wsz = write(fd, buf, bufsz); 59 bufsz -= wsz; 63 bufsz = sb.st_size;
|
H A D | zfs18.sh | 35 size_t bufsz; 44 bufsz = sb.st_size; 45 buf = obuf = mmap(NULL, bufsz, PROT_READ, MAP_SHARED, mfd, 0); 55 while (bufsz > 0) { 56 wsz = write(fd, buf, bufsz); 61 bufsz -= wsz; 65 bufsz = sb.st_size;
|
H A D | mmap43.sh | 32 size_t bufsz; 41 bufsz = sb.st_size; 42 buf = obuf = mmap(NULL, bufsz, PROT_READ, MAP_SHARED, mfd, 0); 52 while (bufsz > 0) { 53 wsz = write(fd, buf, bufsz); 58 bufsz -= wsz; 62 bufsz = sb.st_size;
|
/freebsd/sys/contrib/dev/mediatek/mt76/mt7996/ |
H A D | debugfs.c | 134 static const size_t bufsz = 1024; in mt7996_sys_recovery_get() local 136 buff = kmalloc(bufsz, GFP_KERNEL); in mt7996_sys_recovery_get() 141 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get() 143 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get() 145 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get() 147 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get() 149 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get() 151 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get() 153 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get() 155 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get() [all …]
|
/freebsd/crypto/openssl/crypto/sha/ |
H A D | sha3.c | 18 ctx->bufsz = 0; in ossl_sha3_reset() 54 if ((num = ctx->bufsz) != 0) { /* process intermediate buffer? */ in ossl_sha3_update() 59 ctx->bufsz += len; in ossl_sha3_update() 70 ctx->bufsz = 0; in ossl_sha3_update() 81 ctx->bufsz = rem; in ossl_sha3_update() 90 size_t num = ctx->bufsz; in ossl_sha3_final()
|
/freebsd/sys/dev/sound/macio/ |
H A D | aoa.c | 65 u_int bufsz; /* buffer size */ member 77 KASSERT(dma->bufsz == sndbuf_getsize(dma->buf), ("bad size")); in aoa_dma_set_program() 79 dma->slots = dma->bufsz / dma->blksz; in aoa_dma_set_program() 129 dma->bufsz = AOA_BUFFER_SIZE; in aoa_dma_create() 164 if (blocksz > dma->bufsz) in aoa_chan_setblocksize() 165 blocksz = dma->bufsz; in aoa_chan_setblocksize() 167 err = sndbuf_resize(dma->buf, dma->bufsz / blocksz, blocksz); in aoa_chan_setblocksize() 177 err = dbdma_resize_channel(dma->channel, 2 + dma->bufsz / blocksz); in aoa_chan_setblocksize() 238 max_slots = 2 + dma->bufsz / dma->blksz; in aoa_chan_init() 246 if (sndbuf_alloc(dma->buf, dma->tag, 0, dma->bufsz) != 0) { in aoa_chan_init()
|
/freebsd/crypto/openssl/providers/implementations/ciphers/ |
H A D | ciphercommon.c | 194 ctx->bufsz = 0; in cipher_generic_init_internal() 337 if (ctx->bufsz != 0) in ossl_cipher_generic_block_update() 338 nextblocks = ossl_cipher_fillblock(ctx->buf, &ctx->bufsz, blksz, in ossl_cipher_generic_block_update() 348 if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) { in ossl_cipher_generic_block_update() 357 ctx->bufsz = 0; in ossl_cipher_generic_block_update() 384 && !ossl_cipher_trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) { in ossl_cipher_generic_block_update() 415 ossl_cipher_padblock(ctx->buf, &ctx->bufsz, blksz); in ossl_cipher_generic_block_final() 416 } else if (ctx->bufsz == 0) { in ossl_cipher_generic_block_final() 419 } else if (ctx->bufsz != blksz) { in ossl_cipher_generic_block_final() 432 ctx->bufsz = 0; in ossl_cipher_generic_block_final() [all …]
|
/freebsd/sys/contrib/openzfs/tests/zfs-tests/cmd/ |
H A D | mkfile.c | 63 size_t bufsz = 0; in main() local 206 if (bufsz != st.st_blksize) { in main() 209 bufsz = (size_t)st.st_blksize; in main() 210 buf = calloc(1, bufsz); in main() 214 " size %d\n"), (int)bufsz); in main() 216 bufsz = 0; in main() 225 size_t bytes = (size_t)MIN(bufsz, size-written); in main()
|
/freebsd/tools/tools/so_splice/ |
H A D | proxy.c | 48 size_t bufsz; member 77 buf = malloc(sc->bufsz); in proxy_copy() 95 n = read(rs, buf, sc->bufsz); in proxy_copy() 388 size_t bufsz, enum proxy_mode mode, bool loopback) in proxy_init() argument 393 sc->bufsz = bufsz; in proxy_init() 403 size_t bufsz; in main() local 412 bufsz = 2 * 1024 * 1024ul; in main() 431 bufsz = atoi(optarg); in main() 445 proxy_init(&sc, laddr, taddr, bufsz, mode, loopback); in main()
|
/freebsd/lib/libveriexec/ |
H A D | veriexec_get.c | 99 veriexec_get_path_label(const char *file, char *buf, size_t bufsz) in veriexec_get_path_label() argument 108 if (buf != NULL && bufsz > params.labellen) { in veriexec_get_path_label() 109 strlcpy(buf, params.label, bufsz); in veriexec_get_path_label() 137 veriexec_get_pid_label(pid_t pid, char *buf, size_t bufsz) in veriexec_get_pid_label() argument 146 if (buf != NULL && bufsz > params.labellen) { in veriexec_get_pid_label() 147 strlcpy(buf, params.label, bufsz); in veriexec_get_pid_label()
|
/freebsd/stand/efi/libefi/ |
H A D | eficom.c | 95 UINTN bufsz = 0; in efi_serial_init() local 104 status = BS->LocateHandle(ByProtocol, &serial, NULL, &bufsz, handles); in efi_serial_init() 108 if ((handles = malloc(bufsz)) == NULL) in efi_serial_init() 111 *nhandles = (int)(bufsz / sizeof (EFI_HANDLE)); in efi_serial_init() 115 status = BS->LocateHandle(ByProtocol, &serial, NULL, &bufsz, handles); in efi_serial_init() 404 UINTN bufsz = 1; in comc_putchar() local 411 status = comc_port->sio->Write(comc_port->sio, &bufsz, &cb); in comc_putchar() 421 UINTN bufsz = 1; in comc_getchar() local 438 status = comc_port->sio->Read(comc_port->sio, &bufsz, &c); in comc_getchar() 439 if (EFI_ERROR(status) || bufsz == 0) in comc_getchar()
|