Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Apr 2001 23:16:33 -0700 (PDT)
From:      david@wmol.com
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/26695: CHANGE REQUEST: kill(all) -l output
Message-ID:  <200104190616.f3J6GXi29898@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         26695
>Category:       misc
>Synopsis:       CHANGE REQUEST: kill(all) -l output
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 18 23:20:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     David
>Release:        FreeBSD 4.3-RC
>Organization:
>Environment:
FreeBSD beast.hill.hom 4.3-RC FreeBSD 4.3-RC #1: Thu Mar 29 23:30:04 EST 2001
	ocipio@beast.hill.hom:/usr/src/sys/compile/BEAST  i386
>Description:
My request changes the output of both kill -l and killall -l.  
Maybe, make `killall -ll` do the new output, and leave -l alone?

The current /usr/bin/killall -l outputs:
hup int quit ill trap abrt emt fpe kill bus segv sys pipe alrm term urg
stop tstp cont chld ttin ttou io xcpu xfsz vtalrm prof winch info usr1 usr2

The new way I think is more helpful, since it displays the numbers and actual words. (bash's way)
 1) sighup       2) sigint       3) sigquit      4) sigill 
 5) sigtrap      6) sigabrt      7) sigemt       8) sigfpe 
 9) sigkill     10) sigbus      11) sigsegv     12) sigsys 
13) sigpipe     14) sigalrm     15) sigterm     16) sigurg 
17) sigstop     18) sigtstp     19) sigcont     20) sigchld 
21) sigttin     22) sigttou     23) sigio       24) sigxcpu 
25) sigxfsz     26) sigvtalrm   27) sigprof     28) sigwinch 
29) siginfo     30) sigusr1     31) sigusr2

>How-To-Repeat:

>Fix:
--- killall.c.old       Thu Dec 28 07:14:41 2000
+++ killall.c   Thu Apr 19 02:05:17 2001
@@ -73,18 +73,23 @@
 static void
 printsig(FILE *fp)
 {
-       const char      *const * p;
-       int             cnt;
-       int             offset = 0;
-
-       for (cnt = NSIG, p = sys_signame + 1; --cnt; ++p) {
-               offset += fprintf(fp, "%s ", upper(*p));
-               if (offset >= 75 && cnt > 1) {
-                       offset = 0;
+       int     n, column;
+
+       for (n = 1, column = 0; n < NSIG; n++)
+       {
+               fprintf(fp, "%2d) sig%s%s", n, sys_signame[n],
+                       (n == NSIG -1) ? "" : " ");
+
+               if (++column < 4)
+                       fprintf(fp, "\t");
+               else {
                        fprintf(fp, "\n");
+                       column = 0;
                }
        }
+
        fprintf(fp, "\n");
+
 }

 static void

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104190616.f3J6GXi29898>