utmp
undo_t utmp; \
utmp = x, x = y, y = utmp; \
login(struct utmp *utp)
struct utmp old_ut;
pos = (off_t)tty * sizeof(struct utmp);
pread(fd, &old_ut, sizeof(struct utmp), pos) ==
sizeof(struct utmp) &&
(void)pwrite(fd, utp, sizeof(struct utmp), pos);
(void)write(fd, utp, sizeof(struct utmp));
typedef struct utmp UTMP;
struct utmp ut;
if (write(fd, &ut, sizeof(struct utmp)) !=
sizeof(struct utmp))
struct utmp;
void login(struct utmp *);
if (statbf.st_size > INT_MAX - 10 * sizeof(struct utmp)) {
sizeof(struct utmp);
struct utmp *u;
if ((u = recallocarray(utmp, utmpsize,
free(utmp);
utmp = u;
n = pread(uf, utmp, statbf.st_size, 0);
nutmp = n / sizeof(struct utmp);
struct utmp *utp = &utmp[nutmp];
while (--utp >= utmp) {
notify(struct utmp *utp, off_t offset)
struct utmp *utmp = NULL;
void notify(struct utmp *, off_t);
struct utmp;
void ftpd_login(struct utmp *ut);
static struct utmp utmp; /* for utmp */
ftpd_logout(utmp.ut_line);
ftpd_logout(utmp.ut_line);
memset(&utmp, 0, sizeof(utmp));
(void)time(&utmp.ut_time);
(void)strncpy(utmp.ut_name, pw->pw_name, sizeof(utmp.ut_name));
(void)strncpy(utmp.ut_host, remotehost, sizeof(utmp.ut_host));
(void)strncpy(utmp.ut_line, ttyline, sizeof(utmp.ut_line));
ftpd_login(&utmp);
struct utmp ut;
while (read(fd, &ut, sizeof(struct utmp)) == sizeof(struct utmp)) {
(void)lseek(fd, -(off_t)sizeof(struct utmp), SEEK_CUR);
(void)write(fd, &ut, sizeof(struct utmp));
ftpd_login(struct utmp *ut)
struct utmp ubuf;
(void)lseek(fd, (off_t)topslot * sizeof(struct utmp), SEEK_SET);
if (read(fd, &ubuf, sizeof(struct utmp)) ==
sizeof(struct utmp)) {
(void)lseek(fd, -(off_t)sizeof(struct utmp),
(void)lseek(fd, (off_t)topslot * sizeof(struct utmp),
(void)write(fd, ut, sizeof(struct utmp));
struct utmp ut;
if (write(fd, (char *)&ut, sizeof(struct utmp)) !=
sizeof(struct utmp))
struct utmp usr;
struct utmp usr;
struct utmp usr;
struct utmp usr;
struct utmp ubuf, ubuf1;
struct utmp utmp;
memset(&utmp, 0, sizeof(utmp));
strlcpy(utmp.ut_line, tty, sizeof(utmp.ut_line));
strlcpy(utmp.ut_name, username, sizeof(utmp.ut_name));
time(&utmp.ut_time);
login(&utmp);
void enter_where(struct utmp *, PERSON *);
struct utmp user;
struct utmp user;
enter_where(struct utmp *ut, PERSON *pn)
print_entry(const struct utmp *bp)
struct utmp *bp;
want(struct utmp *bp, int check)
static struct utmp buf[1024]; /* utmp read buffer */
int want(struct utmp *, int);
void print_entry(const struct utmp *);
struct utmp utmp;
memset(&utmp, 0, sizeof(utmp));
(void)time(&utmp.ut_time);
(void)strncpy(utmp.ut_name, username, sizeof(utmp.ut_name));
(void)strncpy(utmp.ut_host, hostname, sizeof(utmp.ut_host));
(void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line));
login(&utmp);
struct utmp u;
struct utmp utmp;
while (read(ut, &utmp, sizeof(utmp)))
if (utmp.ut_name[0] != '\0')
struct utmp utmp;
while (fread((char *)&utmp, sizeof(utmp), 1, stdin) == 1) {
if (*utmp.ut_name) {
(void)strncpy(names[ncnt], utmp.ut_name, UT_NAMESIZE);
for (nusers = 0; fread(&utmp, sizeof(utmp), 1, ut);) {
if (utmp.ut_name[0] == '\0')
strncmp(utmp.ut_name, sel_user, UT_NAMESIZE) != 0))
memcpy(&(ep->utmp), &utmp, sizeof(utmp));
if (!(stp = ttystat(ep->utmp.ut_line)))
if (strncmp(ep->utmp.ut_line, "ftp", 3) == 0) {
(void)strncpy(pidstr, &ep->utmp.ut_line[3],
p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-";
(int)(ep->utmp.ut_host + UT_HOSTSIZE - x), x);
NAME_WIDTH, UT_NAMESIZE, ep->utmp.ut_name,
strncmp(ep->utmp.ut_line, "tty", 3) ?
ep->utmp.ut_line : ep->utmp.ut_line + 3,
pr_attime(&ep->utmp.ut_time, &now);
struct utmp utmp;
struct utmp utmp;
while (fread(&utmp, sizeof(utmp), 1, fp) == 1) {
if (!utmp.ut_name[0])
strncpy(username, utmp.ut_name, sizeof(utmp.ut_name));
username[sizeof(utmp.ut_name)] = '\0';
strncpy(line, utmp.ut_line, sizeof(utmp.ut_line));
line[sizeof(utmp.ut_line)] = '\0';
un->tty = strndup(line, sizeof(utmp.ut_line));
struct utmp utmp;
char line[sizeof(utmp.ut_line) + 1];
char username[sizeof(utmp.ut_name) + 1];
struct utmp usr;
output(struct utmp *up)
void output(struct utmp *);
struct utmp usr;
struct utmp u;
struct utmp u;
log_out(struct utmp_list *head, struct utmp *up)
log_in(struct utmp_list *head, struct utmp *up)
memmove((char *)&lp->usr, (char *)up, sizeof (struct utmp));
struct utmp usr;
struct utmp usr;
struct utmp_list *log_in(struct utmp_list *, struct utmp *);
struct utmp_list *log_out(struct utmp_list *, struct utmp *);
struct utmp ut;