C++ (Qt)void MyCoolIoFunctionWin() { ... if (WriteFile(hCom, ...)) { if (ReadFile(hCom, ...) { // do processing data } else { // reading i/o error } } else { // writing i/o error } ...} void MyCoolIoFunctionUnix() { ... if (write(fd, ...)) { if (read(fd, ...) { // do processing data } else { // reading i/o error } } else { // writing i/o error } ...}