Lines Matching defs:utmp

60 #  define utmp utmpx
76 # include <utmp.h>
81 # include <utmp.h>
86 # define UTNAMLEN sizeof(((struct utmp *) 0)->ut_name)
87 # define UTLINLEN sizeof(((struct utmp *) 0)->ut_line)
92 # define UTHOSTLEN sizeof(((struct utmp *) 0)->ut_host)
97 struct utmp __ut;
116 # define TCSH_PATH_UTMP "/etc/utmp"
176 * Watch /etc/utmp for login/logout changes.
184 struct utmp *uptr;
188 struct utmp utmp;
199 USE(utmp);
247 * Don't open utmp all the time, stat it first...
277 * xterm clears the entire utmp entry - mark everyone on the status list
284 * Read in the utmp file, sort the entries, and update existing entries or
289 memcpy(&utmp, uptr, sizeof (utmp));
291 while (xread(utmpfd, &utmp, sizeof utmp) == sizeof utmp) {
296 if (utmp.ut_type != USER_PROCESS)
299 /* Why is that? Cause the utmp file is always corrupted??? */
300 if (utmp.ut_type != USER_PROCESS && utmp.ut_type != DEAD_PROCESS)
305 if (utmp.ut_name[0] == '\0' && utmp.ut_line[0] == '\0')
308 if (utmp.ut_type == DEAD_PROCESS && utmp.ut_line[0] == '\0')
312 while (wp->who_next && (comp = strncmp(wp->who_tty, utmp.ut_line, UTLINLEN)) < 0)
316 if (utmp.ut_time < wp->who_time)
319 if (utmp.ut_type == DEAD_PROCESS) {
320 wp->who_time = utmp.ut_time;
325 if (utmp.ut_name[0] == '\0') {
326 wp->who_time = utmp.ut_time;
329 else if (strncmp(utmp.ut_name, wp->who_name, UTNAMLEN) == 0) {
331 wp->who_time = utmp.ut_time;
335 (void) strncpy(wp->who_new, utmp.ut_name, UTNAMLEN);
344 (void) strncpy(wp->who_host, utmp.ut_host, UTHOSTLEN);
347 wp->who_time = utmp.ut_time;
354 else { /* new tty in utmp */
356 (void) strncpy(wpnew->who_tty, utmp.ut_line, UTLINLEN);
365 (void) strncpy(wpnew->who_host, utmp.ut_host, UTHOSTLEN);
368 wpnew->who_time = utmp.ut_time;
370 if (utmp.ut_type == DEAD_PROCESS)
374 if (utmp.ut_name[0] == '\0')
377 (void) strncpy(wpnew->who_new, utmp.ut_name, UTNAMLEN);
427 if (wp->who_status & CLEARED) {/* utmp entry was cleared */