summaryrefslogtreecommitdiff
path: root/usr.bin/pkill
AgeCommit message (Collapse)Author
2021-09-01A couple commands don't need sys/param.h, but they do need sys/signal.hTheo de Raadt
2020-11-14Simplify wording of the matching rules, with help and ok jmc@Otto Moerbeek
2019-12-16Delete tests for P_THREAD that predate the existence ofPhilip Guenther
KERN_PROC_SHOW_THREADS and have been rendered superfluous by it. Similarly, some P_SYSTEM tests can be deleted or pushed to the kernel by using KERN_PROC_ALL instead of KERN_PROC_KTHREAD. ok visa@ mpi@
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2018-09-16Use uid_from_user(3) and gid_from_group(3) in utilities thatTodd C. Miller
do repeated lookups. OK tb@
2018-08-31clarify that patterns are extended regular expressions; ok millert@ phessler@Christian Weisgerber
2017-07-09remove redundant variable declarations in Makefiles, since those areMarc Espie
the default. okay millert@
2016-10-10- mark delim variable as const. it is a literal string;Gleydson Soares
- no need to declare main() prototype; - mark all functions as static; - add __dead marker to usage(), since it doesn't return; - zap extern *optarg/optind in main(), It is already done in unistd.h; - return from main instead of exit(3) that enables stack protector; - fix err() eval in pledge()s error path. OK millert@
2016-03-30for some time now mandoc has not required MLINKS to functionJason McIntyre
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2015-10-11fix a regression spotted by chris@. the -f and -I arguments fetch processTheo de Raadt
arguments using kvm_getargs, after the pledge() has been made. someone brave should refactor this, hoisting the argument fetching to between kvm_getprocs() and pledge() - storing the argument data as neccessary. the current situation is also a race -- it fetches the data twice.
2015-10-10pkill has to get all the getopt, getpwuid, libkvm stuff out of the wayTheo de Raadt
first. it can pledge to "stdio" (pgrep case) or "stdio proc" (pkill case) before parsing and matching the expression. ok doug
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-05-07calloc, from peter maloneTed Unangst
2013-11-12simpler prototype repairsTheo de Raadt
2013-09-22Stop merging the per-thread and per-process flags when reportingPhilip Guenther
them via sysctl(KERN_PROC). In struct kinfo_proc the per-process flags move to p_psflags, leaving the per-thread flags in p_flags. Flag descriptions in ps(1) updated to be less obtuse. discussed with matthew@ some time ago; ok jca@, manpage bits ok jmc@
2013-07-16use .Mt for email addresses; from Jan Stary <hans at stare dot cz>; ok jmc@Ingo Schwarze
2013-06-03sort options list;Jason McIntyre
2013-06-03-I to confirm pkills. ok manyTed Unangst
2012-12-12properly handle the case where a process has disappeared in between grep'ingAlexander Hall
and printing it discussed with and ok millert@
2012-08-21Missing "-q" in usage().Antoine Jacoutot
ok espie@
2012-08-21Sort options.Antoine Jacoutot
"obviously okay" espie@
2012-08-21add -q "silent" option similar to grepMarc Espie
okay ajacoutot@, guenther@
2012-07-10make pkill -l print the proper processes also when the invert (-v)Alexander Hall
flag is passed ok lum@
2012-04-21Remove a check made superfluous by the KERN_PROC_SHOW_THREADS flag.Philip Guenthe
This lets new binaries work (at least w/o the -H option) with old kernels. ok pirofti@ deraadt@
2012-04-12Add per thread accounting, mainly for usage & friends.Paul Irofti
This expands the already bloated FILL_KPROC macro to take an extra parameter that indicates if the callee is a thread or a process. The userland bits are adjusted accordingly and ps(1) and top(1) now display per thread usage times when -H is used. Also pkill(1) had to be adjusted so that duplicates don't pop up. libkvm does basically the same thing as the kernel bits. Okay guenther@.
2012-03-13Teach pgrep/pkill to only match processes, not threads. ok guenther@Stuart Henderson
2012-03-01Remove unused variable. Added in 1.20 by me.lum
2012-02-16exit usage() with STATUS_BADUSAGE rather than STATUS_ERROR, per the man page;Jason McIntyre
fix proposed by lum actually happened in netbsd -r1.16, some 6 years ago; ok lum
2012-02-15avoid usage() warping onto the next line;Jason McIntyre
2012-02-09restrict pkill/pgrep to the routing domain specified by -T; ok henning@, mpf@Markus Friedl
2012-01-17Allow pkill to use the -l option. This displays which processes have beenlum
signalled using the "Long" format, like pgrep. Original diff from FreeBSD, modified somewhat on tech@, with feedback from nicm@ Man page input from jmc@
2011-04-10Switch back from KERN_PROC2/kinfo_proc2 to KERN_PROC/kinfo_proc nowPhilip Guenthe
that we've got name we want for the API we want "ZAP!" deraadt@
2010-09-29various EXIT STATUS fixes; from Daniel DickmanJason McIntyre
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
2009-07-27document how patterns are matched and that only the first 16 charsJason McIntyre
are tracked to match the command name; pointed out by fgsch diff adapted from text from gad@freebsd ok fgsch sobrado millert
2009-06-07tweak -v; from Tim van der MolenJason McIntyre
2009-03-26fix a few typographical errors found by spell(1).Igor Sobrado
ok dtucker@, jmc@
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2008-02-11bump Mdocdate for pages committed in "febuary", necessary becauseJason McIntyre
of a typo in rcs.c;
2008-02-07Add add -o flag to pkill/pgrep like on Solaris and Linux.Todd C. Miller
OK jmc@ henning@ oga@ mikeb@
2007-10-31"signal" is an argument, not a flag;Jason McIntyre
originally requested by sobrado, and now Pierre Riteau
2007-05-31convert to new .Dd format;Jason McIntyre
2006-09-19Use S_IS* macros insted of masking with S_IF* flags. The latter mayOtto Moerbeek
have multiple bits set, which lead to surprising results. Spotted by Paul Stoeber, more to come. ok millert@ pedro@ jaredy@ djm@
2005-07-16- basic cleanupJason McIntyre
- do not use EXIT STATUS (non-standard in section 1)
2005-07-16sort options and sync usage();Jason McIntyre
2005-05-20Don't print an empty line when no match is found in pgrep mode.Otto Moerbeek
ok millert@ robert@
2005-04-11handle snprintf return value overflow case; ok ottoTheo de Raadt
2005-03-27revert r1.9; this one needs more discussionRobert Nagy
2005-03-27add a -i option to ignore case distinctions in the process match;Robert Nagy
From: NetBSD; ok millert@
2005-03-02Report non-existing user or groupname correctly. From David BrownleeOtto Moerbeek
<abs@netbsd>. ok millert@