When cross-compiling, we cannot run a test program to check whether a siginfo_t provides the signal sender PID, so we fall back to assuming that it does, and also check that SA_SIGINFO is declared so compilation will not fail on systems without it (#120).

This commit is contained in:
Andrew Wood
2024-12-03 21:04:58 +00:00
parent 5f86aed17d
commit d51c57379a
8 changed files with 29 additions and 12 deletions
+8
View File
@@ -43,3 +43,11 @@ typedef bool _Bool;
# define true 1
# define __bool_true_false_are_defined 1
#endif
/* Whether "--remote" should be available. */
#undef PV_REMOTE_CONTROL
#if HAVE_DECL_SA_SIGINFO
# if SIGINFO_PROVIDES_PID
#define PV_REMOTE_CONTROL 1
# endif
#endif
+4
View File
@@ -28,6 +28,10 @@
*/
#undef HAVE_DCGETTEXT
/* Define to 1 if you have the declaration of `SA_SIGINFO', and to 0 if you
don't. */
#undef HAVE_DECL_SA_SIGINFO
/* Define to 1 if you have the `dup2' function. */
#undef HAVE_DUP2
+2 -2
View File
@@ -159,13 +159,13 @@ struct pvstate_s {
struct sigaction old_sigint;
struct sigaction old_sighup;
struct sigaction old_sigterm;
#ifdef SIGINFO_PROVIDES_PID
#ifdef PV_REMOTE_CONTROL
struct sigaction old_sigusr2;
#endif
struct sigaction old_sigalrm;
struct timespec tstp_time; /* see pv_sig_tstp() / __cont() */
struct timespec toffset; /* total time spent stopped */
#ifdef SIGINFO_PROVIDES_PID
#ifdef PV_REMOTE_CONTROL
volatile sig_atomic_t rxusr2; /* whether SIGUSR2 was received */
volatile pid_t sender; /* PID of sending process for SIGUSR2 */
#endif
+1 -1
View File
@@ -238,7 +238,7 @@ extern off_t pv_calc_total_size(pvstate_t);
*/
extern void pv_sig_init(pvstate_t);
#ifdef SIGINFO_PROVIDES_PID
#ifdef PV_REMOTE_CONTROL
/*
* Return true if SIGUSR2 has been received, and indicate the sender.
*/