Lines Matching refs:nbytes
336 static ssize_t read_wrap(struct thread *t, void *buf, size_t nbytes);
337 static ssize_t write_wrap(struct thread *t, const void *buf, size_t nbytes);
338 static ssize_t ep0_consume(struct thread *t, const void *buf, size_t nbytes);
339 static ssize_t fill_in_buf(struct thread *t, void *buf, size_t nbytes);
340 static ssize_t empty_out_buf(struct thread *t, const void *buf, size_t nbytes);
483 static ssize_t read_wrap(struct thread *t, void *buf, size_t nbytes) in read_wrap() argument
485 return read(t->fd, buf, nbytes); in read_wrap()
488 static ssize_t write_wrap(struct thread *t, const void *buf, size_t nbytes) in write_wrap() argument
490 return write(t->fd, buf, nbytes); in write_wrap()
501 fill_in_buf(struct thread *ignore, void *buf, size_t nbytes) in fill_in_buf() argument
510 memset(buf, 0, nbytes); in fill_in_buf()
514 for (p = buf, i = 0; i < nbytes; ++i, ++p) in fill_in_buf()
519 return fread(buf, 1, nbytes, stdin); in fill_in_buf()
522 return nbytes; in fill_in_buf()
526 empty_out_buf(struct thread *ignore, const void *buf, size_t nbytes) in empty_out_buf() argument
538 for (p = buf, len = 0; len < nbytes; ++p, ++len) in empty_out_buf()
544 for (p = buf, len = 0; len < nbytes; ++p, ++len) in empty_out_buf()
552 ret = fwrite(buf, nbytes, 1, stdout); in empty_out_buf()
560 for (p = buf, len = 0; len < nbytes; ++p, ++len) { in empty_out_buf()
588 ep0_consume(struct thread *ignore, const void *buf, size_t nbytes) in ep0_consume() argument
605 for (n = nbytes / sizeof *event; n; --n, ++event) in ep0_consume()
623 return nbytes; in ep0_consume()