int transport(int src, int dst){ int totalCount = 0; char buffer[1024]; while(1) { int readCount = read (src, buffer, 1024); int writeCount = write(dst, buffer, readCount); if(readCount <= 0){ break; } totalCount += writeCount; } return totalCount; } |
|
来自: 520jefferson > 《c/c 》