Lines Matching defs:utmp

68 #  define utmp utmpx
87 # include <utmp.h>
97 # define UTNAMLEN sizeof(((struct utmp *) 0)->ut_name)
98 # define UTLINLEN sizeof(((struct utmp *) 0)->ut_line)
103 # define UTHOSTLEN sizeof(((struct utmp *) 0)->ut_host)
108 struct utmp __ut;
125 # define TCSH_PATH_UTMP "/etc/utmp"
192 * Watch /etc/utmp for login/logout changes.
200 struct utmp *uptr;
204 struct utmp utmp;
214 USE(utmp);
246 * Don't open utmp all the time, stat it first...
276 * xterm clears the entire utmp entry - mark everyone on the status list
283 * Read in the utmp file, sort the entries, and update existing entries or
288 memcpy(&utmp, uptr, sizeof (utmp));
290 while (xread(utmpfd, &utmp, sizeof utmp) == sizeof utmp) {
295 if (utmp.ut_type != USER_PROCESS)
298 /* Why is that? Cause the utmp file is always corrupted??? */
299 if (utmp.ut_type != USER_PROCESS && utmp.ut_type != DEAD_PROCESS)
304 if (utmp.ut_name[0] == '\0' && utmp.ut_line[0] == '\0')
307 if (utmp.ut_type == DEAD_PROCESS && utmp.ut_line[0] == '\0')
311 while (wp->who_next && (comp = strncmp(wp->who_tty, utmp.ut_line, UTLINLEN)) < 0)
315 if (utmp.ut_time < wp->who_time)
318 if (utmp.ut_type == DEAD_PROCESS) {
319 wp->who_time = utmp.ut_time;
324 if (utmp.ut_name[0] == '\0') {
325 wp->who_time = utmp.ut_time;
328 else if (strncmp(utmp.ut_name, wp->who_name, UTNAMLEN) == 0) {
330 wp->who_time = utmp.ut_time;
334 (void) strncpy(wp->who_new, utmp.ut_name, UTNAMLEN);
343 (void) strncpy(wp->who_host, utmp.ut_host, UTHOSTLEN);
346 wp->who_time = utmp.ut_time;
353 else { /* new tty in utmp */
355 (void) strncpy(wpnew->who_tty, utmp.ut_line, UTLINLEN);
364 (void) strncpy(wpnew->who_host, utmp.ut_host, UTHOSTLEN);
367 wpnew->who_time = utmp.ut_time;
369 if (utmp.ut_type == DEAD_PROCESS)
373 if (utmp.ut_name[0] == '\0')
376 (void) strncpy(wpnew->who_new, utmp.ut_name, UTNAMLEN);
423 if (wp->who_status & CLEARED) {/* utmp entry was cleared */