diff options
author | iedowse <iedowse@FreeBSD.org> | 2002-02-16 20:22:26 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2002-02-16 20:22:26 +0000 |
commit | cafeeb5d7be874d586a3728bd7361f5a495421af (patch) | |
tree | 0f2cc2d71524fe237caf317ec2d68debc75c7a24 /sbin | |
parent | 77112edb7c995791e7b74003c00e1e2656aab983 (diff) | |
download | FreeBSD-src-cafeeb5d7be874d586a3728bd7361f5a495421af.zip FreeBSD-src-cafeeb5d7be874d586a3728bd7361f5a495421af.tar.gz |
On receipt of a SIGINFO, schedule an immediate printout of the
percentage complete and remaining time estimate.
PR: bin/32138
Submitted by: mi
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dump/dump.8 | 3 | ||||
-rw-r--r-- | sbin/dump/dump.h | 1 | ||||
-rw-r--r-- | sbin/dump/optr.c | 13 | ||||
-rw-r--r-- | sbin/dump/tape.c | 1 |
4 files changed, 16 insertions, 2 deletions
diff --git a/sbin/dump/dump.8 b/sbin/dump/dump.8 index 8e63399..a6362c1 100644 --- a/sbin/dump/dump.8 +++ b/sbin/dump/dump.8 @@ -312,7 +312,8 @@ after the old tape has been rewound and removed, and a new tape has been mounted. .Pp .Nm Dump -tells the operator what is going on at periodic intervals, +tells the operator what is going on at periodic intervals -- +every 5 minutes, or promptly after receiving SIGINFO -- including usually low estimates of the number of blocks to write, the number of tapes it will take, the time to completion, and the time to the tape change. diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h index f265886..d9bff13 100644 --- a/sbin/dump/dump.h +++ b/sbin/dump/dump.h @@ -95,6 +95,7 @@ int tp_bshift; /* log2(TP_BSIZE) */ /* operator interface functions */ void broadcast __P((char *message)); +void infosch __P((int)); void lastdump __P((int arg)); /* int should be char */ void msg __P((const char *fmt, ...)) __printflike(1, 2); void msgtail __P((const char *fmt, ...)) __printflike(1, 2); diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 1c53cdd..a35b550 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -51,6 +51,7 @@ static const char rcsid[] = #include <stdlib.h> #include <string.h> #include <stdarg.h> +#include <signal.h> #include <unistd.h> #include <utmp.h> @@ -195,7 +196,7 @@ timeest() time_t tnow; int deltat; - (void) time((time_t *) &tnow); + (void) time(&tnow); if (tnow >= tschedule) { tschedule = tnow + 300; if (blockswritten < 500) @@ -209,6 +210,16 @@ timeest() } } +/* + * Schedule a printout of the estimate in the next call to timeest(). + */ +void +infosch(signal) + int signal; +{ + tschedule = 0; +} + void #if __STDC__ msg(const char *fmt, ...) diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c index 10b05c9..25c9763 100644 --- a/sbin/dump/tape.c +++ b/sbin/dump/tape.c @@ -617,6 +617,7 @@ restore_check_point: } enslave(); /* Share open tape file descriptor with slaves */ + signal(SIGINFO, infosch); asize = 0; blocksthisvol = 0; |