int read_and_write(int fromfd, int tofd);

int copyfile(int fromfd, int tofd)
{
   int bytes_read;
   int total_bytes = 0;
 
   while ((bytes_read = read_and_write(fromfd, tofd)) > 0) 
      total_bytes += bytes_read;
   return total_bytes;
}

