History log of /openbsd-src/usr.bin/pkill/pkill.c (Results 1 – 25 of 43)
Revision Date Author Comments
# cb3e16ae 01-Sep-2021 deraadt <deraadt@openbsd.org>

A couple commands don't need sys/param.h, but they do need sys/signal.h


# 0f1976c8 16-Dec-2019 guenther <guenther@openbsd.org>

Delete tests for P_THREAD that predate the existence of
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

Delete tests for P_THREAD that predate the existence of
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@

show more ...


# 3aaa63eb 28-Jun-2019 deraadt <deraadt@openbsd.org>

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if

When system calls indicate an error they return -1, not some arbitrary
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.

show more ...


# a0f924b8 16-Sep-2018 millert <millert@openbsd.org>

Use uid_from_user(3) and gid_from_group(3) in utilities that
do repeated lookups. OK tb@


# 65e8c1ce 10-Oct-2016 gsoares <gsoares@openbsd.org>

- mark delim variable as const. it is a literal string;
- no need to declare main() prototype;
- mark all functions as static;
- add __dead marker to usage(), since it doesn't return;
- zap extern *o

- mark delim variable as const. it is a literal string;
- 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@

show more ...


# 5c17cc01 11-Oct-2015 deraadt <deraadt@openbsd.org>

fix a regression spotted by chris@. the -f and -I arguments fetch process
arguments using kvm_getargs, after the pledge() has been made. someone
brave should refactor this, hoisting the argument fe

fix a regression spotted by chris@. the -f and -I arguments fetch process
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.

show more ...


# 814f35ab 10-Oct-2015 deraadt <deraadt@openbsd.org>

pkill has to get all the getopt, getpwuid, libkvm stuff out of the way
first. it can pledge to "stdio" (pgrep case) or "stdio proc" (pkill case)
before parsing and matching the expression.
ok doug


# b9fc9a72 16-Jan-2015 deraadt <deraadt@openbsd.org>

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_N

Replace <sys/param.h> with <limits.h> and other less dirty headers where
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)

show more ...


# db4177c9 07-May-2014 tedu <tedu@openbsd.org>

calloc, from peter malone


# 43a6699f 12-Nov-2013 deraadt <deraadt@openbsd.org>

simpler prototype repairs


# 447f61ce 22-Sep-2013 guenther <guenther@openbsd.org>

Stop merging the per-thread and per-process flags when reporting
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.
Fl

Stop merging the per-thread and per-process flags when reporting
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@

show more ...


# e880abb2 03-Jun-2013 tedu <tedu@openbsd.org>

-I to confirm pkills. ok many


# a33a3c03 12-Dec-2012 halex <halex@openbsd.org>

properly handle the case where a process has disappeared in between grep'ing
and printing it

discussed with and ok millert@


# dbc30627 21-Aug-2012 ajacoutot <ajacoutot@openbsd.org>

Missing "-q" in usage().

ok espie@


# d2e6cab4 21-Aug-2012 espie <espie@openbsd.org>

add -q "silent" option similar to grep
okay ajacoutot@, guenther@


# 04bf3307 10-Jul-2012 halex <halex@openbsd.org>

make pkill -l print the proper processes also when the invert (-v)
flag is passed

ok lum@


# 6d14cb19 21-Apr-2012 guenther <guenther@openbsd.org>

Remove a check made superfluous by the KERN_PROC_SHOW_THREADS flag.
This lets new binaries work (at least w/o the -H option) with old kernels.

ok pirofti@ deraadt@


# 243c13be 12-Apr-2012 pirofti <pirofti@openbsd.org>

Add per thread accounting, mainly for usage & friends.

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 userla

Add per thread accounting, mainly for usage & friends.

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@.

show more ...


# f8b69d17 13-Mar-2012 sthen <sthen@openbsd.org>

Teach pgrep/pkill to only match processes, not threads. ok guenther@


# d72da473 01-Mar-2012 lum <lum@openbsd.org>

Remove unused variable. Added in 1.20 by me.


# 1e77ae25 16-Feb-2012 jmc <jmc@openbsd.org>

exit usage() with STATUS_BADUSAGE rather than STATUS_ERROR, per the man page;

fix proposed by lum actually happened in netbsd -r1.16, some 6 years ago;
ok lum


# 2e74a01c 15-Feb-2012 jmc <jmc@openbsd.org>

avoid usage() warping onto the next line;


# 1b2463c8 09-Feb-2012 markus <markus@openbsd.org>

restrict pkill/pgrep to the routing domain specified by -T; ok henning@, mpf@


# 0475d536 17-Jan-2012 lum <lum@openbsd.org>

Allow pkill to use the -l option. This displays which processes have been
signalled using the "Long" format, like pgrep.

Original diff from FreeBSD, modified somewhat on tech@, with feedback from ni

Allow pkill to use the -l option. This displays which processes have been
signalled using the "Long" format, like pgrep.

Original diff from FreeBSD, modified somewhat on tech@, with feedback from nicm@

Man page input from jmc@

show more ...


# 5027561d 10-Apr-2011 guenther <guenther@openbsd.org>

Switch back from KERN_PROC2/kinfo_proc2 to KERN_PROC/kinfo_proc now
that we've got name we want for the API we want

"ZAP!" deraadt@


12