From owner-freebsd-bugs Tue Oct 24 2:10:15 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8308B37B4C5 for ; Tue, 24 Oct 2000 02:10:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA51653; Tue, 24 Oct 2000 02:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from gasket.go2net.com (natbox.go2net.com [209.191.181.146]) by hub.freebsd.org (Postfix) with ESMTP id 16E1C37B479 for ; Tue, 24 Oct 2000 02:05:17 -0700 (PDT) Received: by gasket.go2net.com (Postfix, from userid 492) id 2233CD5D0; Tue, 24 Oct 2000 02:05:12 -0700 (PDT) Message-Id: <20001024090512.2233CD5D0@gasket.go2net.com> Date: Tue, 24 Oct 2000 02:05:12 -0700 (PDT) From: williamc@go2net.com Reply-To: williamc@go2net.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/22270: top wraps wrong for some SMP systems Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 22270 >Category: bin >Synopsis: [patch] /usr/bin/top wraps wrong w/SMP on and long usernames >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 24 02:10:03 PDT 2000 >Closed-Date: >Last-Modified: >Originator: William Carrel >Release: FreeBSD 4.1.1-STABLE i386 >Organization: InfoSpace, Inc. >Environment: Any FreeBSD SMP system, from since the beginning of time. >Description: /usr/bin/top was reduced to 15 characters max in 1.29 by davidn however this is not enough for SMP systems who have one more column of text that indicates CPU number. With SMP enabled these systems need a username of max 13 characters to avoid the unattractive wrapping. >How-To-Repeat: Run /usr/bin/top on a SMP system with SMP on and a username of 14 or more characters. >Fix: The following patch applied to /usr/src/usr.bin/top/machine.c will correct this problem. This patch is for 4.X-STABLE (1.29). But the affected code is still identical in 5-CURRENT (1.30). Both versions need the patch, as well as 3.X-STABLE (1.18.2.4). Cheers! *** machine.c.orig Tue Oct 24 01:35:54 2000 --- machine.c Tue Oct 24 01:39:15 2000 *************** *** 241,247 **** } if (namelength < 8) namelength = 8; ! if (namelength > 15) namelength = 15; if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL) --- 241,249 ---- } if (namelength < 8) namelength = 8; ! if (smpmode && namelength > 13) ! namelength = 13; ! else if (namelength > 15) namelength = 15; if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message