mirror of https://github.com/mkerrisk/man-pages
Replace defintion of utmp structure by pointer to utmp(5).
This commit is contained in:
parent
31ccb5f8fd
commit
ff6953dcb9
|
@ -71,50 +71,8 @@ code is done accessing the file with the other functions.
|
||||||
reads a line from the current file position in the utmp file.
|
reads a line from the current file position in the utmp file.
|
||||||
It returns a pointer to a structure containing the fields of
|
It returns a pointer to a structure containing the fields of
|
||||||
the line.
|
the line.
|
||||||
This structure has the following form:
|
The defintion of this structure is shown in
|
||||||
.in +4n
|
.BR utmp (5).
|
||||||
.nf
|
|
||||||
|
|
||||||
struct exit_status {
|
|
||||||
short e_termination; /* Process termination status */
|
|
||||||
short e_exit; /* Process exit status */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct utmp {
|
|
||||||
short ut_type; /* Type of record */
|
|
||||||
pid_t ut_pid; /* PID of login process */
|
|
||||||
char ut_line[UT_LINESIZE]; /* Terminal device name */
|
|
||||||
char ut_id[4]; /* Terminal name suffix,
|
|
||||||
or inittab(5) ID */
|
|
||||||
char ut_user[UT_NAMESIZE]; /* Username */
|
|
||||||
char ut_host[UT_HOSTSIZE]; /* Hostname for remote login, or
|
|
||||||
kernel version for run-level
|
|
||||||
messages */
|
|
||||||
struct exit_status ut_exit; /* Exit status of a process
|
|
||||||
marked as DEAD_PROCESS; not
|
|
||||||
used by Linux init(8) */
|
|
||||||
/* The ut_session and ut_tv fields must be the same size when
|
|
||||||
compiled 32- and 64-bit. This allows data files and shared
|
|
||||||
memory to be shared between 32- and 64-bit applications. */
|
|
||||||
#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
|
|
||||||
int32_t ut_session; /* Session ID */
|
|
||||||
struct {
|
|
||||||
int32_t tv_sec; /* Seconds */
|
|
||||||
int32_t tv_usec; /* Microseconds */
|
|
||||||
} ut_tv; /* Time entry was made */
|
|
||||||
#else
|
|
||||||
long ut_session; /* Session ID */
|
|
||||||
struct timeval ut_tv; /* Time entry was made */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int32_t ut_addr_v6[4]; /* Internet address of remote
|
|
||||||
host; IPv4 address uses
|
|
||||||
just ut_addr_v6[0] */
|
|
||||||
char __unused[20]; /* Reserved for future use */
|
|
||||||
};
|
|
||||||
.fi
|
|
||||||
.in
|
|
||||||
|
|
||||||
.PP
|
.PP
|
||||||
.BR getutid ()
|
.BR getutid ()
|
||||||
searches forward from the current file position in the utmp
|
searches forward from the current file position in the utmp
|
||||||
|
|
Loading…
Reference in New Issue