Lines Matching refs:which
12 * the same field should be called "TT" which is _INSANE_ and I'm not doing it.
15 * the same title, which is not the same title as the default output. (No.)
21 * field always prints "-" with an alignment of 1, which is why it has 11
25 * which changes -l by removing the "F" column and swapping RSS for ADDR,
225 short which, len, reverse;
278 starting position of each string after the first (which is always 0). */
299 * slot: which slot[] out of procpid. Negative means it's a string field.
304 * so in this case "NAME" becomes PS_NAME which is the offset into typos[]
441 // about symbol order might be: "which *[><]=* *PS"
505 int which = field->which, sl = typos[which].slot;
509 if (which <= PS_BIT) {
512 if (which==PS_PRI) ll = 39-ll;
513 if (which==PS_ADDR) fmt = "%llx";
514 else if (which==PS_SZ) ll >>= 12;
515 else if (which==PS_RSS) ll <<= 2;
516 else if (which==PS_VSZ) ll >>= 10;
517 else if (which==PS_PR && ll<-9) fmt="RT";
518 else if ((which==PS_RTPRIO || which==PS_BIT) && ll == 0) fmt="-";
527 if (which==PS_ARGS || which==PS_COMM) {
531 for (i = 0; (which==PS_ARGS) ? i < slot[SLOT_argv0len] : out[i]; i++)
535 if (which>=PS_COMM && !*out) sprintf(out = buf, "[%s]", tb->str);
538 } else if (which <= PS_RGROUP) {
541 if (which > PS_RUSER) {
553 } else if (which <= PS_TIME_) {
557 if (which!=PS_TIME_) unit *= 60*24;
560 if (which==PS_ELAPSED) ll = (slot[SLOT_uptime]*j)-slot[SLOT_starttime];
565 for (s = 0, j = 2*(which==PS_TIME_); j<4; j++) {
566 if (!s && (seconds>unit || j == 1+(which!=PS_TIME))) s = out;
575 if (which==PS_TIME_ && s-out<8)
579 } else if (which <= PS__CPU) {
581 if (which==PS__VSZ || which==PS__MEM)
582 ll /= slot[SLOT_totalram]/((which==PS__VSZ) ? 1024 : 4096);
585 if (which==PS_C) sl += 5;
587 if (which!=PS_C && sl<1000) sprintf(out+strlen(out), ".%d", sl%10);
590 } else if (which <= PS_DIO) {
595 if ((ll = slot[typos[which].slot])<0) {
600 if (which <= PS_SHR) ll *= sysconf(_SC_PAGESIZE);
606 } else if (which==PS_F) sprintf(out, "%llo", (slot[SLOT_flags]>>6)&5);
607 else if (which==PS_S || which==PS_STAT) {
610 if (which==PS_STAT) {
619 } else if (which==PS_STIME) {
630 } else if (which==PS_PCY) sprintf(out, "%.2s", get_sched_policy_name(ll));
631 else if (CFG_TOYBOX_DEBUG) error_exit("bad which %d", which);
661 if ((field->which<=PS_BIT || FLAG(w)) && olen>abslen) {
772 // 18 (which is "obsolete, always 0" from stat)
975 // We do it for each file string slot but last is cmdline, which sticks.
1099 field->which = i;
1113 if (!field->title) field->title = typos[field->which].name;
1114 if (!field->len) field->len = typos[field->which].width;
1115 else if (typos[field->which].width<0) field->len *= -1;
1122 // and return bitfield of which FIELDs are used.
1131 bits |= 1LL<<field->which;
1223 slot = typos[field->which].slot;
1318 // Figure out which fields to display
1347 if (FLAG(n) && field->which>=PS_UID
1348 && field->which<=PS_RGROUP && (typos[field->which].slot&XX))
1349 field->which--;
1407 // select which of the -o fields to sort by
1418 field2->which = field->which;
1566 if (*toys.which->name == 't') {
1578 field.which = PS_S;
1636 int slot = typos[field->which].slot&(XX-1);
1638 if (field->which<PS_C || field->which>PS_DIO) continue;
1639 ll = 1LL<<field->which;
1645 " %s: %*s,", typos[field->which].name,