summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sa
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-10-15 06:41:19 +0000
committercharnier <charnier@FreeBSD.org>1997-10-15 06:41:19 +0000
commit189d33fcde21c834b9ac36dc3e475587faa5cb4a (patch)
treec2b28e8118a59fda4a6e1fcf5d5d8cba924002ea /usr.sbin/sa
parente72ee0f8864efefc4787fda7b8865d540eb49d99 (diff)
downloadFreeBSD-src-189d33fcde21c834b9ac36dc3e475587faa5cb4a.zip
FreeBSD-src-189d33fcde21c834b9ac36dc3e475587faa5cb4a.tar.gz
Add usage().
Diffstat (limited to 'usr.sbin/sa')
-rw-r--r--usr.sbin/sa/main.c26
-rw-r--r--usr.sbin/sa/pdb.c7
-rw-r--r--usr.sbin/sa/sa.818
-rw-r--r--usr.sbin/sa/usrdb.c8
4 files changed, 35 insertions, 24 deletions
diff --git a/usr.sbin/sa/main.c b/usr.sbin/sa/main.c
index 490394d..99b1d8a 100644
--- a/usr.sbin/sa/main.c
+++ b/usr.sbin/sa/main.c
@@ -28,14 +28,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LINT
-static char copright[] =
+#ifndef lint
+static const char copyright[] =
"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\
All rights reserved.\n";
-
-static char rcsid[] = "$Id$";
#endif
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
/*
* sa: system accounting
*/
@@ -63,6 +66,7 @@ static int cmp_avgdkio __P((const DBT *, const DBT *));
static int cmp_cpumem __P((const DBT *, const DBT *));
static int cmp_avgcpumem __P((const DBT *, const DBT *));
static int cmp_calls __P((const DBT *, const DBT *));
+static void usage __P((void));
int aflag, bflag, cflag, dflag, Dflag, fflag, iflag, jflag, kflag;
int Kflag, lflag, mflag, qflag, rflag, sflag, tflag, uflag, vflag;
@@ -168,9 +172,7 @@ main(argc, argv)
break;
case '?':
default:
- (void)fprintf(stderr,
- "usage: sa [-abcdDfijkKlmnqrstu] [-v cutoff] [file ...]\n");
- exit(1);
+ usage();
}
argc -= optind;
@@ -224,7 +226,7 @@ main(argc, argv)
}
if (unmask &&
(sigprocmask(SIG_BLOCK, &nmask, &omask) == -1)) {
- warn("couldn't set signal mask ");
+ warn("couldn't set signal mask");
unmask = 0;
error = 1;
}
@@ -288,6 +290,14 @@ main(argc, argv)
exit(error);
}
+static void
+usage()
+{
+ (void)fprintf(stderr,
+ "usage: sa [-abcdDfijkKlmnqrstu] [-v cutoff] [file ...]\n");
+ exit(1);
+}
+
static int
acct_load(pn, wr)
char *pn;
diff --git a/usr.sbin/sa/pdb.c b/usr.sbin/sa/pdb.c
index bb7a431..8576915 100644
--- a/usr.sbin/sa/pdb.c
+++ b/usr.sbin/sa/pdb.c
@@ -28,9 +28,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LINT
-static char rcsid[] = "$Id$";
-#endif
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
#include <sys/types.h>
#include <sys/acct.h>
diff --git a/usr.sbin/sa/sa.8 b/usr.sbin/sa/sa.8
index 727e85d..fd6e8a4 100644
--- a/usr.sbin/sa/sa.8
+++ b/usr.sbin/sa/sa.8
@@ -27,7 +27,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id$
+.\" $Id: sa.8,v 1.7 1997/02/22 16:13:12 peter Exp $
.\"
.Dd February 25, 1994
.Dt SA 8
@@ -42,7 +42,7 @@
.Op Ar
.Sh DESCRIPTION
The
-.Nm sa
+.Nm
utility reports on, cleans up,
and generally maintains system
accounting files.
@@ -96,13 +96,13 @@ User time, in minutes
.El
.Pp
The options to
-.Nm sa
+.Nm
are:
.Bl -tag -width Ds
.It Fl a
List all command names, including those containing unprintable
characters and those used only once. By default,
-.Nm sa
+.Nm
places all names containing unprintable characters and
those used only once under the name ``***other''.
.It Fl b
@@ -195,7 +195,7 @@ and
flags are honored.
.Pp
The
-.Nm sa
+.Nm
utility exits 0 on success, and >0 if an error occurs.
.Sh FILES
.Bl -tag -width /var/account/usracct -compact
@@ -220,7 +220,7 @@ The field labels should be more consistent.
The VM system does not record the CPU storage integral.
.Sh CAVEATS
While the behavior of the options in this version of
-.Nm sa
+.Nm
was modeled after the original version, there are some intentional
differences and undoubtedly some unintentional ones as well. In
particular, the
@@ -230,11 +230,9 @@ option has been added, and the
option now understands more options than it used to.
.Pp
The formats of the summary files created by this version of
-.Nm sa
+.Nm
are very different than the those used by the original version.
This is not considered a problem, however, because the accounting record
format has changed as well (since user ids are now 32 bits).
.Sh AUTHOR
-.Bl -tag
-Chris G. Demetriou, cgd@postgres.berkeley.edu
-.El
+.An Chris G. Demetriou Aq cgd@postgres.berkeley.edu
diff --git a/usr.sbin/sa/usrdb.c b/usr.sbin/sa/usrdb.c
index 8cfb99e..d3a0654 100644
--- a/usr.sbin/sa/usrdb.c
+++ b/usr.sbin/sa/usrdb.c
@@ -28,9 +28,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LINT
-static char rcsid[] = "$Id$";
-#endif
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
#include <sys/types.h>
#include <sys/acct.h>
@@ -38,6 +39,7 @@ static char rcsid[] = "$Id$";
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "extern.h"
#include "pathnames.h"
OpenPOWER on IntegriCloud