/* * return ptr to name corresponding to uid * try ctmp first, then use uidtonam (internal list or passwd file) */ char * getname(uid_t uid, dev_t tty, time_t start) { char *p; if ((p = getnamc(uid, tty, start)) != NULL) return (p); return (uidtonam(uid)); }
void print_node(const void *node, VISIT order, int level) { if (order == postorder || order == leaf) { tb.ta_uid = (*(struct utab **)node)->ut_uid; CPYN(tb.ta_name, (char *)uidtonam((*(struct utab **)node)->ut_uid)); tb.ta_cpu[0] = (*(struct utab **)node)->ut_cpu[0]; tb.ta_cpu[1] = (*(struct utab **)node)->ut_cpu[1]; tb.ta_kcore[0] = (*(struct utab **)node)->ut_kcore[0]; tb.ta_kcore[1] = (*(struct utab **)node)->ut_kcore[1]; tb.ta_pc = (*(struct utab **)node)->ut_pc; fwrite(&tb, sizeof(tb), 1, stdout); } }