[ excerpt from commands' man page ]
Port of NetBSD's pgrep(1) and pkill(1) commands which either find
or signal processes matching criteria.
The pgrep command searches the process table on the running system
and prints the process IDs of all processes that match the criteria
given on the command line.
The pkill command searches the process table on the running system
and signals all processes that match the criteria given on the
command line.
Remove code remnants that test for 3.X and earlier releases of FreeBSD.
The bsd.*.mk architecture has not supported these antique releases for
quite some time.
Hat: portmgr
o New port pkill version 0.1: NetBSD's pgrep and pkill: find or
signal processes matching criteria
o Based on current NetBSD's pgrep(1) and pkill(1) with the following
differences:
1) -STABLE version does not support filtering by session
ID since this information is only available in kernel
space. -CURRENT supports this.
2) Added -M and -N flags following ps(1). Therefore, drop
additional privileges (drop_privs) if any of those flags
are defined.
3) kvm access without sgid
o Items (2) and (3) are based on jmallett code sent to me for
inspiration. :) Great thanks to jmallett for that.
Obtained from: NetBSD CVS (original pkill/pgrep code)