summaryrefslogtreecommitdiff
path: root/sysutils/psmisc
diff options
context:
space:
mode:
authorjlam <jlam>2001-04-24 16:59:34 +0000
committerjlam <jlam>2001-04-24 16:59:34 +0000
commitaa4fe9052aed23807c0cf9610c45db63f0db3a0c (patch)
treee5d100ffab926e543a1952da3ffbbc13ced5527d /sysutils/psmisc
parent64af8153595527d593f47f78b6b80d4e7d78bd95 (diff)
downloadpkgsrc-aa4fe9052aed23807c0cf9610c45db63f0db3a0c.tar.gz
Update psmisc to 20.1. Changes from version 19:
- command line -<num> put back in. - got rid of annoying "sending signal #" debug message - updated killall.1 - updated killall usage - verbose now tells you what signal it is killing with. - New maintainer - Uses automake/autoconf to determine things - License changed to GPL - signames.h generated better (suggested by Grant Erickson) - uses getopt() for better command line stuff - makes less assumptions about process name, closes Debian Bug #53337 - Doesn't use losetup for loop devices in fuser. - Better selection of process name (thanks to David desJardins)
Diffstat (limited to 'sysutils/psmisc')
-rw-r--r--sysutils/psmisc/Makefile38
-rw-r--r--sysutils/psmisc/distinfo18
-rw-r--r--sysutils/psmisc/patches/patch-aa41
-rw-r--r--sysutils/psmisc/patches/patch-ab32
-rw-r--r--sysutils/psmisc/patches/patch-ac85
-rw-r--r--sysutils/psmisc/patches/patch-ad164
-rw-r--r--sysutils/psmisc/patches/patch-ae93
-rw-r--r--sysutils/psmisc/patches/patch-af92
-rw-r--r--sysutils/psmisc/patches/patch-ag82
-rw-r--r--sysutils/psmisc/pkg/DESCR2
10 files changed, 326 insertions, 321 deletions
diff --git a/sysutils/psmisc/Makefile b/sysutils/psmisc/Makefile
index 3e93a9db7b4..ba43f9f722e 100644
--- a/sysutils/psmisc/Makefile
+++ b/sysutils/psmisc/Makefile
@@ -1,24 +1,32 @@
-# $NetBSD: Makefile,v 1.5 2001/02/20 19:36:30 jlam Exp $
-#
+# $NetBSD: Makefile,v 1.6 2001/04/24 16:59:34 jlam Exp $
-DISTNAME= psmisc-19
+DISTNAME= psmisc-20.1
CATEGORIES= sysutils
-MASTER_SITES= ftp://lrcftp.epfl.ch/pub/linux/local/psmisc/ \
- ${MASTER_SITE_SUNSITE:=system/status/ps/}
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=psmisc/}
-MAINTAINER= packages@netbsd.org
-COMMENT= miscellaneous proc FS tools: killall, pidof, and pstree
+MAINTAINER= jlam@netbsd.org
+HOMEPAGE= http://psmisc.sourceforge.net/
+COMMENT= miscellaneous procfs tools: killall, pidof, and pstree
CONFLICTS+= pstree-[0-9]*
-WRKSRC= ${WRKDIR}/psmisc
+GNU_CONFIGURE= # defined
-do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/killall ${PREFIX}/bin
- ${LN} -sf killall ${PREFIX}/bin/pidof
- ${INSTALL_PROGRAM} ${WRKSRC}/pstree ${PREFIX}/bin
- ${INSTALL_MAN} ${WRKSRC}/killall.1 ${PREFIX}/man/man1
- ${INSTALL_MAN} ${WRKSRC}/pidof.1 ${PREFIX}/man/man1
- ${INSTALL_MAN} ${WRKSRC}/pstree.1 ${PREFIX}/man/man1
+# Don't match tgetstr() to libncurses, but force fall-through to libtermcap.
+CONFIGURE_ENV+= ac_lib_var_ncurses_tgetstr=no
+
+# killall uses getopt_long(), which only appeared since the NetBSD 1.5 release.
+.if !exists(/usr/include/getopt.h)
+DEPENDS+= libgetopt>=1.3:../../devel/libgetopt
+EVAL_PREFIX+= GETOPTDIR=libgetopt
+CPPFLAGS+= -I${GETOPTDIR}/include
+LDFLAGS+= -Wl,-R${GETOPTDIR} -L${GETOPTDIR} -lgetopt
+CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}"
+.endif
+
+# "make install" doesn't install the link from killall -> pidof.
+post-install:
+ ${RM} -f ${PREFIX}/bin/pidof
+ ${LN} -f ${PREFIX}/bin/killall ${PREFIX}/bin/pidof
.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/psmisc/distinfo b/sysutils/psmisc/distinfo
index 969fca426a5..11ecf226eb3 100644
--- a/sysutils/psmisc/distinfo
+++ b/sysutils/psmisc/distinfo
@@ -1,9 +1,11 @@
-$NetBSD: distinfo,v 1.2 2001/04/19 11:29:06 agc Exp $
+$NetBSD: distinfo,v 1.3 2001/04/24 16:59:34 jlam Exp $
-SHA1 (psmisc-19.tar.gz) = a0f6d1853453d1766832f18a63c39a29a3339c5c
-Size (psmisc-19.tar.gz) = 21552 bytes
-SHA1 (patch-aa) = 7ad490b731c33e146974c634040af0f8180d551c
-SHA1 (patch-ab) = eddb67ac994fbcf3c42babe25432f454b948a737
-SHA1 (patch-ac) = 831406ee351d5807ca6a3f10418302fceeda38fb
-SHA1 (patch-ad) = cdf23b5a937218183088780d20cdf12b5ba776b3
-SHA1 (patch-ae) = d243ab90ebe01409e60eb4cbeabcbc08a9648c88
+SHA1 (psmisc-20.1.tar.gz) = e969a2f539b181c372b0f82bbbd430c4d57d5d6b
+Size (psmisc-20.1.tar.gz) = 57767 bytes
+SHA1 (patch-aa) = 97b586e06444b9aa2a6ba95c10eaabc93f89c833
+SHA1 (patch-ab) = 4aadacec85e2234c010aad2db5fa9fe469562f4f
+SHA1 (patch-ac) = 9f9a7c7c5155345a1045aee70a2dd65a25ec7219
+SHA1 (patch-ad) = 73ae9467e783957ce7ff638d8637e7398f75c5fe
+SHA1 (patch-ae) = 484305118582c575f8c4827783aa3d5f57b25b5d
+SHA1 (patch-af) = 3c5ba3cf27a422943f984b8414ac29da0b8934da
+SHA1 (patch-ag) = a03a4a0c0dbf065e2b2785cee8f23579a11ae13f
diff --git a/sysutils/psmisc/patches/patch-aa b/sysutils/psmisc/patches/patch-aa
index 12156b0e101..5f92deabcf1 100644
--- a/sysutils/psmisc/patches/patch-aa
+++ b/sysutils/psmisc/patches/patch-aa
@@ -1,34 +1,13 @@
-$NetBSD: patch-aa,v 1.5 2000/10/06 00:04:57 jlam Exp $
+$NetBSD: patch-aa,v 1.6 2001/04/24 16:59:35 jlam Exp $
---- Makefile.orig Mon Oct 25 14:01:33 1999
-+++ Makefile
-@@ -1,11 +1,11 @@
- CC=cc
--CFLAGS=-O -DPSMISC_VERSION=\"`cat VERSION`\" \
-+CFLAGS+=-O -DPSMISC_VERSION=\"`cat VERSION`\" \
- -D_GNU_SOURCE \
- -Wall -Wno-parentheses -Wwrite-strings -Wpointer-arith \
- # -Wcast-align -Wconversion -g
- LDFLAGS=#-s -N #-Xlinker -qmagic
- REAL_CPP=cc -E
--PROGS=killall pstree fuser
-+PROGS=killall pstree # fuser
- EBINDIR=/bin # essential binaries
- BINDIR=/usr/bin # not so essential ones
- MANDIR=/usr/man/man1 # all man pages
-@@ -22,13 +22,14 @@
- grep '^{ 1,"HUP" },$$' signames.h >/dev/null || \
- { rm -f signames.h; exit 1; }
+--- doc/Makefile.in.orig Sat Mar 31 05:40:07 2001
++++ doc/Makefile.in
+@@ -64,7 +64,7 @@
+ TERMCAP_LIB = @TERMCAP_LIB@
+ VERSION = @VERSION@
--signals.o: signals.h signals.c signames.h Makefile
-+signals.o: signals.h signals.c Makefile
+-man_MANS = fuser.1 killall.1 pidof.1 pstree.1
++man_MANS = killall.1 pidof.1 pstree.1
- fuser.o: fuser.c comm.h signals.h Makefile VERSION
- killall.o: killall.c comm.h signals.h Makefile VERSION
-
- fuser: fuser.o signals.o
- killall: killall.o signals.o
-+ $(CC) $(CFLAGS) $(LDFLAGS) -o killall killall.o signals.o
-
- pstree: pstree.c comm.h Makefile VERSION
- $(CC) $(CFLAGS) $(LDFLAGS) -o pstree pstree.c -ltermcap
+ EXTRA_DIST = $(man_MANS)
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/sysutils/psmisc/patches/patch-ab b/sysutils/psmisc/patches/patch-ab
index 6f899312c23..beee06dddd3 100644
--- a/sysutils/psmisc/patches/patch-ab
+++ b/sysutils/psmisc/patches/patch-ab
@@ -1,22 +1,16 @@
-$NetBSD: patch-ab,v 1.2 1998/08/07 11:14:07 agc Exp $
+$NetBSD: patch-ab,v 1.3 2001/04/24 16:59:35 jlam Exp $
---- comm.h.orig Tue Sep 19 15:02:20 1995
-+++ comm.h Sat Jul 18 22:40:04 1998
-@@ -6,6 +6,10 @@
- #ifndef COMM_H
- #define COMM_H
+--- src/Makefile.in.orig Sat Mar 31 05:40:12 2001
++++ src/Makefile.in
+@@ -64,9 +64,9 @@
+ TERMCAP_LIB = @TERMCAP_LIB@
+ VERSION = @VERSION@
-+#include <sys/param.h>
-+#ifdef MAXCOMLEN
-+#define COMM_LEN MAXCOMLEN
-+#else
- #if 0 /* broken in 1.3.xx */
- #include <linux/sched.h>
- #define COMM_LEN sizeof(dummy.comm)
-@@ -14,5 +18,6 @@
- #define COMM_LEN 16 /* synchronize with size of comm in struct task_struct in
- /usr/include/linux/sched.h */
- #endif
-+#endif /* MAXCOMLEN */
+-CFLAGS = -Wall
++#CFLAGS = -Wall
+
+-bin_PROGRAMS = fuser killall pstree
++bin_PROGRAMS = killall pstree
+
+ fuser_SOURCES = fuser.c comm.h signals.c signals.h signames.h loop.h
- #endif
diff --git a/sysutils/psmisc/patches/patch-ac b/sysutils/psmisc/patches/patch-ac
index ef15878a583..8442dd23ce7 100644
--- a/sysutils/psmisc/patches/patch-ac
+++ b/sysutils/psmisc/patches/patch-ac
@@ -1,69 +1,22 @@
-$NetBSD: patch-ac,v 1.4 2000/03/17 15:54:53 jlam Exp $
+$NetBSD: patch-ac,v 1.5 2001/04/24 16:59:35 jlam Exp $
---- killall.c.orig Wed May 6 09:56:48 1998
-+++ killall.c Thu Mar 16 22:57:03 2000
-@@ -10,12 +10,19 @@
- #include <dirent.h>
- #include <signal.h>
- #include <errno.h>
-+#include <sys/param.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-
- #include "comm.h"
- #include "signals.h"
+--- src/comm.h.orig Wed Dec 13 18:43:10 2000
++++ src/comm.h
+@@ -6,6 +6,10 @@
+ #ifndef COMM_H
+ #define COMM_H
-+#if (defined(BSD) && BSD >= 199306)
-+#define BSD_44_PROC
-+#if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104180000)
-+#define BSD_PROC_CMDLINE
-+#endif
-+#endif
-
- #define PROC_BASE "/proc"
- #define MAX_NAMES (sizeof(unsigned long)*8)
-@@ -112,20 +119,32 @@
- }
- }
- for (i = 0; i < pids; i++) {
-+#ifdef BSD_44_PROC
-+ sprintf(path,PROC_BASE "/%d/status",pid_table[i]);
-+#else
- sprintf(path,PROC_BASE "/%d/stat",pid_table[i]);
-+#endif
- if (!(file = fopen(path,"r"))) continue;
- empty = 0;
-+#ifdef BSD_44_PROC
-+ okay = fscanf(file,"%s",comm) == 1;
-+#else
- okay = fscanf(file,"%*d (%[^)]",comm) == 1;
-+#endif
- (void) fclose(file);
- if (!okay) continue;
- got_long = 0;
- command = NULL; /* make gcc happy */
- length = strlen(comm);
- if (length == COMM_LEN-1) {
-+#if defined(BSD_44_PROC) && !defined(BSD_PROC_CMDLINE)
-+ okay = 0;
-+#else
- sprintf(path,PROC_BASE "/%d/cmdline",pid_table[i]);
- if (!(file = fopen(path,"r"))) continue;
- okay = fscanf(file,"%s",command_buf) == 1;
- (void) fclose(file);
-+#endif
- if (exact && !okay) {
- if (verbose)
- fprintf(stderr,"skipping partial match %s(%d)\n",comm,
-@@ -150,7 +169,11 @@
- strncmp(namelist[j],comm,COMM_LEN-1)) continue;
- }
- else {
-+#ifdef BSD_44_PROC
-+ sprintf(path,PROC_BASE "/%d/file",pid_table[i]);
++#include <sys/param.h>
++#ifdef MAXCOMLEN
++#define COMM_LEN MAXCOMLEN
+#else
- sprintf(path,PROC_BASE "/%d/exe",pid_table[i]);
-+#endif
- if (stat(path,&st) < 0) continue;
- if (sts[j].st_dev != st.st_dev || sts[j].st_ino != st.st_ino)
- continue;
+ #if 0 /* broken in 1.3.xx */
+ #include <linux/sched.h>
+ #define COMM_LEN sizeof(dummy.comm)
+@@ -14,5 +18,6 @@
+ #define COMM_LEN 16 /* synchronize with size of comm in struct task_struct in
+ /usr/include/linux/sched.h */
+ #endif
++#endif /* MAXCOMLEN */
+
+ #endif
diff --git a/sysutils/psmisc/patches/patch-ad b/sysutils/psmisc/patches/patch-ad
index 78ac3f89b45..2e68a586851 100644
--- a/sysutils/psmisc/patches/patch-ad
+++ b/sysutils/psmisc/patches/patch-ad
@@ -1,119 +1,71 @@
-$NetBSD: patch-ad,v 1.5 2001/01/11 18:47:18 jlam Exp $
+$NetBSD: patch-ad,v 1.6 2001/04/24 16:59:35 jlam Exp $
---- pstree.c.orig Sat May 1 15:40:56 1999
-+++ pstree.c Thu Jan 11 13:38:53 2001
-@@ -2,6 +2,9 @@
-
- /* Copyright 1993-1999 Werner Almesberger. See file COPYING for details. */
-
-+#ifdef linux
-+#define HAVE_GETOPT_H
-+#endif
-
- #include <stdlib.h>
- #include <stdio.h>
-@@ -9,17 +12,26 @@
- #include <ctype.h>
- #include <unistd.h>
- #include <fcntl.h>
-+#ifdef HAVE_GETOPT_H
+--- src/killall.c.orig Sat Mar 31 05:26:47 2001
++++ src/killall.c
+@@ -18,10 +18,10 @@
#include <getopt.h>
-+#endif
- #include <pwd.h>
- #include <dirent.h>
- #include <termios.h>
- #include <termcap.h>
-+#include <sys/param.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/ioctl.h>
#include "comm.h"
++#include "procfs.h"
+ #include "signals.h"
-+#if (defined(BSD) && BSD >= 199306)
-+#define BSD_44_PROC
-+#if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104180000)
-+#define BSD_PROC_CMDLINE
-+#endif
-+#endif
- #ifndef MAX_DEPTH
- #define MAX_DEPTH 100
-@@ -252,6 +264,7 @@
- const struct passwd *pw;
- int lvl,i,add,offset,len,swapped,info,count,comm_len,first;
- const char *tmp,*here;
-+ char tbuf[1024], *pbuf;
- char comm_tmp[5];
+-#define PROC_BASE "/proc"
+ #define MAX_NAMES (sizeof(unsigned long)*8)
- if (!current) return;
-@@ -270,7 +283,8 @@
- add = out_int(rep)+2;
- out_string("*[");
- }
-- if (current->highlight && (tmp = tgetstr("md",NULL))) tputs(tmp,1,putchar);
-+ pbuf = tbuf;
-+ if (current->highlight && (tmp = tgetstr("md",&pbuf))) tputs(tmp,1,putchar);
- if (swapped = print_args && current->argc < 0) out_char('(');
- comm_len = 0;
- for (here = current->comm; *here; here++)
-@@ -297,7 +311,8 @@
- else (void) out_int(current->uid);
- }
- if (info || swapped) out_char(')');
-- if (current->highlight && (tmp = tgetstr("me",NULL))) tputs(tmp,1,putchar);
-+ pbuf = tbuf;
-+ if (current->highlight && (tmp = tgetstr("me",&pbuf))) tputs(tmp,1,putchar);
- if (print_args) {
- for (i = 0; i < current->argc; i++) {
- out_char(' ');
-@@ -387,8 +402,13 @@
- char path[PATH_MAX+1],comm[COMM_LEN+1];
- char *buffer;
- pid_t pid,ppid;
-+#if !defined(BSD_44_PROC) || defined(BSD_PROC_CMDLINE)
- int fd,size;
-- int empty,dummy;
-+#endif
-+#if !defined(BSD_44_PROC)
-+ int dummy;
-+#endif
-+ int empty;
- if (!print_args) buffer = NULL;
- else if (!(buffer = malloc((size_t) (output_width+1)))) {
-@@ -402,15 +422,26 @@
- empty = 1;
- while (de = readdir(dir))
- if (pid = atoi(de->d_name)) {
-+#ifdef BSD_44_PROC
-+ sprintf(path,"%s/%d/status",PROC_BASE,pid);
-+#else
- sprintf(path,"%s/%d/stat",PROC_BASE,pid);
-+#endif
- if (file = fopen(path,"r")) {
- empty = 0;
- if (fstat(fileno(file),&st) < 0) {
- perror(path);
- exit(1);
- }
-+#ifdef BSD_44_PROC
-+ if (fscanf(file,"%s %*d %d",comm,&ppid) == 2) {
+@@ -138,11 +138,15 @@
+ }
+ for (i = 0; i < pids; i++)
+ {
+- sprintf (path, PROC_BASE "/%d/stat", pid_table[i]);
++ sprintf (path, "%s/%d/%s", PROC_BASE, pid_table[i], STATUS_FILE);
+ if (!(file = fopen (path, "r")))
+ continue;
+ empty = 0;
++#ifdef BSD_44_PROCFS
++ okay = fscanf (file, "%s", comm) == 1;
+#else
- if (fscanf(file,"%d (%[^)]) %c %d",&dummy,comm,(char *) &dummy,
- &ppid) == 4) {
+ okay = fscanf (file, "%*d (%[^)]", comm) == 1;
+#endif
-+#if defined(BSD_44_PROC) && !defined(BSD_PROC_CMDLINE)
-+ add_proc(comm,pid,ppid,st.st_uid,NULL,0);
+ (void) fclose (file);
+ if (!okay)
+ continue;
+@@ -151,7 +155,10 @@
+ length = strlen (comm);
+ if (length == COMM_LEN - 1)
+ {
+- sprintf (path, PROC_BASE "/%d/cmdline", pid_table[i]);
++#if defined(BSD_44_PROCFS) && !defined(BSD_PROCFS_CMDLINE)
++ okay = 0;
+#else
- if (!print_args) add_proc(comm,pid,ppid,st.st_uid,NULL,0);
- else {
- sprintf(path,"%s/%d/cmdline",PROC_BASE,pid);
-@@ -427,6 +458,7 @@
- if (size) buffer[size++] = 0;
- add_proc(comm,pid,ppid,st.st_uid,buffer,size);
- }
++ sprintf (path, "%s/%d/%s", PROC_BASE, pid_table[i], CMDLINE_FILE);
+ if (!(file = fopen (path, "r")))
+ continue;
+ while (1) {
+@@ -180,6 +187,7 @@
+ }
+ }
+ (void) fclose(file);
+#endif
- }
- (void) fclose(file);
+ if (exact && !okay)
+ {
+ if (verbose)
+@@ -206,7 +214,7 @@
}
+ else
+ {
+- sprintf (path, PROC_BASE "/%d/exe", pid_table[i]);
++ sprintf (path, "%s/%d/%s", PROC_BASE, pid_table[i], EXE_FILE);
+ if (stat (path, &st) < 0)
+ continue;
+ if (sts[j].st_dev != st.st_dev || sts[j].st_ino != st.st_ino)
+@@ -369,7 +377,7 @@
+ sig_num = SIGTERM;
+
+ opterr = 0;
+- while ( (optc = getopt_long_only(argc,argv,"egilqs:vwV",options,NULL)) != EOF) {
++ while ( (optc = getopt_long(argc,argv,"egilqs:vwV",options,NULL)) != EOF) {
+ switch (optc) {
+ case 'e':
+ exact = 1;
diff --git a/sysutils/psmisc/patches/patch-ae b/sysutils/psmisc/patches/patch-ae
index ded175b7645..56ee499f3ba 100644
--- a/sysutils/psmisc/patches/patch-ae
+++ b/sysutils/psmisc/patches/patch-ae
@@ -1,80 +1,25 @@
-$NetBSD: patch-ae,v 1.2 1998/08/07 11:14:08 agc Exp $
+$NetBSD: patch-ae,v 1.3 2001/04/24 16:59:35 jlam Exp $
---- signals.c.orig Tue Mar 28 21:32:06 1995
-+++ signals.c Sun Jul 19 14:07:51 1998
-@@ -2,14 +2,18 @@
-
- /* Copyright 1993-1995 Werner Almesberger. See file COPYING for details. */
-
--
-+#include <signal.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include "signals.h"
-
-+#ifdef __NetBSD__
-+#define HAVE_SYS_SIGNAME
-+#endif
-
-+#ifndef HAVE_SYS_SIGNAME
- typedef struct {
- int number;
- const char *name;
-@@ -19,9 +23,25 @@
- static SIGNAME signals[] = {
- #include "signames.h"
- { 0,NULL }};
--
-+#endif
-
- void list_signals(void)
-+#ifdef HAVE_SYS_SIGNAME
-+{
-+ int i, col;
+--- src/procfs.h.orig Tue Apr 24 12:31:50 2001
++++ src/procfs.h
+@@ -0,0 +1,20 @@
++#include <sys/param.h>
+
-+ col = 0;
-+ for (i = 1; i < NSIG; i++) {
-+ if (col+strlen(sys_signame[i])+1 > 80) {
-+ putchar('\n');
-+ col = 0;
-+ }
-+ printf("%s%s",col ? " " : "",sys_signame[i]);
-+ col += strlen(sys_signame[i])+1;
-+ }
-+ putchar('\n');
-+}
-+#else
- {
- SIGNAME *walk;
- int col;
-@@ -37,9 +57,22 @@
- }
- putchar('\n');
- }
--
++#if (defined(BSD) && BSD >= 199306)
++#define BSD_44_PROCFS
++#if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104180000)
++#define BSD_PROCFS_CMDLINE
++#endif
+#endif
-
- int get_signal(char *name,const char *cmd)
-+#ifdef HAVE_SYS_SIGNAME
-+{
-+ int i;
+
-+ if (isdigit(*name))
-+ return atoi(name);
-+ for (i = 1; i < NSIG; i++)
-+ if (!strcmp(sys_signame[i],name)) break;
-+ if (i < NSIG) return i;
-+ fprintf(stderr,"%s: unknown signal; %s -l lists signals.\n",name,cmd);
-+ exit(1);
-+}
++#ifdef BSD_44_PROCFS
++#define PROC_BASE "/proc"
++#define CMDLINE_FILE "cmdline"
++#define EXE_FILE "file"
++#define STATUS_FILE "status"
+#else
- {
- SIGNAME *walk;
-
-@@ -51,3 +84,4 @@
- fprintf(stderr,"%s: unknown signal; %s -l lists signals.\n",name,cmd);
- exit(1);
- }
++#define PROC_BASE "/proc"
++#define CMDLINE_FILE "cmdline"
++#define EXE_FILE "exe"
++#define STATUS_FILE "stat"
+#endif
diff --git a/sysutils/psmisc/patches/patch-af b/sysutils/psmisc/patches/patch-af
new file mode 100644
index 00000000000..66f3d4504ce
--- /dev/null
+++ b/sysutils/psmisc/patches/patch-af
@@ -0,0 +1,92 @@
+$NetBSD: patch-af,v 1.4 2001/04/24 16:59:35 jlam Exp $
+
+--- src/pstree.c.orig Mon Dec 18 00:59:23 2000
++++ src/pstree.c
+@@ -22,12 +22,12 @@
+ #include <sys/ioctl.h>
+
+ #include "comm.h"
++#include "procfs.h"
+
+
+ #ifndef MAX_DEPTH
+ #define MAX_DEPTH 100
+ #endif
+-#define PROC_BASE "/proc"
+
+ /* UTF-8 defines by Johan Myreen */
+ #define UTF_V "\342\224\202\277" /* Vertical line drawing char */
+@@ -303,6 +303,7 @@
+ const struct passwd *pw;
+ int lvl, i, add, offset, len, swapped, info, count, comm_len, first;
+ const char *tmp, *here;
++ char tbuf[1024], *pbuf;
+ char comm_tmp[5];
+
+ if (!current)
+@@ -327,7 +328,8 @@
+ add = out_int (rep) + 2;
+ out_string ("*[");
+ }
+- if (current->highlight && (tmp = tgetstr ("md", NULL)))
++ pbuf = tbuf;
++ if (current->highlight && (tmp = tgetstr ("md", &pbuf)))
+ tputs (tmp, 1, putchar);
+ if ((swapped = print_args) && current->argc < 0)
+ out_char ('(');
+@@ -366,7 +368,8 @@
+ }
+ if (info || swapped)
+ out_char (')');
+- if (current->highlight && (tmp = tgetstr ("me", NULL)))
++ pbuf = tbuf;
++ if (current->highlight && (tmp = tgetstr ("me", &pbuf)))
+ tputs (tmp, 1, putchar);
+ if (print_args)
+ {
+@@ -504,7 +507,7 @@
+ while ((de = readdir (dir)) != NULL)
+ if ((pid = atoi (de->d_name)) != 0)
+ {
+- sprintf (path, "%s/%d/stat", PROC_BASE, pid);
++ sprintf (path, "%s/%d/%s", PROC_BASE, pid, STATUS_FILE);
+ if ((file = fopen (path, "r")) != NULL)
+ {
+ empty = 0;
+@@ -513,6 +516,10 @@
+ perror (path);
+ exit (1);
+ }
++#ifdef BSD_44_PROCFS
++ if (fscanf(file, "%s %*d %d", comm, &ppid) == 2)
++ { { {
++#else
+ fread(readbuf, BUFSIZ, 1, file) ;
+ if (ferror(file) == 0)
+ {
+@@ -532,11 +539,12 @@
+ (file, "%d (%s) %c %d", &dummy, comm, (char *) &dummy,
+ &ppid) == 4)
+ */
++#endif
+ if (!print_args)
+ add_proc (comm, pid, ppid, st.st_uid, NULL, 0);
+ else
+ {
+- sprintf (path, "%s/%d/cmdline", PROC_BASE, pid);
++ sprintf (path, "%s/%d/%s", PROC_BASE, pid, CMDLINE_FILE);
+ if ((fd = open (path, O_RDONLY)) < 0)
+ {
+ perror (path);
+@@ -641,7 +649,11 @@
+ switch (c)
+ {
+ case 'a':
++#if defined(BSD_44_PROCFS) && !defined(BSD_PROCFS_CMDLINE)
++ print_args = 0;
++#else
+ print_args = 1;
++#endif
+ break;
+ case 'c':
+ compact = 0;
diff --git a/sysutils/psmisc/patches/patch-ag b/sysutils/psmisc/patches/patch-ag
new file mode 100644
index 00000000000..3b2cb102afa
--- /dev/null
+++ b/sysutils/psmisc/patches/patch-ag
@@ -0,0 +1,82 @@
+$NetBSD: patch-ag,v 1.1 2001/04/24 16:59:35 jlam Exp $
+
+--- src/signals.c.orig Wed Dec 13 18:43:15 2000
++++ src/signals.c
+@@ -7,9 +7,17 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
++#include <sys/param.h>
+ #include "signals.h"
+
++#if (defined(BSD) && BSD >= 199306)
++#define HAVE_SYS_SIGNAME
++#endif
+
++
++#ifdef HAVE_SYS_SIGNAME
++#include <signal.h>
++#else
+ typedef struct
+ {
+ int number;
+@@ -22,11 +30,26 @@
+ #include "signames.h"
+ {0, NULL}
+ };
++#endif
+
+
+ void
+ list_signals (void)
+ {
++#ifdef HAVE_SYS_SIGNAME
++ int i, col;
++
++ col = 0;
++ for (i = 1; i < NSIG; i++) {
++ if (col+strlen(sys_signame[i])+1 > 80) {
++ putchar('\n');
++ col = 0;
++ }
++ printf("%s%s",col ? " " : "",sys_signame[i]);
++ col += strlen(sys_signame[i])+1;
++ }
++ putchar('\n');
++#else
+ SIGNAME *walk;
+ int col;
+
+@@ -42,12 +65,26 @@
+ col += strlen (walk->name) + 1;
+ }
+ putchar ('\n');
++#endif
+ }
+
+
+ int
+ get_signal (char *name, const char *cmd)
+ {
++#ifdef HAVE_SYS_SIGNAME
++ int i;
++ if (isdigit(*name))
++ return atoi(name);
++ for (i = 1; i < NSIG; i++) {
++ if (!strcmp(sys_signame[i],name))
++ break;
++ }
++ if (i < NSIG)
++ return i;
++ fprintf(stderr,"%s: unknown signal; %s -l lists signals.\n",name,cmd);
++ exit(1);
++#else
+ SIGNAME *walk;
+
+ if (isdigit (*name))
+@@ -59,4 +96,5 @@
+ return walk->number;
+ fprintf (stderr, "%s: unknown signal; %s -l lists signals.\n", name, cmd);
+ exit (1);
++#endif
+ }
diff --git a/sysutils/psmisc/pkg/DESCR b/sysutils/psmisc/pkg/DESCR
index 03d4104b7d1..d7557267940 100644
--- a/sysutils/psmisc/pkg/DESCR
+++ b/sysutils/psmisc/pkg/DESCR
@@ -7,5 +7,3 @@ This package contains three little utilities that use the proc FS:
The Linux version includes "fuser" for listing processes' open files,
but NetBSD's procfs doesn't have the facilities for this (use the lsof
package instead).
-
-Author: Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>