diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2023-01-26 18:29:17 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2023-01-27 19:37:47 +0200 |
commit | ff592c616eda274215b485cf1b8d34f060c9f3be (patch) | |
tree | 7c3141dc351c68803372e7bcae4a87e5d7dcb6a7 /src/xz/mytime.h | |
parent | Translations: Add Brazilian Portuguese translation of man pages. (diff) | |
download | xz-ff592c616eda274215b485cf1b8d34f060c9f3be.tar.xz |
xz: Add SIGTSTP handler for progress indicator time keeping.
This way, if xz is stopped the elapsed time and estimated time
remaining won't get confused by the amount of time spent in
the stopped state.
This raises SIGSTOP. It's not clear to me if this is the correct way.
POSIX and glibc docs say that SIGTSTP shouldn't stop the process if
it is orphaned but this commit doesn't attempt to handle that.
Search for SIGTSTP in section 2.4.3:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
Diffstat (limited to 'src/xz/mytime.h')
-rw-r--r-- | src/xz/mytime.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xz/mytime.h b/src/xz/mytime.h index a7be2aa7..5a3c1e21 100644 --- a/src/xz/mytime.h +++ b/src/xz/mytime.h @@ -21,6 +21,12 @@ extern uint64_t opt_flush_timeout; +#ifdef USE_SIGTSTP_HANDLER +/// \brief Signal handler for SIGTSTP +extern void mytime_sigtstp_handler(int sig); +#endif + + /// \brief Store the time when (de)compression was started /// /// The start time is also stored as the time of the first flush. |