1 |
root |
1.1 |
#ifndef PTYTTY_H |
2 |
|
|
#define PTYTTY_H |
3 |
|
|
|
4 |
root |
1.18 |
#include "libptytty.h" |
5 |
|
|
|
6 |
|
|
#include "ptytty_conf.h" |
7 |
root |
1.4 |
|
8 |
ayin |
1.16 |
#if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) || defined(UNIX98_PTY) |
9 |
root |
1.4 |
# define NO_SETOWNER_TTYDEV 1 |
10 |
|
|
#endif |
11 |
root |
1.1 |
|
12 |
root |
1.6 |
#if UTMP_SUPPORT |
13 |
root |
1.18 |
# if !defined(UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) || defined(__GLIBC__) |
14 |
root |
1.6 |
# undef HAVE_UTMPX_H |
15 |
|
|
# undef HAVE_STRUCT_UTMPX |
16 |
|
|
# endif |
17 |
root |
1.18 |
# if !defined(UTMP_FILE) || !defined(HAVE_STRUCT_UTMP) |
18 |
root |
1.6 |
# undef HAVE_UTMP_H |
19 |
|
|
# undef HAVE_STRUCT_UTMP |
20 |
|
|
# endif |
21 |
|
|
|
22 |
|
|
# ifdef HAVE_UTMPX_H |
23 |
|
|
# include <utmpx.h> |
24 |
|
|
# endif |
25 |
|
|
# ifdef HAVE_UTMP_H |
26 |
|
|
# include <utmp.h> |
27 |
|
|
# endif |
28 |
|
|
|
29 |
|
|
# if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP) |
30 |
|
|
# error cannot build with utmp support - no utmp or utmpx struct found |
31 |
|
|
# endif |
32 |
|
|
|
33 |
|
|
# ifdef HAVE_LASTLOG_H |
34 |
|
|
# include <lastlog.h> |
35 |
|
|
# endif |
36 |
|
|
|
37 |
|
|
# include <pwd.h> |
38 |
|
|
|
39 |
root |
1.18 |
# ifdef UTMP_SYSV |
40 |
root |
1.6 |
# ifndef USER_PROCESS |
41 |
|
|
# define USER_PROCESS 7 |
42 |
|
|
# endif |
43 |
|
|
# ifndef DEAD_PROCESS |
44 |
|
|
# define DEAD_PROCESS 8 |
45 |
|
|
# endif |
46 |
|
|
# endif |
47 |
|
|
|
48 |
|
|
#endif |
49 |
|
|
|
50 |
root |
1.18 |
struct ptytty_unix : ptytty |
51 |
root |
1.11 |
{ |
52 |
root |
1.8 |
char *name; |
53 |
|
|
|
54 |
root |
1.1 |
public: |
55 |
|
|
|
56 |
root |
1.18 |
ptytty_unix (); |
57 |
|
|
~ptytty_unix (); |
58 |
root |
1.6 |
|
59 |
root |
1.13 |
bool get (); |
60 |
|
|
void put (); |
61 |
|
|
|
62 |
root |
1.17 |
void login (int cmd_pid, bool login_shell, const char *hostname); |
63 |
|
|
|
64 |
root |
1.6 |
#if UTMP_SUPPORT |
65 |
|
|
int utmp_pos; |
66 |
|
|
int cmd_pid; |
67 |
|
|
bool login_shell; |
68 |
|
|
|
69 |
|
|
#ifdef HAVE_STRUCT_UTMP |
70 |
|
|
struct utmp ut; |
71 |
|
|
#endif |
72 |
|
|
#ifdef HAVE_STRUCT_UTMPX |
73 |
|
|
struct utmpx utx; |
74 |
|
|
#endif |
75 |
|
|
#if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX) |
76 |
|
|
char ut_id[5]; |
77 |
|
|
#endif |
78 |
|
|
|
79 |
|
|
void logout (); |
80 |
|
|
#endif |
81 |
root |
1.1 |
}; |
82 |
|
|
|
83 |
|
|
#endif |
84 |
|
|
|