[Midnightbsd-cvs] src: usr.bin/w: sync with freebsd

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Mar 27 18:27:02 EDT 2009


Log Message:
-----------
sync with freebsd

Modified Files:
--------------
    src/usr.bin/w:
        w.1 (r1.1.1.1 -> r1.2)
        w.c (r1.2 -> r1.3)

-------------- next part --------------
Index: w.c
===================================================================
RCS file: /home/cvs/src/usr.bin/w/w.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L usr.bin/w/w.c -L usr.bin/w/w.c -u -r1.2 -r1.3
--- usr.bin/w/w.c
+++ usr.bin/w/w.c
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__FBSDID("$FreeBSD: src/usr.bin/w/w.c,v 1.58 2005/06/04 23:40:09 gad Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/w/w.c,v 1.60 2006/05/11 17:24:47 phk Exp $");
 
 #ifndef lint
 static const char copyright[] =
@@ -247,8 +247,7 @@
 			size_t size;
 
 			size = sizeof(dev_t);
-			(void)sysctlbyname("machdep.consdev", &ep->tdev, &size,
-			NULL, 0);
+			(void)sysctlbyname("machdep.consdev", &ep->tdev, &size, NULL, 0);
 		}
 		touched = stp->st_atime;
 		if (touched < ep->utmp.ut_time) {
@@ -420,9 +419,8 @@
 {
 	double avenrun[3];
 	time_t uptime;
+	struct timespec tp;
 	int days, hrs, i, mins, secs;
-	int mib[2];
-	size_t size;
 	char buf[256];
 
 	/*
@@ -433,14 +431,9 @@
 		(void)printf("%s ", buf);
 	/*
 	 * Print how long system has been up.
-	 * (Found by looking getting "boottime" from the kernel)
 	 */
-	mib[0] = CTL_KERN;
-	mib[1] = KERN_BOOTTIME;
-	size = sizeof(boottime);
-	if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 &&
-	    boottime.tv_sec != 0) {
-		uptime = now - boottime.tv_sec;
+	if (clock_gettime(CLOCK_MONOTONIC, &tp) != -1) {
+		uptime = tp.tv_sec;
 		if (uptime > 60)
 			uptime += 30;
 		days = uptime / 86400;
Index: w.1
===================================================================
RCS file: /home/cvs/src/usr.bin/w/w.1,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.bin/w/w.1 -L usr.bin/w/w.1 -u -r1.1.1.1 -r1.2
--- usr.bin/w/w.1
+++ usr.bin/w/w.1
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)w.1	8.1 (Berkeley) 6/6/93
-.\" $FreeBSD: src/usr.bin/w/w.1,v 1.20 2005/02/13 22:25:25 ru Exp $
+.\" $FreeBSD: src/usr.bin/w/w.1,v 1.21 2006/12/14 19:02:48 ru Exp $
 .\"
 .Dd June 6, 1993
 .Dt W 1
@@ -61,7 +61,7 @@
 and the name and arguments of the current process.
 .Pp
 The options are as follows:
-.Bl -tag -width Ds
+.Bl -tag -width indent
 .It Fl d
 dumps out the entire process list on a per controlling
 tty basis, instead of just the top level process.
@@ -72,11 +72,11 @@
 .It Fl M
 Extract values associated with the name list from the specified
 core instead of the default
-.Dq /dev/kmem .
+.Pa /dev/kmem .
 .It Fl N
 Extract the name list from the specified system instead of the
 default
-.Dq /boot/kernel/kernel .
+.Pa /boot/kernel/kernel .
 .It Fl n
 Do not attempt to resolve network addresses (normally
 .Nm
@@ -87,7 +87,7 @@
 .Ar user
 names are specified, the output is restricted to those users.
 .Sh FILES
-.Bl -tag -width /var/run/utmp -compact
+.Bl -tag -width ".Pa /var/run/utmp" -compact
 .It Pa /var/run/utmp
 list of users on the system
 .El
@@ -113,16 +113,19 @@
 The notion of the
 .Dq current process
 is muddy.
-The current algorithm is ``the highest numbered process on the terminal
+The current algorithm is
+.Do
+the highest numbered process on the terminal
 that is not ignoring interrupts, or, if there is none, the highest numbered
-process on the terminal''.
+process on the terminal
+.Dc .
 This fails, for example, in critical sections of programs like the shell
 and editor, or when faulty programs running in the background fork and fail
 to ignore interrupts.
 (In cases where no process can be found,
 .Nm
 prints
-.Dq \- . )
+.Ql \- . )
 .Pp
 The
 .Tn CPU


More information about the Midnightbsd-cvs mailing list