Back to index

glibc  2.9
utmpx.h
Go to the documentation of this file.
00001 /* Structures and defenitions for the user accounting database.  AIX.
00002    Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _UTMPX_H
00021 # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
00022 #endif
00023 
00024 #include <bits/types.h>
00025 #include <sys/time.h>
00026 
00027 
00028 #ifdef __USE_GNU
00029 # include <paths.h>
00030 # define _PATH_UTMPX _PATH_UTMP
00031 # define _PATH_WTMPX _PATH_WTMP
00032 #endif
00033 
00034 
00035 #define __UT_LINESIZE       12
00036 #define __UT_NAMESIZE       8
00037 #define __UT_HOSTSIZE       16
00038 
00039 
00040 /* The structure describing an entry in the user accounting database.  */
00041 struct utmpx
00042 {
00043   char ut_user[__UT_NAMESIZE];     /* Username.  */
00044   char ut_id[14];           /* Inittab ID. */
00045   char ut_line[__UT_LINESIZE];     /* Devicename.  */
00046   short int ut_type;        /* Type of login.  */
00047   __pid_t ut_pid;           /* Process ID of login process.  */
00048   struct timeval ut_tv;            /* Time entry was made.  */
00049   char ut_host[__UT_HOSTSIZE];     /* Hostname for remote login.  */
00050 };
00051 
00052 
00053 /* Values for the `ut_type' field of a `struct utmpx'.  */
00054 #define EMPTY        0      /* No valid user accounting information.  */
00055 
00056 #define RUN_LVL             1      /* The system's runlevel.  */
00057 #define BOOT_TIME    2      /* Time of system boot.  */
00058 #define NEW_TIME     3      /* Time after system clock changed.  */
00059 #define OLD_TIME     4      /* Time when system clock changed.  */
00060 
00061 #define INIT_PROCESS 5      /* Process spawned by the init process.  */
00062 #define LOGIN_PROCESS       6      /* Session leader of a logged in user.  */
00063 #define USER_PROCESS 7      /* Normal process.  */
00064 #define DEAD_PROCESS 8      /* Terminated process.  */
00065 
00066 #ifdef __USE_GNU
00067 # define ACCOUNTING  9      /* System accounting.  */
00068 #endif
00069 
00070 #define _HAVE_UT_TYPE   1
00071 #define _HAVE_UT_PID    1
00072 #define _HAVE_UT_ID     1
00073 #define _HAVE_UT_TV     1
00074 #define _HAVE_UT_HOST   1
00075