head 1.7; access; symbols pkgsrc-2026Q1:1.7.0.100 pkgsrc-2026Q1-base:1.7 pkgsrc-2025Q4:1.7.0.98 pkgsrc-2025Q4-base:1.7 pkgsrc-2025Q3:1.7.0.96 pkgsrc-2025Q3-base:1.7 pkgsrc-2025Q2:1.7.0.94 pkgsrc-2025Q2-base:1.7 pkgsrc-2025Q1:1.7.0.92 pkgsrc-2025Q1-base:1.7 pkgsrc-2024Q4:1.7.0.90 pkgsrc-2024Q4-base:1.7 pkgsrc-2024Q3:1.7.0.88 pkgsrc-2024Q3-base:1.7 pkgsrc-2024Q2:1.7.0.86 pkgsrc-2024Q2-base:1.7 pkgsrc-2024Q1:1.7.0.84 pkgsrc-2024Q1-base:1.7 pkgsrc-2023Q4:1.7.0.82 pkgsrc-2023Q4-base:1.7 pkgsrc-2023Q3:1.7.0.80 pkgsrc-2023Q3-base:1.7 pkgsrc-2023Q2:1.7.0.78 pkgsrc-2023Q2-base:1.7 pkgsrc-2023Q1:1.7.0.76 pkgsrc-2023Q1-base:1.7 pkgsrc-2022Q4:1.7.0.74 pkgsrc-2022Q4-base:1.7 pkgsrc-2022Q3:1.7.0.72 pkgsrc-2022Q3-base:1.7 pkgsrc-2022Q2:1.7.0.70 pkgsrc-2022Q2-base:1.7 pkgsrc-2022Q1:1.7.0.68 pkgsrc-2022Q1-base:1.7 pkgsrc-2021Q4:1.7.0.66 pkgsrc-2021Q4-base:1.7 pkgsrc-2021Q3:1.7.0.64 pkgsrc-2021Q3-base:1.7 pkgsrc-2021Q2:1.7.0.62 pkgsrc-2021Q2-base:1.7 pkgsrc-2021Q1:1.7.0.60 pkgsrc-2021Q1-base:1.7 pkgsrc-2020Q4:1.7.0.58 pkgsrc-2020Q4-base:1.7 pkgsrc-2020Q3:1.7.0.56 pkgsrc-2020Q3-base:1.7 pkgsrc-2020Q2:1.7.0.52 pkgsrc-2020Q2-base:1.7 pkgsrc-2020Q1:1.7.0.32 pkgsrc-2020Q1-base:1.7 pkgsrc-2019Q4:1.7.0.54 pkgsrc-2019Q4-base:1.7 pkgsrc-2019Q3:1.7.0.50 pkgsrc-2019Q3-base:1.7 pkgsrc-2019Q2:1.7.0.48 pkgsrc-2019Q2-base:1.7 pkgsrc-2019Q1:1.7.0.46 pkgsrc-2019Q1-base:1.7 pkgsrc-2018Q4:1.7.0.44 pkgsrc-2018Q4-base:1.7 pkgsrc-2018Q3:1.7.0.42 pkgsrc-2018Q3-base:1.7 pkgsrc-2018Q2:1.7.0.40 pkgsrc-2018Q2-base:1.7 pkgsrc-2018Q1:1.7.0.38 pkgsrc-2018Q1-base:1.7 pkgsrc-2017Q4:1.7.0.36 pkgsrc-2017Q4-base:1.7 pkgsrc-2017Q3:1.7.0.34 pkgsrc-2017Q3-base:1.7 pkgsrc-2017Q2:1.7.0.30 pkgsrc-2017Q2-base:1.7 pkgsrc-2017Q1:1.7.0.28 pkgsrc-2017Q1-base:1.7 pkgsrc-2016Q4:1.7.0.26 pkgsrc-2016Q4-base:1.7 pkgsrc-2016Q3:1.7.0.24 pkgsrc-2016Q3-base:1.7 pkgsrc-2016Q2:1.7.0.22 pkgsrc-2016Q2-base:1.7 pkgsrc-2016Q1:1.7.0.20 pkgsrc-2016Q1-base:1.7 pkgsrc-2015Q4:1.7.0.18 pkgsrc-2015Q4-base:1.7 pkgsrc-2015Q3:1.7.0.16 pkgsrc-2015Q3-base:1.7 pkgsrc-2015Q2:1.7.0.14 pkgsrc-2015Q2-base:1.7 pkgsrc-2015Q1:1.7.0.12 pkgsrc-2015Q1-base:1.7 pkgsrc-2014Q4:1.7.0.10 pkgsrc-2014Q4-base:1.7 pkgsrc-2014Q3:1.7.0.8 pkgsrc-2014Q3-base:1.7 pkgsrc-2014Q2:1.7.0.6 pkgsrc-2014Q2-base:1.7 pkgsrc-2014Q1:1.7.0.4 pkgsrc-2014Q1-base:1.7 pkgsrc-2013Q4:1.7.0.2 pkgsrc-2013Q4-base:1.7 pkgsrc-2013Q3:1.6.0.92 pkgsrc-2013Q3-base:1.6 pkgsrc-2013Q2:1.6.0.90 pkgsrc-2013Q2-base:1.6 pkgsrc-2013Q1:1.6.0.88 pkgsrc-2013Q1-base:1.6 pkgsrc-2012Q4:1.6.0.86 pkgsrc-2012Q4-base:1.6 pkgsrc-2012Q3:1.6.0.84 pkgsrc-2012Q3-base:1.6 pkgsrc-2012Q2:1.6.0.82 pkgsrc-2012Q2-base:1.6 pkgsrc-2012Q1:1.6.0.80 pkgsrc-2012Q1-base:1.6 pkgsrc-2011Q4:1.6.0.78 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q3:1.6.0.76 pkgsrc-2011Q3-base:1.6 pkgsrc-2011Q2:1.6.0.74 pkgsrc-2011Q2-base:1.6 pkgsrc-2011Q1:1.6.0.72 pkgsrc-2011Q1-base:1.6 pkgsrc-2010Q4:1.6.0.70 pkgsrc-2010Q4-base:1.6 pkgsrc-2010Q3:1.6.0.68 pkgsrc-2010Q3-base:1.6 pkgsrc-2010Q2:1.6.0.66 pkgsrc-2010Q2-base:1.6 pkgsrc-2010Q1:1.6.0.64 pkgsrc-2010Q1-base:1.6 pkgsrc-2009Q4:1.6.0.62 pkgsrc-2009Q4-base:1.6 pkgsrc-2009Q3:1.6.0.60 pkgsrc-2009Q3-base:1.6 pkgsrc-2009Q2:1.6.0.58 pkgsrc-2009Q2-base:1.6 pkgsrc-2009Q1:1.6.0.56 pkgsrc-2009Q1-base:1.6 pkgsrc-2008Q4:1.6.0.54 pkgsrc-2008Q4-base:1.6 pkgsrc-2008Q3:1.6.0.52 pkgsrc-2008Q3-base:1.6 cube-native-xorg:1.6.0.50 cube-native-xorg-base:1.6 pkgsrc-2008Q2:1.6.0.48 pkgsrc-2008Q2-base:1.6 cwrapper:1.6.0.46 pkgsrc-2008Q1:1.6.0.44 pkgsrc-2008Q1-base:1.6 pkgsrc-2007Q4:1.6.0.42 pkgsrc-2007Q4-base:1.6 pkgsrc-2007Q3:1.6.0.40 pkgsrc-2007Q3-base:1.6 pkgsrc-2007Q2:1.6.0.38 pkgsrc-2007Q2-base:1.6 pkgsrc-2007Q1:1.6.0.36 pkgsrc-2007Q1-base:1.6 pkgsrc-2006Q4:1.6.0.34 pkgsrc-2006Q4-base:1.6 pkgsrc-2006Q3:1.6.0.32 pkgsrc-2006Q3-base:1.6 pkgsrc-2006Q2:1.6.0.30 pkgsrc-2006Q2-base:1.6 pkgsrc-2006Q1:1.6.0.28 pkgsrc-2006Q1-base:1.6 pkgsrc-2005Q4:1.6.0.26 pkgsrc-2005Q4-base:1.6 pkgsrc-2005Q3:1.6.0.24 pkgsrc-2005Q3-base:1.6 pkgsrc-2005Q2:1.6.0.22 pkgsrc-2005Q2-base:1.6 pkgsrc-2005Q1:1.6.0.20 pkgsrc-2005Q1-base:1.6 pkgsrc-2004Q4:1.6.0.18 pkgsrc-2004Q4-base:1.6 pkgsrc-2004Q3:1.6.0.16 pkgsrc-2004Q3-base:1.6 pkgsrc-2004Q2:1.6.0.14 pkgsrc-2004Q2-base:1.6 pkgsrc-2004Q1:1.6.0.12 pkgsrc-2004Q1-base:1.6 pkgsrc-2003Q4:1.6.0.10 pkgsrc-2003Q4-base:1.6 netbsd-1-6-1:1.6.0.6 netbsd-1-6-1-base:1.6 netbsd-1-6:1.6.0.8 netbsd-1-6-RELEASE-base:1.6 pkgviews:1.6.0.4 pkgviews-base:1.6 buildlink2:1.6.0.2 buildlink2-base:1.6 netbsd-1-5-PATCH003:1.6 netbsd-1-5-PATCH001:1.6 netbsd-1-5-RELEASE:1.4 netbsd-1-4-PATCH003:1.4 netbsd-1-4-PATCH002:1.2 comdex-fall-1999:1.2 netbsd-1-4-PATCH001:1.2 netbsd-1-4-RELEASE:1.2 netbsd-1-3-PATCH003:1.2; locks; strict; comment @# @; 1.7 date 2013.12.13.09.58.58; author jperkin; state Exp; branches; next 1.6; commitid NVvEWRSTsYRplXgx; 1.6 date 2001.04.24.16.59.35; author jlam; state Exp; branches; next 1.5; 1.5 date 2001.01.11.18.47.18; author jlam; state Exp; branches; next 1.4; 1.4 date 2000.03.19.03.11.13; author jlam; state Exp; branches; next 1.3; 1.3 date 2000.03.17.15.54.53; author jlam; state Exp; branches; next 1.2; 1.2 date 98.08.07.11.14.07; author agc; state Exp; branches; next 1.1; 1.1 date 98.07.20.10.25.53; author frueauf; state Exp; branches; next ; desc @@ 1.7 log @Need limits.h for PATH_MAX on SunOS. @ text @$NetBSD: patch-ad,v 1.6 2001/04/24 16:59:35 jlam Exp $ Need limits.h for PATH_MAX --- src/killall.c.orig 2001-03-31 10:26:47.000000000 +0000 +++ src/killall.c @@@@ -13,15 +13,16 @@@@ #include #include #include +#include #include #include #include #include "comm.h" +#include "procfs.h" #include "signals.h" -#define PROC_BASE "/proc" #define MAX_NAMES (sizeof(unsigned long)*8) @@@@ -138,11 +139,15 @@@@ kill_all (int signal, int names, char ** } 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 okay = fscanf (file, "%*d (%[^)]", comm) == 1; +#endif (void) fclose (file); if (!okay) continue; @@@@ -151,7 +156,10 @@@@ kill_all (int signal, int names, char ** 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 + sprintf (path, "%s/%d/%s", PROC_BASE, pid_table[i], CMDLINE_FILE); if (!(file = fopen (path, "r"))) continue; while (1) { @@@@ -180,6 +188,7 @@@@ kill_all (int signal, int names, char ** } } (void) fclose(file); +#endif if (exact && !okay) { if (verbose) @@@@ -206,7 +215,7 @@@@ kill_all (int signal, int names, char ** } 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 +378,7 @@@@ main (int argc, char **argv) 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; @ 1.6 log @Update psmisc to 20.1. Changes from version 19: - command line - 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) @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 1 --- src/killall.c.orig Sat Mar 31 05:26:47 2001 d7 7 a13 1 @@@@ -18,10 +18,10 @@@@ d25 1 a25 1 @@@@ -138,11 +138,15 @@@@ d42 1 a42 1 @@@@ -151,7 +155,10 @@@@ d54 1 a54 1 @@@@ -180,6 +187,7 @@@@ d62 1 a62 1 @@@@ -206,7 +214,7 @@@@ d71 1 a71 1 @@@@ -369,7 +377,7 @@@@ @ 1.5 log @Kill compiler warning. @ text @d3 4 a6 3 --- pstree.c.orig Sat May 1 15:40:56 1999 +++ pstree.c Thu Jan 11 13:38:53 2001 @@@@ -2,6 +2,9 @@@@ d8 3 a10 5 /* Copyright 1993-1999 Werner Almesberger. See file COPYING for details. */ +#ifdef linux +#define HAVE_GETOPT_H +#endif a11 17 #include #include @@@@ -9,17 +12,26 @@@@ #include #include #include +#ifdef HAVE_GETOPT_H #include +#endif #include #include #include #include +#include #include #include #include d13 2 a14 1 #include "comm.h" a15 6 +#if (defined(BSD) && BSD >= 199306) +#define BSD_44_PROC +#if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104180000) +#define BSD_PROC_CMDLINE +#endif +#endif d17 1 a17 22 #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]; 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); d19 9 a27 39 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) { d29 1 a29 2 if (fscanf(file,"%d (%[^)]) %c %d",&dummy,comm,(char *) &dummy, &ppid) == 4) { d31 10 a40 2 +#if defined(BSD_44_PROC) && !defined(BSD_PROC_CMDLINE) + add_proc(comm,pid,ppid,st.st_uid,NULL,0); d42 13 a54 10 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); } +#endif } (void) fclose(file); d56 16 @ 1.4 log @Fix my sloppiness...this should fix 1.4.x compiles. @ text @d4 1 a4 1 +++ pstree.c Sat Mar 18 22:06:19 2000 d70 1 a70 1 @@@@ -387,8 +402,11 @@@@ d77 2 d85 1 a85 1 @@@@ -402,15 +420,26 @@@@ d112 1 a112 1 @@@@ -427,6 +456,7 @@@@ @ 1.3 log @Updated psmisc to version 19. Changes from version 17: - supports /proc/cmdline on NetBSD - killall: new option -g to kill process group instead of process - pidof: new option -g to show PGID instead of PID (by Florian La Roche) - pstree: new option -H to highlight process specified by PID @ text @d4 1 a4 1 +++ pstree.c Thu Mar 16 23:22:45 2000 d105 1 a105 1 + add_proc(comm,pid,ppid,st,st_uid,NULL,0); d110 1 a110 2 @@@@ -426,6 +455,7 @@@@ (void) close(fd); d113 1 a114 1 } d117 1 @ 1.2 log @Add NetBSD RCS Ids. @ text @d3 3 a5 3 --- pstree.c.orig Tue Aug 26 17:09:05 1997 +++ pstree.c Sun Jul 19 15:20:24 1998 @@@@ -2,6 +2,14 @@@@ d7 1 a7 1 /* Copyright 1993-1996 Werner Almesberger. See file COPYING for details. */ d9 1 a9 5 +#ifdef __NetBSD__ +#define HAVE_SYS_SYSLIMITS_H +#define BSD_44_PROC +#define BSD_TERMCAP +#else /* Linux */ a10 1 +#define ENABLE_PRINT_ARGS d15 1 a15 1 @@@@ -9,12 +17,17 @@@@ d26 1 a27 3 +#ifdef HAVE_SYS_SYSLIMITS_H +#include +#endif d31 12 a42 2 @@@@ -251,7 +264,10 @@@@ CHILD *walk,*next,**scan; d46 1 a46 3 +#ifdef BSD_TERMCAP + char tbuf[1024], *tbufptr; +#endif d50 1 a50 1 @@@@ -270,7 +286,12 @@@@ d54 3 a56 6 +#ifdef BSD_TERMCAP + tbufptr = tbuf; + if (current->highlight && (tmp = tgetstr("md",&tbufptr))) tputs(tmp,1,putchar); +#else if (current->highlight && (tmp = tgetstr("md",NULL))) tputs(tmp,1,putchar); +#endif d60 1 a60 1 @@@@ -297,7 +318,12 @@@@ d64 3 a66 6 +#ifdef BSD_TERMCAP + tbufptr = tbuf; + if (current->highlight && (tmp = tgetstr("me",&tbufptr))) tputs(tmp,1,putchar); +#else if (current->highlight && (tmp = tgetstr("me",NULL))) tputs(tmp,1,putchar); +#endif d70 1 a70 1 @@@@ -387,8 +413,10 @@@@ d74 1 a74 1 +#ifndef BSD_44_PROC d77 1 d83 1 a83 1 @@@@ -402,17 +430,28 @@@@ a97 2 - if (fscanf(file,"%d (%[^)]) %c %d",&dummy,comm,(char *) &dummy, - &ppid) == 4) { d99 1 a99 1 + if (fscanf(file, "%s %*d %d", comm, &ppid) == 2) { d101 2 a102 1 + if (fscanf(file,"%*d (%[^)]) %*c %d",comm,&ppid) == 2) { d104 3 a108 4 +#ifdef BSD_44_PROC + /* NetBSD 1.3 /proc doesn't seem to do command-lines */ + add_proc(comm,pid,ppid,st.st_uid,buffer,0); +#else d110 1 a110 3 if ((fd = open(path,O_RDONLY)) < 0) { perror(path); @@@@ -426,6 +465,7 @@@@ @ 1.1 log @Initial addition of psmisc-17, some miscellaneous proc FS tools: killall, pidof, and pstree. Closes pr 5801 by Ben Harris. @ text @d1 2 @