In that case I don't think you would want to cancel the operation without permission of the read() function, especially since you are passing it a pointer to something that could become invalid if the read operating timed out. If read() tried to copy data to that pointer after your program timed out then read() would most likely crash your entire program because that pointer would no longer be valid.
Without more knowledge about that read() function you are pretty much stuck with current operation.