source: svn/trunk/newcon3bcm2_21bu/toolchain/mipsel-linux-uclibc/include/bits/utmp.h @ 2

Last change on this file since 2 was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 3.4 KB
Line 
1/* The `struct utmp' type, describing entries in the utmp file.  GNU version.
2   Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
3   This file is part of the GNU C Library.
4
5   The GNU C Library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9
10   The GNU C Library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Lesser General Public License for more details.
14
15   You should have received a copy of the GNU Lesser General Public
16   License along with the GNU C Library; if not, write to the Free
17   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18   02111-1307 USA.  */
19
20#ifndef _UTMP_H
21# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
22#endif
23
24#include <paths.h>
25#include <sys/time.h>
26#include <sys/types.h>
27
28
29#define UT_LINESIZE     32
30#define UT_NAMESIZE     32
31#define UT_HOSTSIZE     256
32
33
34/* The structure describing an entry in the database of
35   previous logins.  */
36struct lastlog
37  {
38    __time_t ll_time;
39    char ll_line[UT_LINESIZE];
40    char ll_host[UT_HOSTSIZE];
41  };
42
43
44/* The structure describing the status of a terminated process.  This
45   type is used in `struct utmp' below.  */
46struct exit_status
47  {
48    short int e_termination;    /* Process termination status.  */
49    short int e_exit;           /* Process exit status.  */
50  };
51
52
53/* The structure describing an entry in the user accounting database.  */
54struct utmp
55{
56  short int ut_type;            /* Type of login.  */
57  pid_t ut_pid;                 /* Process ID of login process.  */
58  char ut_line[UT_LINESIZE];    /* Devicename.  */
59  char ut_id[4];                /* Inittab ID.  */
60  char ut_user[UT_NAMESIZE];    /* Username.  */
61  char ut_host[UT_HOSTSIZE];    /* Hostname for remote login.  */
62  struct exit_status ut_exit;   /* Exit status of a process marked
63                                   as DEAD_PROCESS.  */
64  long int ut_session;          /* Session ID, used for windowing.  */
65  struct timeval ut_tv;         /* Time entry was made.  */
66  int32_t ut_addr_v6[4];        /* Internet address of remote host.  */
67  char __unused[20];            /* Reserved for future use.  */
68};
69
70/* Backwards compatibility hacks.  */
71#define ut_name         ut_user
72#ifndef _NO_UT_TIME
73/* We have a problem here: `ut_time' is also used otherwise.  Define
74   _NO_UT_TIME if the compiler complains.  */
75# define ut_time        ut_tv.tv_sec
76#endif
77#define ut_xtime        ut_tv.tv_sec
78#define ut_addr         ut_addr_v6[0]
79
80
81/* Values for the `ut_type' field of a `struct utmp'.  */
82#define EMPTY           0       /* No valid user accounting information.  */
83
84#define RUN_LVL         1       /* The system's runlevel.  */
85#define BOOT_TIME       2       /* Time of system boot.  */
86#define NEW_TIME        3       /* Time after system clock changed.  */
87#define OLD_TIME        4       /* Time when system clock changed.  */
88
89#define INIT_PROCESS    5       /* Process spawned by the init process.  */
90#define LOGIN_PROCESS   6       /* Session leader of a logged in user.  */
91#define USER_PROCESS    7       /* Normal process.  */
92#define DEAD_PROCESS    8       /* Terminated process.  */
93
94#define ACCOUNTING      9
95
96/* Old Linux name for the EMPTY type.  */
97#define UT_UNKNOWN      EMPTY
98
99
100/* Tell the user that we have a modern system with UT_HOST, UT_PID,
101   UT_TYPE, UT_ID and UT_TV fields.  */
102#define _HAVE_UT_TYPE   1
103#define _HAVE_UT_PID    1
104#define _HAVE_UT_ID     1
105#define _HAVE_UT_TV     1
106#define _HAVE_UT_HOST   1
Note: See TracBrowser for help on using the repository browser.