Lines Matching refs:nbytes
349 static ssize_t read_wrap(struct thread *t, void *buf, size_t nbytes);
350 static ssize_t write_wrap(struct thread *t, const void *buf, size_t nbytes);
351 static ssize_t ep0_consume(struct thread *t, const void *buf, size_t nbytes);
352 static ssize_t fill_in_buf(struct thread *t, void *buf, size_t nbytes);
353 static ssize_t empty_out_buf(struct thread *t, const void *buf, size_t nbytes);
496 static ssize_t read_wrap(struct thread *t, void *buf, size_t nbytes) in read_wrap() argument
498 return read(t->fd, buf, nbytes); in read_wrap()
501 static ssize_t write_wrap(struct thread *t, const void *buf, size_t nbytes) in write_wrap() argument
503 return write(t->fd, buf, nbytes); in write_wrap()
514 fill_in_buf(struct thread *ignore, void *buf, size_t nbytes) in fill_in_buf() argument
523 memset(buf, 0, nbytes); in fill_in_buf()
527 for (p = buf, i = 0; i < nbytes; ++i, ++p) in fill_in_buf()
532 return fread(buf, 1, nbytes, stdin); in fill_in_buf()
535 return nbytes; in fill_in_buf()
539 empty_out_buf(struct thread *ignore, const void *buf, size_t nbytes) in empty_out_buf() argument
551 for (p = buf, len = 0; len < nbytes; ++p, ++len) in empty_out_buf()
557 for (p = buf, len = 0; len < nbytes; ++p, ++len) in empty_out_buf()
565 ret = fwrite(buf, nbytes, 1, stdout); in empty_out_buf()
573 for (p = buf, len = 0; len < nbytes; ++p, ++len) { in empty_out_buf()
601 ep0_consume(struct thread *ignore, const void *buf, size_t nbytes) in ep0_consume() argument
618 for (n = nbytes / sizeof *event; n; --n, ++event) in ep0_consume()
636 return nbytes; in ep0_consume()