Added timeval function and setsockopt.