gettimeofday fixed

fixes for correct returning of result, errno