(and also, I think you should probably use a real variable for*bytes_copied, rather than update things behind the pointer. Updatethe pointer just once at the end instead, or preferably just changethe calling convention to just return the number of bytes copied, andlet the caller do the page counting).