/illumos-gate/usr/src/cmd/mdb/common/mdb/ |
H A D | mdb_umem.c | 63 mdb_umem_handler(size_t nbytes, size_t align, uint_t flags) in mdb_umem_handler() argument 77 (ulong_t)nbytes); in mdb_umem_handler() 96 (ulong_t)nbytes); in mdb_umem_handler() 104 ptr = memalign(align, nbytes); in mdb_umem_handler() 106 ptr = malloc(nbytes); in mdb_umem_handler() 126 die("failed to allocate %lu bytes -- terminating\n", (ulong_t)nbytes); in mdb_umem_handler() 134 mdb_umem_gc_enter(void *ptr, size_t nbytes) in mdb_umem_gc_enter() argument 139 blkp->blk_size = nbytes; in mdb_umem_gc_enter() 167 mdb_alloc_align(size_t nbytes, size_t align, uint_t flags) in mdb_alloc_align() argument 170 size_t obytes = nbytes; in mdb_alloc_align() [all …]
|
H A D | mdb_fdio.c | 55 fdio_read(mdb_io_t *io, void *buf, size_t nbytes) in fdio_read() argument 60 return (read(fdp->fd_fd, buf, nbytes)); in fdio_read() 62 return (IOP_READ(io->io_next, buf, nbytes)); in fdio_read() 66 fdio_write(mdb_io_t *io, const void *buf, size_t nbytes) in fdio_write() argument 71 return (write(fdp->fd_fd, buf, nbytes)); in fdio_write() 73 return (IOP_WRITE(io->io_next, buf, nbytes)); in fdio_write() 188 fdio_bdev_read(mdb_io_t *io, void *buf, size_t nbytes) in fdio_bdev_read() argument 191 ssize_t resid = nbytes; in fdio_bdev_read() 197 return (IOP_READ(io->io_next, buf, nbytes)); in fdio_bdev_read() 218 if (resid == nbytes && nbytes != 0) in fdio_bdev_read() [all …]
|
H A D | mdb_modapi.c | 168 mdb_vread(void *buf, size_t nbytes, uintptr_t addr) in mdb_vread() argument 170 ssize_t rbytes = mdb_tgt_vread(mdb.m_target, buf, nbytes, addr); in mdb_vread() 172 if (rbytes > 0 && rbytes < nbytes) in mdb_vread() 173 return (set_errbytes(rbytes, nbytes)); in mdb_vread() 179 mdb_vwrite(const void *buf, size_t nbytes, uintptr_t addr) in mdb_vwrite() argument 181 return (mdb_tgt_vwrite(mdb.m_target, buf, nbytes, addr)); in mdb_vwrite() 185 mdb_aread(void *buf, size_t nbytes, uintptr_t addr, void *as) in mdb_aread() argument 187 ssize_t rbytes = mdb_tgt_aread(mdb.m_target, as, buf, nbytes, addr); in mdb_aread() 189 if (rbytes > 0 && rbytes < nbytes) in mdb_aread() 190 return (set_errbytes(rbytes, nbytes)); in mdb_aread() [all …]
|
H A D | mdb_value.c | 67 value_read(mdb_tgt_t *t, void *dst, size_t nbytes, uintptr_t addr) in value_read() argument 80 size = nbytes; in value_read() 83 nbytes = MIN(size, nbytes); in value_read() 94 if (off + nbytes > sizeof (uintmax_t)) in value_read() 95 nbytes = sizeof (uintmax_t) - off; in value_read() 97 if (nbytes != 0) in value_read() 98 bcopy(src + off, dst, nbytes); in value_read() 100 return (nbytes); in value_read() 105 value_write(mdb_tgt_t *t, const void *buf, size_t nbytes, uintptr_t addr) in value_write() argument 107 return (nbytes); /* We allow writes to silently fail */ in value_write()
|
/illumos-gate/usr/src/psm/stand/boot/common/ |
H A D | heap_kmem.c | 121 void kmem_free(void *ptr, size_t nbytes); 148 size_t nbytes; member 439 kmem_alloc(size_t nbytes, int kmflag) in kmem_alloc() argument 450 printf("kmem_alloc(nbytes 0x%lx)\n", nbytes); in kmem_alloc() 453 if (nbytes == 0) { in kmem_alloc() 458 if (nbytes < SMALLEST_BLK) { in kmem_alloc() 459 printf("illegal kmem_alloc call for %lx bytes\n", nbytes); in kmem_alloc() 469 if (mweight(kmem_info.free_root) <= nbytes) { in kmem_alloc() 473 if (!morecore(nbytes)) { in kmem_alloc() 474 printf("kmem_alloc failed, nbytes %lx\n", nbytes); in kmem_alloc() [all …]
|
/illumos-gate/usr/src/cmd/fm/modules/common/eversholt/ |
H A D | alloc.c | 88 alloc_malloc(size_t nbytes, const char *fname, int line) in alloc_malloc() argument 92 ASSERT(nbytes > 0); in alloc_malloc() 94 retval = fmd_hdl_alloc(Hdl, nbytes + HDRSIZ, FMD_SLEEP); in alloc_malloc() 98 bcopy((void *)&nbytes, (void *)retval, sizeof (nbytes)); in alloc_malloc() 102 stats_counter_add(Malloctotal, nbytes); in alloc_malloc() 107 totalcount += nbytes + HDRSIZ; in alloc_malloc() 117 alloc_realloc(void *ptr, size_t nbytes, const char *fname, int line) in alloc_realloc() argument 119 void *retval = alloc_malloc(nbytes, fname, line); in alloc_realloc() 127 bcopy(ptr, retval, (osize < nbytes) ? osize : nbytes); in alloc_realloc() 188 alloc_xmalloc(size_t nbytes) in alloc_xmalloc() argument [all …]
|
/illumos-gate/usr/src/lib/libc/port/stdio/ |
H A D | fmemopen.c | 65 fmemopen_read(FILE *iop, char *buf, size_t nbytes) in fmemopen_read() argument 69 nbytes = MIN(nbytes, fmp->fmo_lsize - fmp->fmo_pos); in fmemopen_read() 70 if (nbytes == 0) { in fmemopen_read() 74 (void) memcpy(buf, fmp->fmo_buf, nbytes); in fmemopen_read() 75 fmp->fmo_pos += nbytes; in fmemopen_read() 77 return (nbytes); in fmemopen_read() 81 fmemopen_write(FILE *iop, const char *buf, size_t nbytes) in fmemopen_write() argument 95 if (nbytes == 0) { in fmemopen_write() 97 } else if (nbytes >= SSIZE_MAX) { in fmemopen_write() 102 npos = fmp->fmo_pos + nbytes; in fmemopen_write() [all …]
|
/illumos-gate/usr/src/cmd/fm/eversholt/common/ |
H A D | alloc.h | 38 void *alloc_realloc(void *ptr, size_t nbytes, const char *fname, int line); 39 void *alloc_malloc(size_t nbytes, const char *fname, int line); 47 #define MALLOC(nbytes) alloc_malloc(nbytes, __FILE__, __LINE__) argument 48 #define REALLOC(ptr, nbytes) alloc_realloc(ptr, nbytes, __FILE__, __LINE__) argument 54 #define MALLOC(nbytes) alloc_malloc(nbytes, "???", __LINE__) argument 55 #define REALLOC(ptr, nbytes) alloc_realloc(ptr, nbytes, "???", __LINE__) argument
|
H A D | alloc.c | 68 alloc_malloc(size_t nbytes, const char *fname, int line) in alloc_malloc() argument 70 void *retval = malloc(nbytes); in alloc_malloc() 76 stats_counter_add(Malloctotal, nbytes); in alloc_malloc() 90 alloc_realloc(void *ptr, size_t nbytes, const char *fname, int line) in alloc_realloc() argument 92 void *retval = realloc(ptr, nbytes); in alloc_realloc() 133 alloc_xmalloc(size_t nbytes) in alloc_xmalloc() argument 137 retval = malloc(nbytes); in alloc_xmalloc() 141 stats_counter_add(Malloctotal, nbytes); in alloc_xmalloc()
|
/illumos-gate/usr/src/uts/common/fs/ufs/ |
H A D | ufs_directio.c | 132 size_t nbytes; member 247 directio_start(struct ufsvfs *ufsvfsp, struct inode *ip, size_t nbytes, in directio_start() argument 269 dbp->nbytes = nbytes; in directio_start() 273 bp->b_bcount = nbytes; in directio_start() 287 ufs_directio_kstats.nread.value.ui64 += nbytes; in directio_start() 291 ufs_directio_kstats.nwritten.value.ui64 += nbytes; in directio_start() 337 size_t nbytes; in ufs_directio_write() local 421 nbytes = uio->uio_iovcnt; in ufs_directio_write() 422 while (nbytes--) { in ufs_directio_write() 652 nbytes = pglck_len; in ufs_directio_write() [all …]
|
/illumos-gate/usr/src/lib/krb5/plugins/kdb/db2/libdb2/btree/ |
H A D | bt_split.c | 97 u_int32_t n, nbytes, nksize; local 185 nbytes = NBINTERNAL(bi->ksize); 189 nbytes = NBINTERNAL(bl->ksize); 199 if (n < nbytes) { 201 bt_pfxsaved += nbytes - n; 203 nbytes = n; 211 nbytes = NRINTERNAL; 218 if (h->upper - h->lower < nbytes + sizeof(indx_t)) { 221 bt_root(t, h, &l, &r, &skip, nbytes) : 222 bt_page(t, h, &l, &r, &skip, nbytes); [all …]
|
/illumos-gate/usr/src/uts/common/inet/ |
H A D | tunables.c | 107 size_t nbytes; in mod_get_boolean() local 111 nbytes = snprintf(pval, psize, "%u", prop_perm2const(pinfo)); in mod_get_boolean() 113 nbytes = snprintf(pval, psize, "%u,%u", B_FALSE, B_TRUE); in mod_get_boolean() 115 nbytes = snprintf(pval, psize, "%u", pinfo->prop_def_bval); in mod_get_boolean() 117 nbytes = snprintf(pval, psize, "%u", pinfo->prop_cur_bval); in mod_get_boolean() 118 if (nbytes >= psize) in mod_get_boolean() 196 size_t nbytes; in mod_get_uint32() local 200 nbytes = snprintf(pval, psize, "%u", prop_perm2const(pinfo)); in mod_get_uint32() 202 nbytes = snprintf(pval, psize, "%u-%u", in mod_get_uint32() 205 nbytes = snprintf(pval, psize, "%u", pinfo->prop_def_uval); in mod_get_uint32() [all …]
|
/illumos-gate/usr/src/cmd/sh/ |
H A D | blok.c | 69 alloc(size_t nbytes) in alloc() argument 71 size_t rbytes = round(nbytes + ALIGNSIZ, ALIGNSIZ); in alloc() 313 realloc(pp, nbytes) in realloc() argument 315 size_t nbytes; 318 realloc(pp, nbytes) 320 size_t nbytes; 327 return (alloc(nbytes)); 328 if ((nbytes == 0) && (pp != NULL)) 333 if (blen < nbytes) { /* need to grow */ 334 q = alloc(nbytes); [all …]
|
/illumos-gate/usr/src/lib/libproc/common/ |
H A D | Pcore.c | 402 note_pstatus(struct ps_prochandle *P, size_t nbytes) in note_pstatus() argument 410 if (nbytes < sizeof (pstatus32_t) || in note_pstatus() 418 if (nbytes < sizeof (pstatus_t) || in note_pstatus() 433 note_lwpstatus(struct ps_prochandle *P, size_t nbytes) in note_lwpstatus() argument 444 if (nbytes < sizeof (lwpstatus32_t) || in note_lwpstatus() 451 if (nbytes < sizeof (lwpstatus_t) || in note_lwpstatus() 514 note_linux_psinfo(struct ps_prochandle *P, size_t nbytes) in note_linux_psinfo() argument 521 if (nbytes < sizeof (p32) || in note_linux_psinfo() 527 if (nbytes < sizeof (p64) || in note_linux_psinfo() 631 note_linux_prstatus(struct ps_prochandle *P, size_t nbytes) in note_linux_prstatus() argument [all …]
|
H A D | Pscantext.c | 54 int nbytes; /* number of bytes in buffer */ in Pscantext() local 140 if ((nbytes = read(P->asfd, buf, 2*BLKSIZE)) <= 0) in Pscantext() 143 if (nbytes < BLKSIZE) in Pscantext() 146 n2bytes = nbytes - BLKSIZE; in Pscantext() 147 nbytes = BLKSIZE; in Pscantext() 154 if (nbytes <= 0) { /* shift buffers */ in Pscantext() 155 if ((nbytes = n2bytes) <= 0) in Pscantext() 159 nbytes); in Pscantext() 162 if (nbytes == BLKSIZE && in Pscantext() 169 if (syspri = Pissyscall_text(P, p, nbytes)) in Pscantext() [all …]
|
/illumos-gate/usr/src/lib/fm/libdiskstatus/common/ |
H A D | ds_scsi_uscsi.c | 1203 int nbytes; in uscsi_mode_sense() local 1214 nbytes = sizeof (struct scsi_ms_header) + page_size; in uscsi_mode_sense() 1215 mode_sense_buf = alloca((uint_t)nbytes); in uscsi_mode_sense() 1220 (void) memset(mode_sense_buf, 0, nbytes); in uscsi_mode_sense() 1224 FORMG0COUNT(&cdb, (uchar_t)nbytes); in uscsi_mode_sense() 1229 ucmd.uscsi_buflen = nbytes; in uscsi_mode_sense() 1236 ddump("RAW MODE SENSE BUFFER", mode_sense_buf, nbytes); in uscsi_mode_sense() 1255 ddump("Mode sense:", mode_sense_buf, nbytes); in uscsi_mode_sense() 1263 ddump("Mode sense:", mode_sense_buf, nbytes); in uscsi_mode_sense() 1301 ddump("Mode sense:", mode_sense_buf, nbytes); in uscsi_mode_sense() [all …]
|
/illumos-gate/usr/src/lib/libc/port/gen/ |
H A D | memalign.c | 63 memalign(size_t align, size_t nbytes) in memalign() argument 83 if (nbytes == 0 || _misaligned(align) || align == 0 || in memalign() 100 if (nbytes > MAX_MALLOC) { in memalign() 104 ROUND(nbytes); in memalign() 105 if (nbytes < MINSIZE) in memalign() 106 nbytes = MINSIZE; in memalign() 110 reqsize = nbytes + align + (MINSIZE + WORDSIZE); in memalign() 113 if (reqsize < nbytes) { in memalign() 171 frag_size = blksize - nbytes; in memalign() 177 SIZE(aligned_blk) = nbytes; in memalign()
|
/illumos-gate/usr/src/lib/libcmdutils/common/ |
H A D | writefile.c | 51 int nbytes; in writefile() local 122 nbytes = write(fo, cp, mapsize); in writefile() 128 if ((nbytes >= 0) && (nbytes != (int)mapsize)) { in writefile() 129 remains = mapsize - nbytes; in writefile() 131 nbytes = write(fo, in writefile() 133 if (nbytes < 0) { in writefile() 145 remains -= nbytes; in writefile() 147 nbytes = mapsize; in writefile() 157 if (nbytes < 0) { in writefile() 173 filesize -= nbytes; in writefile() [all …]
|
/illumos-gate/usr/src/lib/libbsdmalloc/common/ |
H A D | malloc.bsd43.c | 96 malloc(size_t nbytes) in malloc() argument 141 if (nbytes <= (n = pagesz - sizeof (*op))) { in malloc() 149 while (nbytes > amt + n) { in malloc() 263 realloc(void *cp, size_t nbytes) in realloc() argument 272 return (malloc(nbytes)); in realloc() 291 if ((res = malloc(nbytes)) != NULL) in realloc() 292 (void) memmove(res, cp, nbytes); in realloc() 311 if (nbytes <= onb && nbytes > sz) { in realloc() 316 if ((res = malloc(nbytes)) == NULL) in realloc() 319 (void) memmove(res, cp, (nbytes < onb) ? nbytes : onb); in realloc()
|
/illumos-gate/usr/src/common/smbsrv/ |
H A D | smb_utf8.c | 113 smb_mbtowc(uint32_t *wcharp, const char *mbchar, size_t nbytes) in smb_mbtowc() argument 126 count = u8_validate((char *)mbchar, nbytes, NULL, 0, &err); in smb_mbtowc() 193 smb_wcstombs(char *mbs, const smb_wchar_t *wcs, size_t nbytes) in smb_wcstombs() argument 200 if (mbs != NULL && nbytes > 0) in smb_wcstombs() 220 mbslen = nbytes; in smb_wcstombs() 226 if (mbslen < nbytes) in smb_wcstombs() 272 size_t nbytes; in smb_sbequiv_strlen() local 276 nbytes = smb_mbtowc(NULL, mbs, MTS_MB_CHAR_MAX); in smb_sbequiv_strlen() 277 if (nbytes == ((size_t)-1)) in smb_sbequiv_strlen() 279 if (nbytes == 0) in smb_sbequiv_strlen() [all …]
|
/illumos-gate/usr/src/lib/libpicl/ |
H A D | picl.c | 354 picl_get_propval(picl_prophdl_t proph, void *valbuf, size_t nbytes) in picl_get_propval() argument 364 req_attrval.bufsize = (uint32_t)nbytes; in picl_get_propval() 365 if ((size_t)req_attrval.bufsize != nbytes) in picl_get_propval() 367 outargs = alloca(sizeof (picl_retattrval_t) + nbytes); in picl_get_propval() 370 NULL, 0, outargs, sizeof (picl_retattrval_t) + nbytes, in picl_get_propval() 377 if (ret->ret_attrval.nbytes > (uint32_t)nbytes) in picl_get_propval() 381 (size_t)ret->ret_attrval.nbytes); in picl_get_propval() 393 void *valbuf, size_t nbytes) in picl_get_propval_by_name() argument 404 req_attrvalbyname.bufsize = (uint32_t)nbytes; in picl_get_propval_by_name() 405 if ((size_t)req_attrvalbyname.bufsize != nbytes) in picl_get_propval_by_name() [all …]
|
/illumos-gate/usr/src/cmd/bhyve/common/ |
H A D | sockstream.c | 42 stream_read(int fd, void *buf, ssize_t nbytes) in stream_read() argument 50 while (len < nbytes) { in stream_read() 51 n = read(fd, p + len, nbytes - len); in stream_read() 66 stream_write(int fd, const void *buf, ssize_t nbytes) in stream_write() argument 74 while (len < nbytes) { in stream_write() 76 n = write(fd, p + len, nbytes - len); in stream_write() 78 n = send(fd, p + len, nbytes - len, MSG_NOSIGNAL); in stream_write()
|
/illumos-gate/usr/src/lib/libipmp/common/ |
H A D | ipmp_mpathd.c | 171 ssize_t nbytes; in ipmp_write() local 174 for (nwritten = 0; nwritten < buflen; nwritten += nbytes) { in ipmp_write() 175 nbytes = write(fd, &buf[nwritten], buflen - nwritten); in ipmp_write() 176 if (nbytes == -1) in ipmp_write() 178 if (nbytes == 0) { in ipmp_write() 227 ssize_t nbytes = 0; /* total bytes processed */ in ipmp_read() local 231 while (nbytes < buflen) { in ipmp_read() 267 prbytes = read(fd, (caddr_t)buffer + nbytes, buflen - nbytes); in ipmp_read() 273 nbytes += prbytes; in ipmp_read() 276 return (nbytes == buflen ? IPMP_SUCCESS : IPMP_FAILURE); in ipmp_read()
|
/illumos-gate/usr/src/uts/common/fs/smbsrv/ |
H A D | smb_mbuf_util.c | 144 smb_mbuf_get(uchar_t *buf, int nbytes) in smb_mbuf_get() argument 151 while (nbytes) { in smb_mbuf_get() 152 count = (nbytes > MCLBYTES) ? MCLBYTES : nbytes; in smb_mbuf_get() 153 nbytes -= count; in smb_mbuf_get() 245 smb_mbuf_alloc_chain(int nbytes) in smb_mbuf_alloc_chain() argument 251 ASSERT(nbytes > 0); in smb_mbuf_alloc_chain() 253 while (nbytes >= kmem_max_cached) { in smb_mbuf_alloc_chain() 261 nbytes -= len; in smb_mbuf_alloc_chain() 264 if (nbytes > MCLBYTES) { in smb_mbuf_alloc_chain() 265 len = nbytes; in smb_mbuf_alloc_chain() [all …]
|
/illumos-gate/usr/src/lib/libc/port/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()
|