Lines Matching defs:up

171 	struct uproc	*up, *parent, *pgrp;
279 " up %d day(s), %d hr(s), "
341 up = findhash(info.pr_pid);
342 up->p_ttyd = info.pr_ttydev;
343 up->p_state = (info.pr_nlwp == 0? ZOMBIE : RUNNING);
344 up->p_time = 0;
345 up->p_ctime = 0;
346 up->p_igintr = 0;
347 (void) strncpy(up->p_comm, info.pr_fname,
349 up->p_args[0] = 0;
351 if (up->p_state != NONE && up->p_state != ZOMBIE) {
379 up->p_time = statinfo.pr_utime.tv_sec +
381 up->p_ctime = statinfo.pr_cutime.tv_sec +
410 up->p_igintr =
414 up->p_args[0] = 0;
421 (void) strcpy(up->p_args, info.pr_psargs);
422 if (up->p_args[0] == 0 ||
423 up->p_args[0] == '-' &&
424 up->p_args[1] <= ' ' ||
425 up->p_args[0] == '?') {
426 (void) strcat(up->p_args, " (");
427 (void) strcat(up->p_args, up->p_comm);
428 (void) strcat(up->p_args, ")");
441 up->p_pgrplink = pgrp->p_pgrplink;
442 pgrp->p_pgrplink = up;
449 up->p_sibling = parent->p_child;
450 up->p_child = 0;
452 parent->p_child = up;
509 * tree starting from the given process pointer(up).
514 showproc(struct uproc *up)
518 if (up->p_state == VISITED) /* we already been here */
521 if (up->p_state == ZOMBIE)
523 LMAX, LMAX, " ?", (int)up->p_upid, 0L, 0L, "<defunct>");
524 else if (up->p_state != NONE) {
526 LMAX, LMAX, getty(up->p_ttyd), (int)up->p_upid,
527 up->p_time / 60L, up->p_time % 60L,
528 up->p_comm);
530 up->p_state = VISITED;
533 if (up->p_child) {
534 showproc(up->p_child);
535 for (zp = up->p_child->p_sibling; zp; zp = zp->p_sibling) {
541 if (up->p_pgrplink)
542 showproc(up->p_pgrplink);
553 showtotals(struct uproc *up)
560 calctotals(up);
577 * tree starting from the given process pointer(up).
585 calctotals(struct uproc *up)
589 if (up->p_state == VISITED)
591 up->p_state = VISITED;
592 if (up->p_state == NONE || up->p_state == ZOMBIE)
594 jobtime += up->p_time + up->p_ctime;
595 proctime += up->p_time;
597 if (empty && !up->p_igintr) {
602 if (up->p_upid > curpid && (!up->p_igintr || empty)) {
603 curpid = up->p_upid;
604 (void) strcpy(doing, up->p_args);
608 if (up->p_child) {
609 calctotals(up->p_child);
610 for (zp = up->p_child->p_sibling; zp; zp = zp->p_sibling)
703 struct uproc *up, *tp;
705 tp = up = &pr_htbl[(int)pid % HSIZE];
706 if (up->p_upid == 0) { /* empty slot */
707 up->p_upid = pid;
708 up->p_state = NONE;
709 up->p_child = up->p_sibling = up->p_pgrplink = up->p_link = 0;
710 return (up);
712 if (up->p_upid == pid) { /* found in hash table */
713 return (up);
715 for (tp = up->p_link; tp; tp = tp->p_link) { /* follow chain */
730 tp->p_link = up->p_link; /* insert after head */
731 up->p_link = tp;