Home | History | Annotate | Download | only in posix

Lines Matching full:pgrep

44  * TODO: pgrep -f only searches the amount of cmdline that fits in toybuf.
50 USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
166 config PGREP
167 bool "pgrep"
171 usage: pgrep [-cL] [-d DELIM] [-L SIGNAL] [PATTERN]
185 usage: pgrep [-fnovx] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]
251 } pgrep;
1466 // pkill's plumbing wraps pgrep's and thus mostly takes place in pgrep's flag
1467 // context, so force pgrep's flags on even when building pkill standalone.
1468 // (All the pgrep/pkill functions drop out when building ps standalone.)
1481 if (TT.pgrep.signal) {
1482 if (kill(*tb->slot, TT.pgrep.signal)) {
1483 char *s = num_to_sig(TT.pgrep.signal);
1485 if (!s) sprintf(s = toybuf, "%d", TT.pgrep.signal);
1489 if (!(toys.optflags&FLAG_c) && (!TT.pgrep.signal || TT.tty)) {
1494 printf("%s", TT.pgrep.d ? TT.pgrep.d : "\n");
1505 if (TT.pgrep.self == *tb->slot) return;
1507 if (TT.pgrep.regexes) {
1508 for (reg = TT.pgrep.regexes; reg; reg = reg->next) {
1525 free(TT.pgrep.snapshot);
1526 TT.pgrep.snapshot = xmemdup(toybuf, (name+strlen(name)+1)-toybuf);
1542 TT.pgrep.self = getpid();
1545 if (TT.pgrep.L && 1>(TT.pgrep.signal = sig_to_num(TT.pgrep.L)))
1546 error_exit("bad -L '%s'", TT.pgrep.L);
1548 comma_args(TT.pgrep.G, &TT.GG, "bad -G", parse_rest);
1549 comma_args(TT.pgrep.g, &TT.gg, "bad -g", parse_rest);
1550 comma_args(TT.pgrep.P, &TT.PP, "bad -P", parse_rest);
1551 comma_args(TT.pgrep.s, &TT.ss, "bad -s", parse_rest);
1552 comma_args(TT.pgrep.t, &TT.tt, "bad -t", parse_rest);
1553 comma_args(TT.pgrep.U, &TT.UU, "bad -U", parse_rest);
1554 comma_args(TT.pgrep.u, &TT.uu, "bad -u", parse_rest);
1564 reg->next = TT.pgrep.regexes;
1565 TT.pgrep.regexes = reg;
1572 if (TT.pgrep.snapshot) {
1573 do_pgk(TT.pgrep.snapshot);
1574 if (CFG_TOYBOX_FREE) free(TT.pgrep.snapshot);
1576 if (TT.pgrep.d) xputc('\n');
1585 if (!TT.pgrep.L) TT.pgrep.signal = SIGTERM;