exit(ret);

}

do {

ret = file.write(buf, bufsize); if( ret < 0 ) {

cerr << endl << "Error writing bytes to " << FILENAME << ". written=" << file.gbytesWritten() << "GBytes";

cerr << ", errno=" << errno << " " << strerror(errno) << endl;

}else { cout << ".";

}while( ret > 0 ); if( ret >= 0 )

cout << endl << "Wrote " << file.gbytesWritten() << "GBytes" << endl;

free(buf); return ret;

Programming using direct I/O 28

Page 28
Image 28
HP c-Class Performance Tuning manual Programming using direct I/O