| 25 | // all the data can be read/written in one call. |
| 26 | |
| 27 | void test_write(int fd1, unsigned char *ch, int size) { |
| 28 | memset(buf, 0, sizeof buf); |
| 29 | for (int i = 0; i < size; ++i) { |
| 30 | buf[i] = (*ch)++; |
| 31 | } |
| 32 | assert(write(fd1, buf, size) == size); |
| 33 | } |
| 34 | |
| 35 | void test_read(int fd0, unsigned char *ch, int size) { |
| 36 | memset(buf, 0, sizeof buf); |