Lines Matching refs:up

167 	struct uproc	*up, *parent, *pgrp;
275 "up %d day(s), %d hr(s), "
338 up = findhash(info.pr_pid);
339 up->p_ttyd = info.pr_ttydev;
340 up->p_state = (info.pr_nlwp == 0? ZOMBIE : RUNNING);
341 up->p_time = 0;
342 up->p_ctime = 0;
343 up->p_igintr = 0;
344 (void) strncpy(up->p_comm, info.pr_fname,
346 up->p_args[0] = 0;
348 if (up->p_state != NONE && up->p_state != ZOMBIE) {
376 up->p_time = statinfo.pr_utime.tv_sec +
378 up->p_ctime = statinfo.pr_cutime.tv_sec +
407 up->p_igintr =
411 up->p_args[0] = 0;
418 (void) strcpy(up->p_args, info.pr_psargs);
419 if (up->p_args[0] == 0 ||
420 up->p_args[0] == '-' &&
421 up->p_args[1] <= ' ' ||
422 up->p_args[0] == '?') {
423 (void) strcat(up->p_args, " (");
424 (void) strcat(up->p_args, up->p_comm);
425 (void) strcat(up->p_args, ")");
438 up->p_pgrplink = pgrp->p_pgrplink;
439 pgrp->p_pgrplink = up;
446 up->p_sibling = parent->p_child;
447 up->p_child = 0;
449 parent->p_child = up;
505 * tree starting from the given process pointer(up).
510 showproc(struct uproc *up)
514 if (up->p_state == VISITED) /* we already been here */
517 if (up->p_state == ZOMBIE)
519 LINE_WIDTH, (int)LMAX, " ?", (int)up->p_upid, 0L, 0L,
521 else if (up->p_state != NONE) {
523 LINE_WIDTH, (int)LMAX, getty(up->p_ttyd), (int)up->p_upid,
524 up->p_time / 60L, up->p_time % 60L,
525 up->p_comm);
527 up->p_state = VISITED;
530 if (up->p_child) {
531 showproc(up->p_child);
532 for (zp = up->p_child->p_sibling; zp; zp = zp->p_sibling) {
538 if (up->p_pgrplink)
539 showproc(up->p_pgrplink);
550 showtotals(struct uproc *up)
557 calctotals(up);
574 * tree starting from the given process pointer(up).
582 calctotals(struct uproc *up)
586 if (up->p_state == VISITED)
588 up->p_state = VISITED;
589 if (up->p_state == NONE || up->p_state == ZOMBIE)
591 jobtime += up->p_time + up->p_ctime;
592 proctime += up->p_time;
594 if (empty && !up->p_igintr) {
599 if (up->p_upid > curpid && (!up->p_igintr || empty)) {
600 curpid = up->p_upid;
601 (void) strcpy(doing, up->p_args);
605 if (up->p_child) {
606 calctotals(up->p_child);
607 for (zp = up->p_child->p_sibling; zp; zp = zp->p_sibling)
700 struct uproc *up, *tp;
702 tp = up = &pr_htbl[(int)pid % HSIZE];
703 if (up->p_upid == 0) { /* empty slot */
704 up->p_upid = pid;
705 up->p_state = NONE;
706 up->p_child = up->p_sibling = up->p_pgrplink = up->p_link = 0;
707 return (up);
709 if (up->p_upid == pid) { /* found in hash table */
710 return (up);
712 for (tp = up->p_link; tp; tp = tp->p_link) { /* follow chain */
727 tp->p_link = up->p_link; /* insert after head */
728 up->p_link = tp;