version 1.36, 2015/01/16 06:40:10 |
version 1.37, 2015/10/10 14:25:42 |
|
|
int signum = SIGTERM; |
int signum = SIGTERM; |
int newest; |
int newest; |
int oldest; |
int oldest; |
|
char *pledge_choice = "stdio proc"; |
int quiet; |
int quiet; |
int inverse; |
int inverse; |
int longfmt; |
int longfmt; |
|
|
|
|
if (strcmp(__progname, "pgrep") == 0) { |
if (strcmp(__progname, "pgrep") == 0) { |
action = grepact; |
action = grepact; |
|
pledge_choice = "stdio"; |
pgrep = 1; |
pgrep = 1; |
} else { |
} else { |
action = killact; |
action = killact; |
|
|
plist = kvm_getprocs(kd, KERN_PROC_ALL, 0, sizeof(*plist), &nproc); |
plist = kvm_getprocs(kd, KERN_PROC_ALL, 0, sizeof(*plist), &nproc); |
if (plist == NULL) |
if (plist == NULL) |
errx(STATUS_ERROR, "kvm_getprocs() failed"); |
errx(STATUS_ERROR, "kvm_getprocs() failed"); |
|
|
|
if (pledge(pledge_choice, NULL) == -1) |
|
err(1, "pledge"); |
|
|
/* |
/* |
* Allocate memory which will be used to keep track of the |
* Allocate memory which will be used to keep track of the |