Lines Matching refs:nbytes
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()
103 if (npos < nbytes) { in fmemopen_write()
107 nbytes = fmp->fmo_alloc - fmp->fmo_pos; in fmemopen_write()
110 (void) memcpy(&fmp->fmo_buf[fmp->fmo_pos], buf, nbytes); in fmemopen_write()
111 fmp->fmo_pos += nbytes; in fmemopen_write()
130 return (nbytes); in fmemopen_write()