Lines Matching defs:utmpp

100 static struct	utmpx *utmpp;	/* pointer for getutxent()	*/
112 #define NMAX (sizeof (utmpp->ut_user))
113 #define LMAX (sizeof (utmpp->ut_line))
126 static char nameval[sizeof (utmpp->ut_user) + 1]; /* invoker's name */
144 static char user[sizeof (utmpp->ut_user) + 1]; /* holds user name */
482 char device[sizeof (utmpp->ut_line) + 1];
486 char path[sizeof (utmpp->ut_line) + 6];
495 if (utmpp->ut_user[0] == '\0')
498 (void) strncpy(user, utmpp->ut_user, sizeof (user));
523 if (utmpp->ut_type == RUN_LVL || utmpp->ut_type == DEAD_PROCESS) {
524 pterm = utmpp->ut_exit.e_termination;
525 pexit = utmpp->ut_exit.e_exit;
531 lptr = localtime(&utmpp->ut_xtime);
538 if (utmpp->ut_line[0] == '\0')
541 (void) strncpy(device, utmpp->ut_line,
542 sizeof (utmpp->ut_line));
543 device[sizeof (utmpp->ut_line)] = '\0';
550 if (Topt && (utmpp->ut_type == USER_PROCESS)) {
553 (void) strncpy(path + 5, utmpp->ut_line,
554 sizeof (utmpp->ut_line));
555 path[5 + sizeof (utmpp->ut_line)] = '\0';
576 if (utmpp->ut_type == USER_PROCESS) {
578 (void) strncpy(path + 5, utmpp->ut_line,
579 sizeof (utmpp->ut_line));
580 path[5 + sizeof (utmpp->ut_line)] = '\0';
601 if (utmpp->ut_type != BOOT_TIME &&
602 utmpp->ut_type != RUN_LVL &&
603 utmpp->ut_type != ACCOUNTING)
604 (void) printf(" %5ld", utmpp->ut_pid);
609 if (utmpp->ut_type == DEAD_PROCESS) {
611 utmpp->ut_id);
614 } else if (utmpp->ut_type != INIT_PROCESS) {
625 * utmpp->ut_id
627 while ((rc = strncmp(utmpp->ut_id, iinit,
663 if (utmpp->ut_type == INIT_PROCESS)
664 (void) printf(gettext(" id=%4.4s"), utmpp->ut_id);
668 if (dopt && utmpp->ut_type == DEAD_PROCESS) {
678 if (utmpp->ut_type == RUN_LVL) {
679 (void) printf(" %c %5ld %c", pterm, utmpp->ut_pid,
690 if (utmpp->ut_type == BOOT_TIME) {
700 if (utmpp && utmpp->ut_host[0])
701 (void) printf("\t(%.*s)", sizeof (utmpp->ut_host),
702 utmpp->ut_host);
722 while ((utmpp = getutxent()) != NULL) {
726 utmpp->ut_user, utmpp->ut_id, utmpp->ut_line, utmpp->ut_type);
728 if (utmpp->ut_type <= UTMAXTYPE) {
733 if (strncmp(myname, utmpp->ut_user,
734 sizeof (utmpp->ut_user)) == 0 &&
735 strncmp(mytty, utmpp->ut_line,
736 sizeof (utmpp->ut_line)) == 0 &&
737 utmpp->ut_type == USER_PROCESS) {
755 if (validtype[utmpp->ut_type]) {
757 if (utmpp->ut_type == LOGIN_PROCESS) {
758 if ((utmpp->ut_line[0] == '\0') ||
759 (strcmp(utmpp->ut_user, "LOGIN") != 0))
768 "of %d\n"), program, utmpp->ut_type);
799 utmpp = &utmpt;