aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/w
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2004-04-14 09:34:17 +0000
committerBruce Evans <bde@FreeBSD.org>2004-04-14 09:34:17 +0000
commit929789b42c7f8100c20bc2ccdd4536d8eea95128 (patch)
tree4f2a1a3a61bd6de4d885988d4330bdab5590535b /usr.bin/w
parenta1541efa63755d3e1abe05d7f34a32bda5fea094 (diff)
Notes
Diffstat (limited to 'usr.bin/w')
-rw-r--r--usr.bin/w/proc_compare.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/w/proc_compare.c b/usr.bin/w/proc_compare.c
index 62ff0d2f9ffa..8e807d161df2 100644
--- a/usr.bin/w/proc_compare.c
+++ b/usr.bin/w/proc_compare.c
@@ -31,15 +31,17 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD$");
-
+#if 0
#ifndef lint
-static const char sccsid[] = "@(#)proc_compare.c 8.2 (Berkeley) 9/23/93";
+static char sccsid[] = "@(#)proc_compare.c 8.2 (Berkeley) 9/23/93";
+#endif /* not lint */
#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
+#include <sys/proc.h>
#include <sys/time.h>
#include <sys/user.h>
@@ -55,7 +57,7 @@ static const char sccsid[] = "@(#)proc_compare.c 8.2 (Berkeley) 9/23/93";
* with the highest cpu utilization is picked (p_estcpu). Ties are
* broken by picking the highest pid.
* 3) The sleeper with the shortest sleep time is next. With ties,
- * we pick out just "short-term" sleepers (PS_SINTR == 0).
+ * we pick out just "short-term" sleepers (TDF_SINTR == 0).
* 4) Further ties are broken by picking the highest pid.
*
* If you change this, be sure to consider making the change in the kernel
@@ -64,10 +66,6 @@ static const char sccsid[] = "@(#)proc_compare.c 8.2 (Berkeley) 9/23/93";
* TODO - consider whether pctcpu should be used.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD$");
-
#define ISRUN(p) (((p)->ki_stat == SRUN) || ((p)->ki_stat == SIDL))
#define TESTAB(a, b) ((a)<<1 | (b))
#define ONLYA 2
@@ -96,7 +94,7 @@ proc_compare(struct kinfo_proc *p1, struct kinfo_proc *p2)
return (1);
if (p1->ki_estcpu > p2->ki_estcpu)
return (0);
- return (p2->ki_pid > p1->ki_pid); /* tie - return highest pid */
+ return (p2->ki_pid > p1->ki_pid); /* tie - return highest pid */
}
/*
* weed out zombies