home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / USR_GZ / usr / include / utmp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-14  |  1.4 KB  |  63 lines

  1. /* utmp.h for Linux, by poe@daimi.aau.dk */
  2.  
  3. #ifndef UTMP_H
  4. #define UTMP_H
  5.  
  6. #include <features.h>
  7. #include <sys/types.h>
  8. #include <time.h>
  9. #include <paths.h>
  10.  
  11. #define UTMP_FILE    _PATH_UTMP
  12. #define WTMP_FILE    _PATH_WTMP
  13.  
  14. #define UTMP_FILENAME    UTMP_FILE
  15. #define WTMP_FILENAME    WTMP_FILE
  16.  
  17. /* defines for the ut_type field */
  18. #define UT_UNKNOWN    0
  19.  
  20. /* size of user name */
  21. #define UT_NAMESIZE    8
  22. #define UT_LINESIZE    12
  23. #define UT_HOSTSIZE    16
  24.  
  25. #define RUN_LVL        1
  26. #define BOOT_TIME    2
  27. #define NEW_TIME    3
  28. #define OLD_TIME    4
  29.  
  30. #define INIT_PROCESS    5
  31. #define LOGIN_PROCESS    6
  32. #define USER_PROCESS    7
  33. #define DEAD_PROCESS    8
  34.  
  35.  
  36. struct utmp {
  37.     short    ut_type;    /* type of login */
  38.     pid_t    ut_pid;        /* pid of login-process */
  39.     char    ut_line[UT_LINESIZE];    /* devicename of tty -"/dev/", null-term */
  40.     char    ut_id[2];    /* abbrev. ttyname, as 01, s1 etc. */
  41.     time_t    ut_time;    /* logintime */
  42.     char    ut_user[UT_NAMESIZE];    /* username, not null-term */
  43.     char    ut_host[UT_HOSTSIZE];    /* hostname for remote login... */
  44.     long    ut_addr;    /* IP addr of remote host */
  45. };
  46.  
  47. #define ut_name ut_user
  48.  
  49. __BEGIN_DECLS
  50.  
  51. extern void        setutent __P ((void));
  52. extern void        utmpname __P ((__const char *));
  53. extern struct utmp    *getutent __P ((void));
  54. extern struct utmp    *getutid __P ((struct utmp *));
  55. extern struct utmp     *getutline __P ((struct utmp *));
  56. extern void        pututline __P ((struct utmp *));
  57. extern struct utmp    *_getutline __P ((struct utmp *));
  58. extern void        endutent __P ((void));
  59.  
  60. __END_DECLS
  61.  
  62. #endif    
  63.