home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / uccs / root.14 / udk / usr / include / utmp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-19  |  3.1 KB  |  113 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. #ifndef _UTMP_H
  12. #define _UTMP_H
  13. #ident    "@(#)sgs-head:common/head/utmp.h    1.5.2.6"
  14.  
  15. /* This header is included by <utmpx.h> for XPG4 V2 */
  16.  
  17. #include <sys/types.h>
  18.  
  19. struct ut_exit_status {
  20.     short ut_e_termination;    /* Process termination status */
  21.     short ut_e_exit;    /* Process exit status */
  22. };
  23.  
  24. #if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE_EXTENDED - 0 < 1
  25.  
  26. #define    UTMP_FILE    "/var/adm/utmp"
  27. #define    WTMP_FILE    "/var/adm/wtmp"
  28.  
  29. struct utmp {
  30.     char    ut_user[8];        /* User login name */
  31.     char    ut_id[4];         /* /etc/inittab id(usually line #) */
  32.     char    ut_line[12];        /* device name (console, lnxx) */
  33. #if #machine(m88k)
  34.     pid_t    ut_pid;            /* OCS 1.0 - process id */
  35. #else
  36.     short    ut_pid;            /* for compatiblity - process id */
  37. #endif
  38.     short    ut_type;         /* type of entry */
  39. #if #machine(m88k)
  40.     short    ut_pad;            /* OCS 1.0 */
  41. #endif
  42.     struct ut_exit_status ut_exit;    /* The exit status of a process
  43.                      * marked as DEAD_PROCESS.
  44.                      */
  45.     time_t    ut_time;        /* time entry was made */
  46. #if #machine(m88k)
  47.     char    ut_host[24];        /* host name, if remote OCS 1.0 */
  48. #endif
  49. };
  50.  
  51. #define    exit_status    ut_exit_status
  52. #define e_exit        ut_e_exit
  53. #define e_termination    ut_e_termination
  54.  
  55. #endif /* !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE_EXTENDED - 0 < 1*/
  56.  
  57. #define    ut_name        ut_user
  58.  
  59. /* Definitions for ut_type */
  60.  
  61. #define    EMPTY        0
  62. #define    BOOT_TIME    2
  63. #define    OLD_TIME    3
  64. #define    NEW_TIME    4
  65. #define    INIT_PROCESS    5    /* Process spawned by "init" */
  66. #define    LOGIN_PROCESS    6    /* A "getty" process waiting for login */
  67. #define    USER_PROCESS    7    /* A user process */
  68. #define    DEAD_PROCESS    8
  69.  
  70. #if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE_EXTENDED - 0 < 1
  71.  
  72. #define    RUN_LVL        1
  73. #define    ACCOUNTING    9
  74.  
  75. #if #machine(m88k)
  76. #define FTP        128
  77. #define REMOTE_LOGIN    129
  78. #define REMOTE_PROCESS    130
  79. #define    UTMAXTYPE    REMOTE_PROCESS    /* Largest legal value of ut_type */
  80. #else
  81. #define    UTMAXTYPE    ACCOUNTING    /* Largest legal value of ut_type */
  82. #endif
  83.  
  84. /*    Special strings or formats used in the "ut_line" field when    */
  85. /*    accounting for something other than a process.            */
  86. /*    No string for the ut_line field can be more than 11 chars +    */
  87. /*    a NULL in length.                        */
  88.  
  89. #define    RUNLVL_MSG    "run-level %c"
  90. #define    BOOT_MSG    "system boot"
  91. #define    OTIME_MSG    "old time"
  92. #define    NTIME_MSG    "new time"
  93.  
  94. #ifdef __cplusplus
  95. extern "C" {
  96. #endif
  97.  
  98. extern void    endutent(void);
  99. struct utmp    *getutent(void);
  100. struct utmp    *getutid(const struct utmp *);
  101. struct utmp    *getutline(const struct utmp *);
  102. struct utmp    *pututline(const struct utmp *); 
  103. extern void    setutent(void);
  104. extern int    utmpname(const char *);
  105.  
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109.  
  110. #endif /* !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE_EXTENDED - 0 < 1*/
  111.  
  112. #endif /*_UTMP_H*/
  113.