Don't bother to install a SIGALRM handler unless alarm() is available. Also, leave the existing SIGALRM handler alone if the timeout is too small to handle.