CVS commit: src/usr.bin/time

2021-04-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr  5 23:01:55 UTC 2021

Modified Files:
src/usr.bin/time: time.1

Log Message:
Since there is a -t option, and the option itself is documented, there
doesn't seem to be any reason to exclude ``t'' from the usage summary.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/time/time.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.29 src/usr.bin/time/time.1:1.30
--- src/usr.bin/time/time.1:1.29	Thu Apr 23 07:54:53 2020
+++ src/usr.bin/time/time.1	Mon Apr  5 23:01:55 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.29 2020/04/23 07:54:53 simonb Exp $
+.\"	$NetBSD: time.1,v 1.30 2021/04/05 23:01:55 pgoyette Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)time.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd April 23, 2020
+.Dd April 5, 2021
 .Dt TIME 1
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd time command execution
 .Sh SYNOPSIS
 .Nm
-.Op Fl clp
+.Op Fl clpt
 .Op Fl f Ar fmt
 .Ar command
 .Op Ar argument ...



CVS commit: src/usr.bin/time

2017-07-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jul 15 14:40:36 UTC 2017

Modified Files:
src/usr.bin/time: time.1

Log Message:
Simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/time/time.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.27 src/usr.bin/time/time.1:1.28
--- src/usr.bin/time/time.1:1.27	Sat Jul 15 14:34:08 2017
+++ src/usr.bin/time/time.1	Sat Jul 15 14:40:36 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.27 2017/07/15 14:34:08 christos Exp $
+.\"	$NetBSD: time.1,v 1.28 2017/07/15 14:40:36 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -67,7 +67,8 @@ Available options:
 Displays information in the format used by default the
 .Nm
 builtin of
-.Xr csh 1 uses (\&%Uu \&%Ss \&%E \&%P \&%X+\&%Dk \&%I+\&%Oio \&%Fpf+\&%Ww).
+.Xr csh 1
+uses (%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww).
 .It Fl f
 Specify a time format using the
 .Xr csh 1
@@ -83,7 +84,7 @@ The time the process spent in kernel mod
 .It \&%E
 The elapsed (wall clock) time in seconds.
 .It \&%P
-The CPU percentage computed as (\&%U + \&%S) / \&%E.
+The CPU percentage computed as (%U + %S) / %E.
 .It \&%W
 Number of times the process was swapped.
 .It \&%X
@@ -91,7 +92,7 @@ The average amount in (shared) text spac
 .It \&%D
 The average amount in (unshared) data/stack space used in Kbytes.
 .It \&%K
-The total space used (\&%X + \&%D) in Kbytes.
+The total space used (%X + %D) in Kbytes.
 .It \&%M
 The maximum memory the process had in use at any time in Kbytes.
 .It \&%F



CVS commit: src/usr.bin/time

2017-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 15 14:34:08 UTC 2017

Modified Files:
src/usr.bin/time: ext.h time.1 time.c

Log Message:
Allow the user to specify the output format on the command line.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/time/ext.h
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/time/time.1
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/time/time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/ext.h
diff -u src/usr.bin/time/ext.h:1.2 src/usr.bin/time/ext.h:1.3
--- src/usr.bin/time/ext.h:1.2	Wed Nov  9 14:10:10 2011
+++ src/usr.bin/time/ext.h	Sat Jul 15 10:34:08 2017
@@ -1,5 +1,5 @@
-/*	$NetBSD: ext.h,v 1.2 2011/11/09 19:10:10 christos Exp $	*/
+/*	$NetBSD: ext.h,v 1.3 2017/07/15 14:34:08 christos Exp $	*/
 
 /* borrowed from ../../bin/csh/extern.h */
-void prusage(FILE *, struct rusage *, struct rusage *, struct timespec *,
-struct timespec *);
+void prusage1(FILE *, const char *fmt, struct rusage *, struct rusage *,
+struct timespec *, struct timespec *);

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.26 src/usr.bin/time/time.1:1.27
--- src/usr.bin/time/time.1:1.26	Wed Dec 21 13:01:21 2016
+++ src/usr.bin/time/time.1	Sat Jul 15 10:34:08 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.26 2016/12/21 18:01:21 abhinav Exp $
+.\"	$NetBSD: time.1,v 1.27 2017/07/15 14:34:08 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)time.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd November 9, 2011
+.Dd July 15, 2017
 .Dt TIME 1
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl clp
+.Op Fl f Ar fmt
 .Ar command
 .Op Ar argument ...
 .Sh DESCRIPTION
@@ -63,10 +64,55 @@ Times are reported in seconds.
 Available options:
 .Bl -tag -width Ds
 .It Fl c
-Displays information in the format used by the
+Displays information in the format used by default the
 .Nm
 builtin of
-.Xr csh 1 .
+.Xr csh 1 uses (\&%Uu \&%Ss \&%E \&%P \&%X+\&%Dk \&%I+\&%Oio \&%Fpf+\&%Ww).
+.It Fl f
+Specify a time format using the
+.Xr csh 1
+.Nm
+builtin syntax.
+The following sequences may be used in the format string:
+.Pp
+.Bl -tag -width 4n -compact
+.It \&%U
+The time the process spent in user mode in cpu seconds.
+.It \&%S
+The time the process spent in kernel mode in cpu seconds.
+.It \&%E
+The elapsed (wall clock) time in seconds.
+.It \&%P
+The CPU percentage computed as (\&%U + \&%S) / \&%E.
+.It \&%W
+Number of times the process was swapped.
+.It \&%X
+The average amount in (shared) text space used in Kbytes.
+.It \&%D
+The average amount in (unshared) data/stack space used in Kbytes.
+.It \&%K
+The total space used (\&%X + \&%D) in Kbytes.
+.It \&%M
+The maximum memory the process had in use at any time in Kbytes.
+.It \&%F
+The number of major page faults (page needed to be brought from disk).
+.It \&%R
+The number of minor page faults.
+.It \&%I
+The number of input operations.
+.It \&%O
+The number of output operations.
+.It \&%r
+The number of socket messages received.
+.It \&%s
+The number of socket messages sent.
+.It \&%k
+The number of signals received.
+.It \&%w
+The number of voluntary context switches (waits).
+.It \&%c
+The number of involuntary context switches.
+.El
 .It Fl l
 Lists resource utilization information.
 The contents of the

Index: src/usr.bin/time/time.c
diff -u src/usr.bin/time/time.c:1.22 src/usr.bin/time/time.c:1.23
--- src/usr.bin/time/time.c:1.22	Wed Nov  9 14:10:10 2011
+++ src/usr.bin/time/time.c	Sat Jul 15 10:34:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.c,v 1.22 2011/11/09 19:10:10 christos Exp $	*/
+/*	$NetBSD: time.c,v 1.23 2017/07/15 14:34:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #if 0
 static char sccsid[] = "@(#)time.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: time.c,v 1.22 2011/11/09 19:10:10 christos Exp $");
+__RCSID("$NetBSD: time.c,v 1.23 2017/07/15 14:34:08 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -70,31 +70,37 @@ main(int argc, char ** volatile argv)
 	int ch, status;
 	int volatile portableflag;
 	int volatile lflag;
-	int volatile cshflag;
 	const char *decpt;
+	const char *fmt;
 	const struct lconv *lconv;
 	struct timespec before, after;
 	struct rusage ru;
 
 	(void)setlocale(LC_ALL, "");
 
-	cshflag = lflag = portableflag = 0;
-	while ((ch = getopt(argc, argv, "clp")) != -1) {
+	lflag = portableflag = 0;
+	fmt = NULL;
+	while ((ch = getopt(argc, argv, "cf:lp")) != -1) {
 		switch (ch) {
+		case 'f':
+			fmt = optarg;
+			portableflag = 0;
+			lflag = 0;
+			break;
 		case 'c':
-			cshflag = 1;
+			fmt = "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww";
 			portableflag = 0;
 			lflag = 0;
 			break;
 		case 'p':
 			portableflag = 1;
-			cshflag = 0;
+			fmt = NULL;
 			lflag = 0;
 	

CVS commit: src/usr.bin/time

2016-12-21 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Wed Dec 21 18:01:21 UTC 2016

Modified Files:
src/usr.bin/time: time.1

Log Message:
Add an xref to wait4(2) in SEE ALSO as it has been referred to for the -l 
option.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/time/time.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.25 src/usr.bin/time/time.1:1.26
--- src/usr.bin/time/time.1:1.25	Wed Nov  9 19:42:27 2011
+++ src/usr.bin/time/time.1	Wed Dec 21 18:01:21 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.25 2011/11/09 19:42:27 wiz Exp $
+.\"	$NetBSD: time.1,v 1.26 2016/12/21 18:01:21 abhinav Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -160,7 +160,8 @@ will be that of
 .Xr csh 1 ,
 .Xr ksh 1 ,
 .Xr clock_gettime 2 ,
-.Xr getrusage 2
+.Xr getrusage 2 ,
+.Xr wait4 2
 .Sh STANDARDS
 The
 .Nm



CVS commit: src/usr.bin/time

2011-11-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov  9 19:42:27 UTC 2011

Modified Files:
src/usr.bin/time: time.1

Log Message:
Sort sections, use Aq, add comma in enumeration.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/time/time.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.24 src/usr.bin/time/time.1:1.25
--- src/usr.bin/time/time.1:1.24	Wed Nov  9 19:10:10 2011
+++ src/usr.bin/time/time.1	Wed Nov  9 19:42:27 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.24 2011/11/09 19:10:10 christos Exp $
+.\"	$NetBSD: time.1,v 1.25 2011/11/09 19:42:27 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -129,6 +129,10 @@ Resource usage is the total for the exec
 .Ar command
 and any child processes it spawns, as per
 .Xr wait4 2 .
+.Sh FILES
+.Bl -tag -width Xsys/resource.hX -compact
+.It Aq sys/resource.h
+.El
 .Sh EXIT STATUS
 The
 .Nm
@@ -152,14 +156,10 @@ Otherwise, the exit status of
 .Nm
 will be that of
 .Ar command .
-.Sh FILES
-.Bl -tag -width \*[Lt]sys/resource.h\*[Gt] -compact
-.It \*[Lt]sys/resource.h\*[Gt]
-.El
 .Sh SEE ALSO
 .Xr csh 1 ,
 .Xr ksh 1 ,
-.Xr clock_gettime 2
+.Xr clock_gettime 2 ,
 .Xr getrusage 2
 .Sh STANDARDS
 The



CVS commit: src/usr.bin/time

2011-11-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  9 19:10:10 UTC 2011

Modified Files:
src/usr.bin/time: ext.h time.1 time.c

Log Message:
PR/45592: Greg A. Woods: changes to get time(1) to use CLOCK_MONOTONIC


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/time/ext.h
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/time/time.1
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/time/time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/ext.h
diff -u src/usr.bin/time/ext.h:1.1 src/usr.bin/time/ext.h:1.2
--- src/usr.bin/time/ext.h:1.1	Sat Feb 24 16:30:27 2007
+++ src/usr.bin/time/ext.h	Wed Nov  9 14:10:10 2011
@@ -1,4 +1,5 @@
-/*	$NetBSD: ext.h,v 1.1 2007/02/24 21:30:27 matt Exp $	*/
+/*	$NetBSD: ext.h,v 1.2 2011/11/09 19:10:10 christos Exp $	*/
 
-void prusage(FILE *, struct rusage *, struct rusage *, struct timeval *,
-struct timeval *);
+/* borrowed from ../../bin/csh/extern.h */
+void prusage(FILE *, struct rusage *, struct rusage *, struct timespec *,
+struct timespec *);

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.23 src/usr.bin/time/time.1:1.24
--- src/usr.bin/time/time.1:1.23	Sat Oct  1 21:51:00 2011
+++ src/usr.bin/time/time.1	Wed Nov  9 14:10:10 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.23 2011/10/02 01:51:00 dholland Exp $
+.\"	$NetBSD: time.1,v 1.24 2011/11/09 19:10:10 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)time.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd October 1, 2011
+.Dd November 9, 2011
 .Dt TIME 1
 .Os
 .Sh NAME
@@ -49,13 +49,13 @@ times
 .Ar command .
 After the command finishes,
 .Nm
-writes the total elapsed time
+writes the total elapsed time (wall clock time),
 .Pq Dq real ,
-the time spent executing
+the CPU time spent executing
 .Ar command
 at user level
 .Pq Dq user ,
-and the time spent executing in the operating system kernel
+and the CPU time spent executing in the operating system kernel
 .Pq Dq sys ,
 to the standard error stream.
 Times are reported in seconds.
@@ -83,7 +83,7 @@ Some shells, such as
 .Xr csh 1
 and
 .Xr ksh 1 ,
-have their own and syntactically different builtin version of
+have their own and syntactically different built-in version of
 .Nm .
 The utility described here
 is available as
@@ -159,6 +159,7 @@ will be that of
 .Sh SEE ALSO
 .Xr csh 1 ,
 .Xr ksh 1 ,
+.Xr clock_gettime 2
 .Xr getrusage 2
 .Sh STANDARDS
 The

Index: src/usr.bin/time/time.c
diff -u src/usr.bin/time/time.c:1.21 src/usr.bin/time/time.c:1.22
--- src/usr.bin/time/time.c:1.21	Wed Aug 31 12:24:58 2011
+++ src/usr.bin/time/time.c	Wed Nov  9 14:10:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.c,v 1.21 2011/08/31 16:24:58 plunky Exp $	*/
+/*	$NetBSD: time.c,v 1.22 2011/11/09 19:10:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #if 0
 static char sccsid[] = "@(#)time.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: time.c,v 1.21 2011/08/31 16:24:58 plunky Exp $");
+__RCSID("$NetBSD: time.c,v 1.22 2011/11/09 19:10:10 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -58,6 +58,8 @@ __RCSID("$NetBSD: time.c,v 1.21 2011/08/
 
 __dead static void	usage(void);
 static void	prl(long, const char *);
+static void	prts(const char *, const char *, const struct timespec *,
+const char *);
 static void	prtv(const char *, const char *, const struct timeval *,
 const char *);
 
@@ -71,7 +73,7 @@ main(int argc, char ** volatile argv)
 	int volatile cshflag;
 	const char *decpt;
 	const struct lconv *lconv;
-	struct timeval before, after;
+	struct timespec before, after;
 	struct rusage ru;
 
 	(void)setlocale(LC_ALL, "");
@@ -105,7 +107,7 @@ main(int argc, char ** volatile argv)
 	if (argc < 1)
 		usage();
 
-	gettimeofday(&before, NULL);
+	(void)clock_gettime(CLOCK_MONOTONIC, &before);
 	switch(pid = vfork()) {
 	case -1:			/* error */
 		err(EXIT_FAILURE, "Vfork failed");
@@ -122,10 +124,10 @@ main(int argc, char ** volatile argv)
 	(void)signal(SIGQUIT, SIG_IGN);
 	if ((pid = wait4(pid, &status, 0, &ru)) == -1)
 		err(EXIT_FAILURE, "wait4 %d failed", pid);
-	(void)gettimeofday(&after, NULL);
+	(void)clock_gettime(CLOCK_MONOTONIC, &after);
 	if (!WIFEXITED(status))
 		warnx("Command terminated abnormally.");
-	timersub(&after, &before, &after);
+	timespecsub(&after, &before, &after);
 
 	if ((lconv = localeconv()) == NULL ||
 	(decpt = lconv->decimal_point) == NULL)
@@ -134,14 +136,14 @@ main(int argc, char ** volatile argv)
 	if (cshflag) {
 		static struct rusage null_ru;
 		before.tv_sec = 0;
-		before.tv_usec = 0;
+		before.tv_nsec = 0;
 		prusage(stderr, &null_ru, &ru, &after, &before);
 	} else if (portableflag) {
-		prtv("real ", decpt, &after, "\n");
+		prts("real ", decpt, &after, "\n");
 		prtv("user ", decpt, &ru

CVS commit: src/usr.bin/time

2011-10-01 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Oct  2 01:51:00 UTC 2011

Modified Files:
src/usr.bin/time: time.1

Log Message:
Describe the output more accurately, and in the correct order. Noted by
Snader_LB on freenode.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/time/time.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.22 src/usr.bin/time/time.1:1.23
--- src/usr.bin/time/time.1:1.22	Sun Oct  2 01:47:27 2011
+++ src/usr.bin/time/time.1	Sun Oct  2 01:51:00 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.22 2011/10/02 01:47:27 dholland Exp $
+.\"	$NetBSD: time.1,v 1.23 2011/10/02 01:51:00 dholland Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -49,10 +49,14 @@ times
 .Ar command .
 After the command finishes,
 .Nm
-writes the total time elapsed,
-the time consumed by system overhead,
-and the time used to execute
-the command
+writes the total elapsed time
+.Pq Dq real ,
+the time spent executing
+.Ar command
+at user level
+.Pq Dq user ,
+and the time spent executing in the operating system kernel
+.Pq Dq sys ,
 to the standard error stream.
 Times are reported in seconds.
 .Pp



CVS commit: src/usr.bin/time

2011-10-01 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Oct  2 01:47:27 UTC 2011

Modified Files:
src/usr.bin/time: time.1

Log Message:
Fix ambiguous/confusing wording.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/time/time.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.21 src/usr.bin/time/time.1:1.22
--- src/usr.bin/time/time.1:1.21	Sun May 16 07:40:53 2010
+++ src/usr.bin/time/time.1	Sun Oct  2 01:47:27 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.21 2010/05/16 07:40:53 dholland Exp $
+.\"	$NetBSD: time.1,v 1.22 2011/10/02 01:47:27 dholland Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)time.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd May 16, 2010
+.Dd October 1, 2011
 .Dt TIME 1
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl clp
-.Ar utility
+.Ar command
 .Op Ar argument ...
 .Sh DESCRIPTION
 The
@@ -46,15 +46,13 @@ The
 utility
 executes and
 times
-.Ar utility .
-After the
-.Ar utility
-finishes,
+.Ar command .
+After the command finishes,
 .Nm
 writes the total time elapsed,
 the time consumed by system overhead,
 and the time used to execute
-.Ar utility
+the command
 to the standard error stream.
 Times are reported in seconds.
 .Pp
@@ -68,8 +66,8 @@ builtin of
 .It Fl l
 Lists resource utilization information.
 The contents of the
-.Ar utility
-process'
+.Ar command
+process's
 .Em rusage
 structure are printed; see below.
 .It Fl p
@@ -124,7 +122,7 @@ voluntary context switches
 involuntary context switches
 .El
 Resource usage is the total for the execution of
-.Ar utility
+.Ar command
 and any child processes it spawns, as per
 .Xr wait4 2 .
 .Sh EXIT STATUS
@@ -138,18 +136,18 @@ An error occurred in the
 utility.
 .It 126
 The
-.Ar utility
+.Ar command
 was found but could not be invoked.
 .It 127
 The
-.Ar utility
+.Ar command
 could not be found.
 .El
 .Pp
 Otherwise, the exit status of
 .Nm
 will be that of
-.Ar utility .
+.Ar command .
 .Sh FILES
 .Bl -tag -width \*[Lt]sys/resource.h\*[Gt] -compact
 .It \*[Lt]sys/resource.h\*[Gt]



CVS commit: src/usr.bin/time

2011-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 08:24:42 UTC 2011

Modified Files:
src/usr.bin/time: Makefile time.c

Log Message:
use strpct from libutil.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/time/Makefile
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/time/time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/Makefile
diff -u src/usr.bin/time/Makefile:1.8 src/usr.bin/time/Makefile:1.9
--- src/usr.bin/time/Makefile:1.8	Wed Aug 17 09:29:39 2011
+++ src/usr.bin/time/Makefile	Sun Aug 28 04:24:42 2011
@@ -1,15 +1,16 @@
-#	$NetBSD: Makefile,v 1.8 2011/08/17 13:29:39 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2011/08/28 08:24:42 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 
 
 CPPFLAGS+=	-DNOT_CSH
 CPPFLAGS+=	-I. -I${NETBSDSRCDIR}/bin
-SRCS=	time.c strpct.c xtime.c
+SRCS=	time.c xtime.c
 PROG=	time
 
-COPTS.strpct.c += -Wno-format-nonliteral
-
 .PATH: ${NETBSDSRCDIR}/bin/csh
 
+LDADD+=-lutil
+DPADD+=${LIBUTIL}
+
 .include 

Index: src/usr.bin/time/time.c
diff -u src/usr.bin/time/time.c:1.19 src/usr.bin/time/time.c:1.20
--- src/usr.bin/time/time.c:1.19	Mon Jul 21 10:19:26 2008
+++ src/usr.bin/time/time.c	Sun Aug 28 04:24:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.c,v 1.19 2008/07/21 14:19:26 lukem Exp $	*/
+/*	$NetBSD: time.c,v 1.20 2011/08/28 08:24:42 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)time.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: time.c,v 1.19 2008/07/21 14:19:26 lukem Exp $");
+__RCSID("$NetBSD: time.c,v 1.20 2011/08/28 08:24:42 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -56,8 +56,7 @@
 
 #include "ext.h"
 
-int		main(int, char **);
-static void	usage(void);
+__dead static void	usage(void);
 static void	prl(long, const char *);
 static void	prtv(const char *, const char *, const struct timeval *,
 const char *);
@@ -174,7 +173,7 @@
 }
 
 static void
-usage()
+usage(void)
 {
 
 	(void)fprintf(stderr, "usage: %s [-clp] utility [argument ...]\n",



CVS commit: src/usr.bin/time

2011-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 17 13:29:39 UTC 2011

Modified Files:
src/usr.bin/time: Makefile

Log Message:
document non-literal string format


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/time/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/Makefile
diff -u src/usr.bin/time/Makefile:1.7 src/usr.bin/time/Makefile:1.8
--- src/usr.bin/time/Makefile:1.7	Tue Apr 14 18:15:27 2009
+++ src/usr.bin/time/Makefile	Wed Aug 17 09:29:39 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2009/04/14 22:15:27 lukem Exp $
+#	$NetBSD: Makefile,v 1.8 2011/08/17 13:29:39 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 
@@ -8,6 +8,8 @@
 SRCS=	time.c strpct.c xtime.c
 PROG=	time
 
+COPTS.strpct.c += -Wno-format-nonliteral
+
 .PATH: ${NETBSDSRCDIR}/bin/csh
 
 .include 



CVS commit: src/usr.bin/time

2010-05-16 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun May 16 07:40:53 UTC 2010

Modified Files:
src/usr.bin/time: time.1

Log Message:
and, erm, bump date too.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/time/time.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.20 src/usr.bin/time/time.1:1.21
--- src/usr.bin/time/time.1:1.20	Sun May 16 07:40:13 2010
+++ src/usr.bin/time/time.1	Sun May 16 07:40:53 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.20 2010/05/16 07:40:13 dholland Exp $
+.\"	$NetBSD: time.1,v 1.21 2010/05/16 07:40:53 dholland Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)time.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd January 24, 2009
+.Dd May 16, 2010
 .Dt TIME 1
 .Os
 .Sh NAME



CVS commit: src/usr.bin/time

2010-05-16 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun May 16 07:40:13 UTC 2010

Modified Files:
src/usr.bin/time: time.1

Log Message:
Grammar, clarification, and note that the rusage information is total
as opposed to strict subprocess only.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/time/time.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/time/time.1
diff -u src/usr.bin/time/time.1:1.19 src/usr.bin/time/time.1:1.20
--- src/usr.bin/time/time.1:1.19	Sat Jan 24 15:00:55 2009
+++ src/usr.bin/time/time.1	Sun May 16 07:40:13 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.1,v 1.19 2009/01/24 15:00:55 skrll Exp $
+.\"	$NetBSD: time.1,v 1.20 2010/05/16 07:40:13 dholland Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -61,16 +61,17 @@
 Available options:
 .Bl -tag -width Ds
 .It Fl c
-Displays the default
-.Xr csh 1
-summary format.
+Displays information in the format used by the
+.Nm
+builtin of
+.Xr csh 1 .
 .It Fl l
 Lists resource utilization information.
 The contents of the
 .Ar utility
 process'
 .Em rusage
-structure are printed, see below.
+structure are printed; see below.
 .It Fl p
 The output is formatted as specified by
 .St -p1003.2-92 .
@@ -90,7 +91,7 @@
 If the
 .Fl l
 option is given, the following resource usage
-informations are displayed
+information is displayed
 in addition to the timing information:
 .Bl -item -offset indent -compact
 .It
@@ -122,6 +123,10 @@
 .It
 involuntary context switches
 .El
+Resource usage is the total for the execution of
+.Ar utility
+and any child processes it spawns, as per
+.Xr wait4 2 .
 .Sh EXIT STATUS
 The
 .Nm