Lines Matching defs:ut

59     struct utmp *ut = (struct utmp *)l->arg;
61 if (!strncmp(ut->ut_line, devname, UT_LINESIZE)) {
89 struct utmp ut;
104 loc -= sizeof(ut);
109 xreadall(fd, &ut, sizeof(ut));
110 *tm = ut.ut_tv.tv_sec;
111 if (*ut.ut_line == '~') {
112 if (!strcmp(ut.ut_user, "runlevel")) ut.ut_type = RUN_LVL;
113 else if (!strcmp(ut.ut_user, "reboot")) ut.ut_type = BOOT_TIME;
114 else if (!strcmp(ut.ut_user, "shutdown")) ut.ut_type = SHUTDOWN_TIME;
115 } else if (!*ut.ut_user) ut.ut_type = DEAD_PROCESS;
116 else if (*ut.ut_user && *ut.ut_line && ut.ut_type != DEAD_PROCESS
117 && strcmp(ut.ut_user, "LOGIN")) ut.ut_type = USER_PROCESS;
121 if (!strcmp(ut.ut_user, "date")) {
122 if (ut.ut_line[0] == '|') ut.ut_type = OLD_TIME;
123 if (ut.ut_line[0] == '{') ut.ut_type = NEW_TIME;
126 if ((ut.ut_type == SHUTDOWN_TIME) || ((ut.ut_type == RUN_LVL) &&
127 (((ut.ut_pid & 255) == '0') || ((ut.ut_pid & 255) == '6'))))
129 tm[1] = tm[2] = (time_t)ut.ut_tv.tv_sec;
132 } else if (ut.ut_type == BOOT_TIME) {
134 strcpy(ut.ut_line, "system boot");
136 printf("%-8.8s %-12.12s %-*.*s %-16.16s %-7.7s %s\n", ut.ut_user,
137 ut.ut_line, pwidth, pwidth, ut.ut_host,
140 tm[2] = (time_t)ut.ut_tv.tv_sec;
141 } else if (ut.ut_type == USER_PROCESS && *ut.ut_line) {
142 struct arg_list *l = find_and_dlink(&TT.list, ut.ut_line);
147 printf("%-8.8s %-12.12s %-*.*s %-16.16s %-7.7s %s\n", ut.ut_user,
148 ut.ut_line, pwidth, pwidth, ut.ut_host,
155 if ((ut.ut_pid > 0) && (kill(ut.ut_pid, 0)!=0) && (errno == ESRCH))
177 printf("%-8.8s %-12.12s %-*.*s %-16.16s %-7.7s %s\n", ut.ut_user,
178 ut.ut_line, pwidth, pwidth, ut.ut_host,
181 llist_add_node(&TT.list, memcpy(xmalloc(sizeof(ut)), &ut, sizeof(ut)));
182 } else if (ut.ut_type == DEAD_PROCESS && *ut.ut_line)
183 llist_add_node(&TT.list, memcpy(xmalloc(sizeof(ut)), &ut, sizeof(ut)));
185 loc -= sizeof(ut);