Subject: Re: [PATCH v3 1/4] compat/posix.h: track SA_RESTART fallback

From: Junio C Hamano <[email-masked]>
Date: Thu, 26 Jun 2025 18:41:30 -0700

"Carlo Marcelo Arenas Belón via GitGitGadget"
<[email-masked]> writes:

> +AC_CACHE_CHECK([whether SA_RESTART is supported], [ac_cv_siginterrupt], [
> +	AC_COMPILE_IFELSE(
> +		[AC_LANG_PROGRAM([#include <signal.h>], [[
> +			#ifdef SA_RESTART
> +			restartable signals supported
> +			#endif

So, where SA_RESTART is defined, we fail the compilation.

> +		]])],[
> +			ac_cv_siginterrupt=no
> +			NO_RESTARTABLE_SIGNALS=UnfortunatelyYes

As this is IFELSE, we know the condition that did not fail the
compilation is where we did not see SA_RESTART.  So we set the
NO_RESTARTABLE_SIGNALS=UnfortunatelyYes, which makes sense.

> +		], [ac_cv_siginterrupt=yes]
> +	)
> +])
> +GIT_CONF_SUBST([NO_RESTARTABLE_SIGNALS])

It is curious that throughout the two renames, the cached variable
used by autoconf hasn't changed its name.  Is it because it is
totally invisible to the end-users/builders?