Lines Matching refs:utx

733 set_utmpx_time(struct logininfo *li, struct utmpx *utx)  in set_utmpx_time()  argument
736 utx->ut_tv.tv_sec = li->tv_sec; in set_utmpx_time()
737 utx->ut_tv.tv_usec = li->tv_usec; in set_utmpx_time()
739 utx->ut_time = li->tv_sec; in set_utmpx_time()
744 construct_utmpx(struct logininfo *li, struct utmpx *utx) in construct_utmpx() argument
749 memset(utx, '\0', sizeof(*utx)); in construct_utmpx()
752 line_abbrevname(utx->ut_id, li->line, sizeof(utx->ut_id)); in construct_utmpx()
758 utx->ut_type = USER_PROCESS; in construct_utmpx()
761 utx->ut_type = DEAD_PROCESS; in construct_utmpx()
764 line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line)); in construct_utmpx()
765 set_utmpx_time(li, utx); in construct_utmpx()
766 utx->ut_pid = li->pid; in construct_utmpx()
769 strncpy(utx->ut_user, li->username, in construct_utmpx()
770 MIN_SIZEOF(utx->ut_user, li->username)); in construct_utmpx()
781 strncpy(utx->ut_host, li->hostname, in construct_utmpx()
782 MIN_SIZEOF(utx->ut_host, li->hostname)); in construct_utmpx()
787 utx->ut_addr = li->hostaddr.sa_in.sin_addr.s_addr; in construct_utmpx()
793 memcpy(utx->ut_addr_v6, sa6->sin6_addr.s6_addr, 16); in construct_utmpx()
795 utx->ut_addr_v6[0] = utx->ut_addr_v6[3]; in construct_utmpx()
796 utx->ut_addr_v6[1] = 0; in construct_utmpx()
797 utx->ut_addr_v6[2] = 0; in construct_utmpx()
798 utx->ut_addr_v6[3] = 0; in construct_utmpx()
804 utx->ut_syslen = MIN(strlen(li->hostname), sizeof(utx->ut_host)); in construct_utmpx()
1001 utmpx_write_library(struct logininfo *li, struct utmpx *utx) in utmpx_write_library() argument
1004 pututxline(utx); in utmpx_write_library()
1016 utmpx_write_direct(struct logininfo *li, struct utmpx *utx) in utmpx_write_direct() argument
1026 struct utmpx utx; in utmpx_perform_login() local
1028 construct_utmpx(li, &utx); in utmpx_perform_login()
1030 if (!utmpx_write_library(li, &utx)) { in utmpx_perform_login()
1047 struct utmpx utx; in utmpx_perform_logout() local
1049 construct_utmpx(li, &utx); in utmpx_perform_logout()
1051 line_abbrevname(utx.ut_id, li->line, sizeof(utx.ut_id)); in utmpx_perform_logout()
1054 utx.ut_type = DEAD_PROCESS; in utmpx_perform_logout()
1058 utmpx_write_library(li, &utx); in utmpx_perform_logout()
1060 utmpx_write_direct(li, &utx); in utmpx_perform_logout()
1263 wtmpx_write(struct logininfo *li, struct utmpx *utx) in wtmpx_write() argument
1276 if (atomicio(vwrite, fd, utx, sizeof(*utx)) != sizeof(*utx)) { in wtmpx_write()
1286 updwtmpx(WTMPX_FILE, utx); in wtmpx_write()
1295 struct utmpx utx; in wtmpx_perform_login() local
1297 construct_utmpx(li, &utx); in wtmpx_perform_login()
1298 return (wtmpx_write(li, &utx)); in wtmpx_perform_login()
1305 struct utmpx utx; in wtmpx_perform_logout() local
1307 construct_utmpx(li, &utx); in wtmpx_perform_logout()
1308 return (wtmpx_write(li, &utx)); in wtmpx_perform_logout()
1331 wtmpx_islogin(struct logininfo *li, struct utmpx *utx) in wtmpx_islogin() argument
1333 if (strncmp(li->username, utx->ut_user, in wtmpx_islogin()
1334 MIN_SIZEOF(li->username, utx->ut_user)) == 0 ) { in wtmpx_islogin()
1336 if (utx->ut_type == USER_PROCESS) in wtmpx_islogin()
1350 struct utmpx utx; in wtmpx_get_entry() local
1376 if (atomicio(read, fd, &utx, sizeof(utx)) != sizeof(utx)) { in wtmpx_get_entry()
1386 if (wtmpx_islogin(li, &utx)) { in wtmpx_get_entry()
1389 li->tv_sec = utx.ut_tv.tv_sec; in wtmpx_get_entry()
1391 li->tv_sec = utx.ut_time; in wtmpx_get_entry()
1393 line_fullname(li->line, utx.ut_line, sizeof(li->line)); in wtmpx_get_entry()
1395 strlcpy(li->hostname, utx.ut_host, in wtmpx_get_entry()
1396 MIN_SIZEOF(li->hostname, utx.ut_host)); in wtmpx_get_entry()
1631 struct utmpx *utx; in utmpx_get_entry() local
1635 utx = getutxuser(li->username); in utmpx_get_entry()
1636 if (utx == NULL) { in utmpx_get_entry()
1641 line_fullname(li->line, utx->ut_line, in utmpx_get_entry()
1642 MIN_SIZEOF(li->line, utx->ut_line)); in utmpx_get_entry()
1643 strlcpy(li->hostname, utx->ut_host, in utmpx_get_entry()
1644 MIN_SIZEOF(li->hostname, utx->ut_host)); in utmpx_get_entry()
1645 li->tv_sec = utx->ut_tv.tv_sec; in utmpx_get_entry()
1646 li->tv_usec = utx->ut_tv.tv_usec; in utmpx_get_entry()