int main(int argc, char *argv[]) { int ret; init_params(argc, argv); alloc_block_buf(); ret = op_testpattern(argv[2], !strcmp(argv[1], "write")); free_block_buf(); return ret; }
int localcf_read(cfp_t *cfp, void *buf, int size) { int rc; int blk_size; char *blk_buf; blk_size = get_block_size(size); if ((blk_buf = get_block_buf(size)) == NULL) return (-1); do { rc = read(cfp->cf_fd, blk_buf, blk_size); } while (rc == -1 && errno == EINTR); bcopy(blk_buf, buf, size); free_block_buf(blk_buf); return (rc); }