revert accton's syntax to what it was in net/2

This commit is contained in:
cgd 1993-10-20 00:13:05 +00:00
parent 2ff9ed5060
commit 88e5411d7e
2 changed files with 17 additions and 43 deletions

View File

@ -24,36 +24,28 @@
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id: accton.8,v 1.1 1993/05/03 01:53:22 cgd Exp $
.\" $Id: accton.8,v 1.2 1993/10/20 00:13:05 cgd Exp $
.\"
.Dd May 2, 1993
.Dd October 18, 1993
.Dt ACCTON 8
.Os NetBSD 0.8a
.Os BSD 4
.Sh NAME
.Nm accton ,
.Nm acctoff
.Nm accton
.Nd enable/disable system accounting
.Sh SYNOPSIS
.Nm accton
.Nm acctoff
.Op Ar file
.Sh DESCRIPTION
.Nm Accton
enables generation of kernel accounting records, and
.Nm acctoff
disables their generation.
The actual logging of accounting records is done
by the
.Xr accoutant 8
program.
With an argument naming an existing
.Ar file ,
.Nm accton
causes system accounting information for every process executed
to be placed at the end of the file. If no argument is given,
accounting is turned off.
.Sh SEE ALSO
.Xr accountant 8 ,
.Xr lastcomm 1 ,
.Xr acct 5
.Sh HISTORY
The
.Nm accton
program probably appeared in Version 6 AT&T UNIX,
or thereabouts, but was substantially modified for
the new device-based accounting procedures in NetBSD 0.8a.
.Nm Acctoff
first appeard in NetBSD 0.8a.
has existed nearly forever, but this man page is new.

View File

@ -1,5 +1,4 @@
/*
* Copyright (c) 1993 Christopher G. Demetriou
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
*
@ -39,38 +38,21 @@ char copyright[] =
#endif /* not lint */
#ifndef lint
/*static char sccsid[] = "from: @(#)accton.c 4.3 (Berkeley) 6/1/90";*/
static char rcsid[] = "$Id: accton.c,v 1.3 1993/08/01 18:00:30 mycroft Exp $";
/* from: static char sccsid[] = "@(#)accton.c 4.3 (Berkeley) 6/1/90"; */
static char *rcsid = "$Id: accton.c,v 1.4 1993/10/20 00:13:10 cgd Exp $";
#endif /* not lint */
#include <stdio.h>
#include <string.h>
main(argc, argv)
int argc;
char **argv;
{
int turnon;
char *tail;
if ((tail = strrchr(argv[0], '/')) == NULL) {
tail = argv[0];
} else {
tail++;
}
if (!strcmp(tail, "accton")) {
turnon = 1;
} else if (!strcmp(tail, "acctoff")) {
turnon = 0;
} else {
turnon = -1;
}
if (argc != 1 || turnon == -1) {
fputs("usage: accton\n", stderr);
fputs("or: acctoff\n", stderr);
if (argc > 2) {
fputs("usage: accton [file]\n", stderr);
exit(1);
}
if (acct(turnon) < 0) {
if (acct(argc == 2 ? argv[1] : (char *)NULL)) {
perror("accton");
exit(1);
}