| /dflybsd-src/usr.bin/bdes/ |
| H A D | bdes.c | 663 int nbytes; /* number of bytes to read */ in cfbenc() local 671 nbytes = fbbits / 8; in cfbenc() 675 for (bn = 1; (n = READ(ibuf, nbytes)) == nbytes; bn++) { in cfbenc() 678 for (n = 0; n < 8 - nbytes; n++) in cfbenc() 679 ivec[n] = ivec[n+nbytes]; in cfbenc() 680 for (n = 0; n < nbytes; n++) in cfbenc() 681 ivec[8 - nbytes + n] = ibuf[n] ^ msgbuf[n]; in cfbenc() 682 WRITE(&ivec[8 - nbytes], nbytes); in cfbenc() 689 MEMZERO(&ibuf[n], nbytes - n); in cfbenc() 690 ibuf[nbytes - 1] = n; in cfbenc() [all …]
|
| /dflybsd-src/sys/dev/drm/include/linux/ |
| H A D | kfifo.h | 63 _kfifo_alloc(struct kfifo_meta *meta, void *bufp, size_t nbytes, gfp_t gfp) in _kfifo_alloc() argument 67 buf = kmalloc(nbytes, M_DRM, gfp); in _kfifo_alloc() 77 meta->kfm_nbytes = nbytes; in _kfifo_alloc() 108 const size_t nbytes = meta->kfm_nbytes; in _kfifo_len() local 110 return (head <= tail ? tail - head : nbytes + tail - head); in _kfifo_len() 126 const size_t nbytes = meta->kfm_nbytes; in _kfifo_out_peek() local 133 if (size <= nbytes - head) { in _kfifo_out_peek() 136 } else if (size <= nbytes + tail - head) { in _kfifo_out_peek() 137 memcpy(dst, src + head, nbytes - head); in _kfifo_out_peek() 138 memcpy(dst + nbytes - head, src, in _kfifo_out_peek() [all …]
|
| /dflybsd-src/sbin/ipfw3/ |
| H A D | ipfw3nat.c | 138 nat_config_show(char *buf, int nbytes, int nat_id) in nat_config_show() argument 144 while (len < nbytes) { in nat_config_show() 167 int nbytes, nalloc; in nat_config_get() local 180 nbytes = nalloc; in nat_config_get() 181 while (nbytes >= nalloc) { in nat_config_get() 183 nbytes = nalloc; in nat_config_get() 184 if ((data = realloc(data, nbytes)) == NULL) { in nat_config_get() 187 if (do_get_x(IP_FW_NAT_GET, data, &nbytes) < 0) { in nat_config_get() 191 if (nbytes == 0) { in nat_config_get() 194 nat_config_show(data, nbytes, nat_id); in nat_config_get() [all …]
|
| H A D | ipfw3state.c | 133 int nbytes, nalloc; in state_list() local 146 nbytes = nalloc; in state_list() 147 while (nbytes >= nalloc) { in state_list() 149 nbytes = nalloc; in state_list() 150 if ((data = realloc(data, nbytes)) == NULL) { in state_list() 154 if (do_get_x(IP_FW_STATE_GET, data, &nbytes) < 0) { in state_list() 159 if (nbytes == 0) in state_list() 164 int count = nbytes / LEN_IOC_FW3_STATE; in state_list()
|
| H A D | ipfw3table.c | 226 int i, count, nbytes, nalloc = 1024; in table_list() local 230 nbytes = nalloc; in table_list() 231 while (nbytes >= nalloc) { in table_list() 233 nbytes = nalloc; in table_list() 234 if ((data = realloc(data, nbytes)) == NULL) in table_list() 236 if (do_get_x(IP_FW_TABLE_LIST, data, &nbytes) < 0) in table_list() 240 count = nbytes / sizeof(struct ipfw_ioc_table); in table_list() 302 int nbytes, nalloc = 1024; in table_show() local 306 nbytes = nalloc; in table_show() 307 while (nbytes >= nalloc) { in table_show() [all …]
|
| /dflybsd-src/lib/libc/db/btree/ |
| H A D | bt_split.c | 85 uint32_t n, nbytes, nksize; in __bt_split() local 173 nbytes = NBINTERNAL(bi->ksize); in __bt_split() 177 nbytes = NBINTERNAL(bl->ksize); in __bt_split() 187 if (n < nbytes) { in __bt_split() 189 bt_pfxsaved += nbytes - n; in __bt_split() 191 nbytes = n; in __bt_split() 199 nbytes = NRINTERNAL; in __bt_split() 206 if ((uint32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) { in __bt_split() 209 bt_root(t, h, &l, &r, &skip, nbytes) : in __bt_split() 210 bt_page(t, h, &l, &r, &skip, nbytes); in __bt_split() [all …]
|
| /dflybsd-src/contrib/file/src/ |
| H A D | encoding.c | 80 size_t nbytes = b->flen; in file_encoding() local 96 if (nbytes > ms->encoding_max) in file_encoding() 97 nbytes = ms->encoding_max; in file_encoding() 99 mlen = (nbytes + 1) * sizeof((*ubuf)[0]); in file_encoding() 105 if (looks_ascii(buf, nbytes, *ubuf, ulen)) { in file_encoding() 106 if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding() 115 } else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding() 119 } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) { in file_encoding() 123 } else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding() 132 } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding() [all …]
|
| H A D | softmagic.c | 835 size_t nbytes = b->flen; in moffset() local 952 o = der_offs(ms, m, nbytes); in moffset() 953 if (o == -1 || CAST(size_t, o) > nbytes) { in moffset() 957 SIZE_T_FORMAT "u", o, nbytes); in moffset() 973 if (CAST(size_t, o) > nbytes) { in moffset() 976 "u > %" SIZE_T_FORMAT "u", (size_t)o, nbytes); in moffset() 1321 const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) in mcopy() argument 1331 if (offset > nbytes) in mcopy() 1332 offset = CAST(uint32_t, nbytes); in mcopy() 1334 ms->search.s_len = nbytes - offset; in mcopy() [all …]
|
| H A D | ascmagic.c | 62 trim_nuls(const unsigned char *buf, size_t nbytes) in trim_nuls() argument 64 while (nbytes > 1 && buf[nbytes - 1] == '\0') in trim_nuls() 65 nbytes--; in trim_nuls() 67 return nbytes; in trim_nuls() 111 size_t nbytes = b->flen; in file_ascmagic_with_encoding() local 133 nbytes = trim_nuls(buf, nbytes); in file_ascmagic_with_encoding() 136 if (nbytes <= 1) { in file_ascmagic_with_encoding() 210 if (seen_cr && nbytes < ms->bytes_max) in file_ascmagic_with_encoding()
|
| /dflybsd-src/sys/kern/ |
| H A D | kern_fp.c | 204 fp_pread(file_t fp, void *buf, size_t nbytes, off_t offset, ssize_t *res, in fp_pread() argument 214 if (nbytes > LONG_MAX) in fp_pread() 218 aiov.iov_len = nbytes; in fp_pread() 222 auio.uio_resid = nbytes; in fp_pread() 227 count = nbytes; in fp_pread() 230 if (auio.uio_resid != nbytes && (error == ERESTART || error == EINTR || in fp_pread() 243 fp_read(file_t fp, void *buf, size_t nbytes, ssize_t *res, int all, in fp_read() argument 253 if (nbytes > LONG_MAX) in fp_read() 257 aiov.iov_len = nbytes; in fp_read() 261 auio.uio_resid = nbytes; in fp_read() [all …]
|
| /dflybsd-src/bin/sh/ |
| H A D | memalloc.c | 65 ckmalloc(size_t nbytes) in ckmalloc() argument 71 p = malloc(nbytes); in ckmalloc() 83 ckrealloc(pointer p, int nbytes) in ckrealloc() argument 87 p = realloc(p, nbytes); in ckrealloc() 144 stnewblock(int nbytes) in stnewblock() argument 149 if (nbytes < MINSIZE) in stnewblock() 150 nbytes = MINSIZE; in stnewblock() 152 allocsize = ALIGN(sizeof(struct stack_block)) + ALIGN(nbytes); in stnewblock() 166 stalloc(int nbytes) in stalloc() argument 170 nbytes = ALIGN(nbytes); in stalloc() [all …]
|
| /dflybsd-src/contrib/cvs-1.12/src/ |
| H A D | socket-client.c | 66 int nbytes; in socket_buffer_input() local 92 nbytes = recv (sb->socket, data + *got, size - *got, 0); in socket_buffer_input() 93 if (nbytes < 0) in socket_buffer_input() 96 if (nbytes == 0) in socket_buffer_input() 107 *got += nbytes; in socket_buffer_input() 139 int nbytes; in socket_buffer_output() local 141 nbytes = send (sb->socket, data, have, 0); in socket_buffer_output() 142 if (nbytes < 0) in socket_buffer_output() 146 have -= nbytes; in socket_buffer_output() 147 data += nbytes; in socket_buffer_output()
|
| H A D | buffer.c | 286 size_t nbytes; in buf_send_output() local 289 &nbytes); in buf_send_output() 297 if (nbytes != data->size) in buf_send_output() 305 data->size -= nbytes; in buf_send_output() 306 data->bufp += nbytes; in buf_send_output() 740 size_t get, nbytes; in buf_input_data() local 771 0, get, &nbytes); in buf_input_data() 775 buf->last->size += nbytes; in buf_input_data() 777 *countp += nbytes; in buf_input_data() 779 if (nbytes < get) in buf_input_data() [all …]
|
| /dflybsd-src/lib/libc/stdio/ |
| H A D | xprintf_str.c | 61 size_t clen, nbytes; in __wcsconv() local 67 nbytes = wcsrtombs(NULL, (const wchar_t **)&p, 0, &mbs); in __wcsconv() 68 if (nbytes == (size_t)-1) in __wcsconv() 77 nbytes = prec; in __wcsconv() 79 nbytes = 0; in __wcsconv() 85 (int)(nbytes + clen) > prec) in __wcsconv() 87 nbytes += clen; in __wcsconv() 91 if ((convbuf = malloc(nbytes + 1)) == NULL) in __wcsconv() 97 if ((nbytes = wcsrtombs(convbuf, (const wchar_t **)&p, in __wcsconv() 98 nbytes, &mbs)) == (size_t)-1) { in __wcsconv() [all …]
|
| /dflybsd-src/lib/libalias/ |
| H A D | alias_util.c | 62 PacketAliasInternetChecksum(u_short *ptr, int nbytes) in PacketAliasInternetChecksum() argument 67 while (nbytes > 1) in PacketAliasInternetChecksum() 70 nbytes -= 2; in PacketAliasInternetChecksum() 72 if (nbytes == 1) in PacketAliasInternetChecksum() 97 int nhdr, ntcp, nbytes; in TcpChecksum() local 107 nbytes = ntcp; in TcpChecksum() 109 while (nbytes > 1) in TcpChecksum() 112 nbytes -= 2; in TcpChecksum() 114 if (nbytes == 1) in TcpChecksum()
|
| /dflybsd-src/contrib/tcsh-6/ |
| H A D | tc.alloc.c | 177 malloc(size_t nbytes) in malloc() argument 198 nbytes++; in malloc() 201 nbytes = MEMALIGN(MEMALIGN(sizeof(union overhead)) + nbytes + RSLOP); in malloc() 202 shiftr = (nbytes - 1) >> 2; in malloc() 219 xprintf(CGETS(19, 1, "nbytes=%zu: Out of memory\n"), nbytes); in malloc() 234 p->ov_size = (p->ov_index <= 13) ? (U_short)nbytes - 1 : 0; in malloc() 236 *((U_int *) (((caddr_t) p) + nbytes - RSLOP)) = RMAGIC; in malloc() 240 if (nbytes) in malloc() 386 realloc(ptr_t cp, size_t nbytes) in realloc() argument 396 return (malloc(nbytes)); in realloc() [all …]
|
| /dflybsd-src/test/debug/ |
| H A D | vmpagequeues.c | 81 static void kkread(kvm_t *kd, u_long addr, void *buf, size_t nbytes); 82 static int kkread_err(kvm_t *kd, u_long addr, void *buf, size_t nbytes); 157 kkread(kvm_t *kd, u_long addr, void *buf, size_t nbytes) in kkread() argument 159 if (kvm_read(kd, addr, buf, nbytes) != nbytes) { in kkread() 166 kkread_err(kvm_t *kd, u_long addr, void *buf, size_t nbytes) in kkread_err() argument 168 if (kvm_read(kd, addr, buf, nbytes) != nbytes) { in kkread_err()
|
| /dflybsd-src/lib/libc/locale/ |
| H A D | wcsnrtombs.c | 65 size_t nbytes; in __wcsnrtombs_std() local 69 nbytes = 0; in __wcsnrtombs_std() 77 return (nbytes + nb - 1); in __wcsnrtombs_std() 79 nbytes += nb; in __wcsnrtombs_std() 81 return (nbytes); in __wcsnrtombs_std() 113 return (nbytes + nb - 1); in __wcsnrtombs_std() 118 nbytes += nb; in __wcsnrtombs_std() 121 return (nbytes); in __wcsnrtombs_std()
|
| /dflybsd-src/sbin/dump/ |
| H A D | cache.c | 103 cread(int fd, void *buf, size_t nbytes, off_t offset) in cread() argument 118 return(pread(fd, buf, nbytes, offset)); in cread() 129 if (nbytes >= (unsigned)BlockSize || in cread() 130 ((offset ^ (offset + nbytes - 1)) & mask) != 0) { in cread() 131 return(pread(fd, buf, nbytes, offset)); in cread() 159 bcopy(blk->b_Data + (offset - blk->b_Offset), buf, nbytes); in cread() 163 return(nbytes); in cread() 165 return(pread(fd, buf, nbytes, offset)); in cread()
|
| /dflybsd-src/sys/bus/isa/x86_64/ |
| H A D | isa_dma.c | 211 isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan) in isa_dmastart() argument 221 if ((chan < 4 && nbytes > (1<<16)) in isa_dmastart() 222 || (chan >= 4 && (nbytes > (1<<17) || (u_int)(uintptr_t)addr & 1))) in isa_dmastart() 241 if (isa_dmarangecheck(addr, nbytes, chan)) { in isa_dmastart() 243 || dma_bouncebufsize[chan] < nbytes) in isa_dmastart() 250 bcopy(addr, newaddr, nbytes); in isa_dmastart() 291 outb(waport + 1, --nbytes); in isa_dmastart() 292 outb(waport + 1, nbytes>>8); in isa_dmastart() 324 nbytes >>= 1; in isa_dmastart() 325 outb(waport + 2, --nbytes); in isa_dmastart() [all …]
|
| /dflybsd-src/libexec/rtld-elf/ |
| H A D | malloc.c | 135 malloc(size_t nbytes) in malloc() argument 170 if (nbytes <= (unsigned long)(n = pagesz - sizeof (*op) - RSLOP)) { in malloc() 183 while (nbytes > amt + n) { in malloc() 210 op->ov_size = roundup2(nbytes, RSLOP); in malloc() 320 realloc(void *cp, size_t nbytes) in realloc() argument 329 return (malloc(nbytes)); in realloc() 367 if (nbytes <= onb && nbytes > (size_t)i) { in realloc() 369 op->ov_size = roundup2(nbytes, RSLOP); in realloc() 376 if ((res = malloc(nbytes)) == NULL) in realloc() 379 bcopy(cp, res, (nbytes < onb) ? nbytes : onb); in realloc()
|
| /dflybsd-src/contrib/gdb-7/bfd/ |
| H A D | cache.c | 258 cache_bread_1 (struct bfd *abfd, void *buf, file_ptr nbytes) in cache_bread_1() argument 271 if (nbytes == 0) in cache_bread_1() 281 nread = read (fileno (f), buf, nbytes); in cache_bread_1() 291 nread = fread (buf, 1, nbytes, f); in cache_bread_1() 295 if (nread < nbytes && ferror (f)) in cache_bread_1() 301 if (nread < nbytes) in cache_bread_1() 309 cache_bread (struct bfd *abfd, void *buf, file_ptr nbytes) in cache_bread() argument 316 while (nread < nbytes) in cache_bread() 319 file_ptr chunk_size = nbytes - nread; in cache_bread() 346 cache_bwrite (struct bfd *abfd, const void *where, file_ptr nbytes) in cache_bwrite() argument [all …]
|
| /dflybsd-src/sys/vfs/isofs/cd9660/ |
| H A D | cd9660_bmap.c | 84 off_t nbytes; in cd9660_bmap() local 86 nbytes = (off_t)ip->i_size - loffset; in cd9660_bmap() 87 if (nbytes < bsize) in cd9660_bmap() 89 else if (nbytes > MAXBSIZE) in cd9660_bmap() 92 *ap->a_runp = rounddown2((int)nbytes, bsize); in cd9660_bmap()
|
| /dflybsd-src/contrib/binutils-2.27/bfd/ |
| H A D | cache.c | 302 cache_bread_1 (struct bfd *abfd, void *buf, file_ptr nbytes) in cache_bread_1() argument 315 if (nbytes == 0) in cache_bread_1() 325 nread = read (fileno (f), buf, nbytes); in cache_bread_1() 335 nread = fread (buf, 1, nbytes, f); in cache_bread_1() 339 if (nread < nbytes && ferror (f)) in cache_bread_1() 345 if (nread < nbytes) in cache_bread_1() 353 cache_bread (struct bfd *abfd, void *buf, file_ptr nbytes) in cache_bread() argument 360 while (nread < nbytes) in cache_bread() 363 file_ptr chunk_size = nbytes - nread; in cache_bread() 390 cache_bwrite (struct bfd *abfd, const void *where, file_ptr nbytes) in cache_bwrite() argument [all …]
|
| /dflybsd-src/lib/libc/db/recno/ |
| H A D | rec_delete.c | 148 uint32_t nbytes; in __rec_dleaf() local 165 nbytes = NRLEAF(rl); in __rec_dleaf() 172 memmove(from + nbytes, from, (char *)to - from); in __rec_dleaf() 173 h->upper += nbytes; in __rec_dleaf() 178 ip[0] += nbytes; in __rec_dleaf() 180 ip[0] = ip[1] < offset ? ip[1] + nbytes : ip[1]; in __rec_dleaf()
|