Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


utmpx.h
001: /* Structures and definitions for the user accounting database.  GNU version.
002:    Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
003:    This file is part of the GNU C Library.
004: 
005:    The GNU C Library is free software; you can redistribute it and/or
006:    modify it under the terms of the GNU Lesser General Public
007:    License as published by the Free Software Foundation; either
008:    version 2.1 of the License, or (at your option) any later version.
009: 
010:    The GNU C Library is distributed in the hope that it will be useful,
011:    but WITHOUT ANY WARRANTY; without even the implied warranty of
012:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:    Lesser General Public License for more details.
014: 
015:    You should have received a copy of the GNU Lesser General Public
016:    License along with the GNU C Library; if not, write to the Free
017:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
018:    02111-1307 USA.  */
019: 
020: #ifndef _UTMPX_H
021: # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
022: #endif
023: 
024: #include <bits/types.h>
025: #include <sys/time.h>
026: #include <bits/wordsize.h>
027: 
028: 
029: #ifdef __USE_GNU
030: # include <paths.h>
031: # define _PATH_UTMPX    _PATH_UTMP
032: # define _PATH_WTMPX    _PATH_WTMP
033: #endif
034: 
035: 
036: #define __UT_LINESIZE   32
037: #define __UT_NAMESIZE   32
038: #define __UT_HOSTSIZE   256
039: 
040: 
041: /* The structure describing the status of a terminated process.  This
042:    type is used in `struct utmpx' below.  */
043: struct __exit_status
044:   {
045: #ifdef __USE_GNU
046:     short int e_termination;    /* Process termination status.  */
047:     short int e_exit;           /* Process exit status.  */
048: #else
049:     short int __e_termination;  /* Process termination status.  */
050:     short int __e_exit;         /* Process exit status.  */
051: #endif
052:   };
053: 
054: 
055: /* The structure describing an entry in the user accounting database.  */
056: struct utmpx
057: {
058:   short int ut_type;            /* Type of login.  */
059:   __pid_t ut_pid;               /* Process ID of login process.  */
060:   char ut_line[__UT_LINESIZE];  /* Devicename.  */
061:   char ut_id[4];                /* Inittab ID. */
062:   char ut_user[__UT_NAMESIZE];  /* Username.  */
063:   char ut_host[__UT_HOSTSIZE];  /* Hostname for remote login.  */
064:   struct __exit_status ut_exit; /* Exit status of a process marked
065:                                    as DEAD_PROCESS.  */
066: 
067: /* The fields ut_session and ut_tv must be the same size when compiled
068:    32- and 64-bit.  This allows files and shared memory to be shared
069:    between 32- and 64-bit applications.  */
070: #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
071:   __int32_t ut_session;         /* Session ID, used for windowing.  */
072:   struct
073:   {
074:     __int32_t tv_sec;           /* Seconds.  */
075:     __int32_t tv_usec;          /* Microseconds.  */
076:   } ut_tv;                      /* Time entry was made.  */
077: #else
078:   long int ut_session;          /* Session ID, used for windowing.  */
079:   struct timeval ut_tv;         /* Time entry was made.  */
080: #endif
081:   __int32_t ut_addr_v6[4];      /* Internet address of remote host.  */
082:   char __unused[20];            /* Reserved for future use.  */
083: };
084: 
085: 
086: /* Values for the `ut_type' field of a `struct utmpx'.  */
087: #define EMPTY           0       /* No valid user accounting information.  */
088: 
089: #ifdef __USE_GNU
090: # define RUN_LVL        1       /* The system's runlevel.  */
091: #endif
092: #define BOOT_TIME       2       /* Time of system boot.  */
093: #define NEW_TIME        3       /* Time after system clock changed.  */
094: #define OLD_TIME        4       /* Time when system clock changed.  */
095: 
096: #define INIT_PROCESS    5       /* Process spawned by the init process.  */
097: #define LOGIN_PROCESS   6       /* Session leader of a logged in user.  */
098: #define USER_PROCESS    7       /* Normal process.  */
099: #define DEAD_PROCESS    8       /* Terminated process.  */
100: 
101: #ifdef __USE_GNU
102: # define ACCOUNTING     9       /* System accounting.  */
103: #endif
104: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/