Lines Matching refs:utmpp

100 static struct	utmpx *utmpp;	/* pointer for getutxent()	*/
105 #define NMAX (sizeof (utmpp->ut_user))
106 #define LMAX (sizeof (utmpp->ut_line))
122 static char nameval[sizeof (utmpp->ut_user) + 1]; /* invoker's name */
140 static char user[sizeof (utmpp->ut_user) + 1]; /* holds user name */
479 char device[sizeof (utmpp->ut_line) + 1];
483 char path[sizeof (utmpp->ut_line) + 6];
492 if (utmpp->ut_user[0] == '\0')
495 (void) strncpy(user, utmpp->ut_user, sizeof (user));
520 if (utmpp->ut_type == RUN_LVL || utmpp->ut_type == DEAD_PROCESS) {
521 pterm = utmpp->ut_exit.e_termination;
522 pexit = utmpp->ut_exit.e_exit;
528 lptr = localtime(&utmpp->ut_xtime);
535 if (utmpp->ut_line[0] == '\0')
538 (void) strncpy(device, utmpp->ut_line,
539 sizeof (utmpp->ut_line));
540 device[sizeof (utmpp->ut_line)] = '\0';
547 if (Topt && (utmpp->ut_type == USER_PROCESS)) {
550 (void) strncpy(path + 5, utmpp->ut_line,
551 sizeof (utmpp->ut_line));
552 path[5 + sizeof (utmpp->ut_line)] = '\0';
574 if (utmpp->ut_type == USER_PROCESS) {
576 (void) strncpy(path + 5, utmpp->ut_line,
577 sizeof (utmpp->ut_line));
578 path[5 + sizeof (utmpp->ut_line)] = '\0';
599 if (utmpp->ut_type != BOOT_TIME &&
600 utmpp->ut_type != RUN_LVL &&
601 utmpp->ut_type != ACCOUNTING)
602 (void) printf(" %5ld", utmpp->ut_pid);
607 if (utmpp->ut_type == DEAD_PROCESS) {
609 utmpp->ut_id);
612 } else if (utmpp->ut_type != INIT_PROCESS) {
623 * utmpp->ut_id
625 while ((rc = strncmp(utmpp->ut_id, iinit,
664 if (utmpp->ut_type == INIT_PROCESS)
665 (void) printf(gettext(" id=%4.4s"), utmpp->ut_id);
669 if (dopt && utmpp->ut_type == DEAD_PROCESS) {
679 if (utmpp->ut_type == RUN_LVL) {
680 (void) printf(" %c %5ld %c", pterm, utmpp->ut_pid,
691 if (utmpp->ut_type == BOOT_TIME) {
701 if (utmpp && utmpp->ut_host[0])
702 (void) printf("\t(%.*s)", sizeof (utmpp->ut_host),
703 utmpp->ut_host);
723 while ((utmpp = getutxent()) != NULL) {
727 utmpp->ut_user, utmpp->ut_id, utmpp->ut_line, utmpp->ut_type);
729 if (utmpp->ut_type <= UTMAXTYPE) {
734 if (strncmp(myname, utmpp->ut_user,
735 sizeof (utmpp->ut_user)) == 0 &&
736 strncmp(mytty, utmpp->ut_line,
737 sizeof (utmpp->ut_line)) == 0 &&
738 utmpp->ut_type == USER_PROCESS) {
756 if (validtype[utmpp->ut_type]) {
758 if (utmpp->ut_type == LOGIN_PROCESS) {
759 if ((utmpp->ut_line[0] == '\0') ||
760 (strcmp(utmpp->ut_user,
770 "of %d\n"), program, utmpp->ut_type);
801 utmpp = &utmpt;