home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 38.ddi / root.3 / usr / include / utmp.h / utmp.h
Encoding:
C/C++ Source or Header  |  1990-10-02  |  2.4 KB  |  83 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1988 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ident    "@(#)/usr/include/utmp.h.sl 1.2 5.0 08/27/90 26661 AT&T-USO 1.3"
  11.  
  12. #ifndef _UTMP_H
  13. #define _UTMP_H
  14.  
  15. #include <sys/types.h>
  16.  
  17. #define    UTMP_FILE    "/var/adm/utmp"
  18. #define    WTMP_FILE    "/var/adm/wtmp"
  19. #define    ut_name    ut_user
  20.  
  21. struct utmp
  22.   {
  23.     char ut_user[8] ;        /* User login name */
  24.     char ut_id[4] ;         /* /etc/inittab id(usually line #) */
  25.     char ut_line[12] ;        /* device name (console, lnxx) */
  26.     short ut_pid ;            /* leave short for compatiblity - process id */
  27.     short ut_type ;         /* type of entry */
  28.     struct exit_status
  29.       {
  30.         short e_termination ;    /* Process termination status */
  31.         short e_exit ;        /* Process exit status */
  32.       }
  33.     ut_exit ;            /* The exit status of a process
  34.                      * marked as DEAD_PROCESS.
  35.                      */
  36.     time_t ut_time ;        /* time entry was made */
  37.   } ;
  38.  
  39. /*    Definitions for ut_type                        */
  40.  
  41. #define    EMPTY        0
  42. #define    RUN_LVL        1
  43. #define    BOOT_TIME    2
  44. #define    OLD_TIME    3
  45. #define    NEW_TIME    4
  46. #define    INIT_PROCESS    5    /* Process spawned by "init" */
  47. #define    LOGIN_PROCESS    6    /* A "getty" process waiting for login */
  48. #define    USER_PROCESS    7    /* A user process */
  49. #define    DEAD_PROCESS    8
  50. #define    ACCOUNTING    9
  51.  
  52. #define    UTMAXTYPE    ACCOUNTING    /* Largest legal value of ut_type */
  53.  
  54. /*    Special strings or formats used in the "ut_line" field when    */
  55. /*    accounting for something other than a process.            */
  56. /*    No string for the ut_line field can be more than 11 chars +    */
  57. /*    a NULL in length.                        */
  58.  
  59. #define    RUNLVL_MSG    "run-level %c"
  60. #define    BOOT_MSG    "system boot"
  61. #define    OTIME_MSG    "old time"
  62. #define    NTIME_MSG    "new time"
  63.  
  64. #if defined(__STDC__)
  65. extern void endutent(void);
  66. extern struct utmp *getutent(void);
  67. extern struct utmp *getutid(const struct utmp *);
  68. extern struct utmp *getutline(const struct utmp *);
  69. extern struct utmp *pututline(const struct utmp *); 
  70. extern void setutent(void);
  71. extern int utmpname(const char *);
  72. #else
  73. extern void endutent();
  74. extern struct utmp *getutent();
  75. extern struct utmp *getutid();
  76. extern struct utmp *getutline();
  77. extern struct utmp *pututline(); 
  78. extern void setutent();
  79. extern int utmpname();
  80. #endif
  81.  
  82. #endif /* _UTMP_H */
  83.