/*	@(#)utmp.h	13.2 (RC International) 91/07/24 	*/

#ifndef _UTMP_H
#define _UTMP_H

#define UTMP_FILE	"/etc/utmp"
#define WTMP_FILE	"/usr/adm/wtmp"

/*
 * Structure of utmp and wtmp files.
 */

#include <sys/types.h>

struct	utmp
{
	char	ut_user[9];		/* user login name */
#define ut_name	ut_user
	char	ut_id[4];		/* /etc/inittab id; usually line no */
	char	ut_line[14];		/* tty or device name */
	char	ut_termname[11];	/* physical terminal name (from lan) */
	long	ut_pid;			/* process id */
	short	ut_type;		/* type of entry */
	char	ut_host[32];		/* host name, if remote */
	short	ut_pu;			/* pu number of login */
	struct	exit_status
	   {
		short	e_termination;
		short	e_exit;
	   }
	ut_exit;			/* exit status of a dead process */
	time_t	ut_time;		/* time on */
};


/* 	Definitions for ut_type	*/

#define EMPTY		0
#define RUN_LVL		1
#define BOOT_TIME	2
#define OLD_TIME	3
#define NEW_TIME	4
#define INIT_PROCESS	5		/* Process spawned by init */
#define LOGIN_PROCESS	6		/* Getty process waiting for login */
#define USER_PROCESS	7		/* User process */
#define DEAD_PROCESS	8
#define ACCOUNTING	9

#define UTMAXTYPE	ACCOUNTING	/* Largest legal value of ut_type */

/* Special strings or formats used in the ut_line field when indicating   */
/* something other than a process.  No string in the ut_line field can be */
/* more than 11 chars plus terminator.					  */

#define	RUNLVL_MSG	"run-level %c"
#define BOOT_MSG	"system boot"
#define OTIME_MSG	"old time"
#define NTIME_MSG	"new time"


#endif /* _UTMP_H */
