ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/libptytty/src/ptytty.h
Revision: 1.20
Committed: Fri Dec 2 08:45:46 2011 UTC (14 years, 10 months ago) by sf-exg
Content type: text/plain
Branch: MAIN
CVS Tags: rel-9_14, rel-1_5
Changes since 1.19: +1 -0 lines
Log Message:
Fix writing of bsd login and logout utmp entry when close_tty is called
before login and delete respectively.

File Contents

# User Rev Content
1 root 1.7 // This file is part of libptytty. Do not make local modifications.
2     // http://software.schmorp.de/pkg/libptytty
3    
4 root 1.1 #ifndef PTYTTY_H
5     #define PTYTTY_H
6    
7 root 1.5 #include "libptytty.h"
8 root 1.3 #include "ptytty_conf.h"
9 root 1.1
10 root 1.9 #if PTYTTY_REENTRANT
11     # define PTYTTY_NO_PID_CHECK 1
12     #endif
13    
14 root 1.2 #if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) || defined(UNIX98_PTY)
15 root 1.1 # define NO_SETOWNER_TTYDEV 1
16     #endif
17    
18 root 1.2 #if UTMP_SUPPORT
19 sf-exg 1.19 # if defined(__GLIBC__)
20 root 1.2 # undef HAVE_STRUCT_UTMPX
21     # endif
22    
23     # if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP)
24     # error cannot build with utmp support - no utmp or utmpx struct found
25     # endif
26    
27 root 1.1 #endif
28 root 1.2
29 root 1.4 struct ptytty_unix : ptytty
30 root 1.2 {
31     char *name;
32    
33 sf-exg 1.15 void log_session (bool login, const char *hostname);
34    
35 root 1.1 public:
36    
37 root 1.4 ptytty_unix ();
38     ~ptytty_unix ();
39 root 1.1
40     bool get ();
41     void put ();
42    
43 root 1.6 void login (int cmd_pid, bool login_shell, const char *hostname);
44    
45 root 1.2 #if UTMP_SUPPORT
46 sf-exg 1.20 int utmp_pos;
47 root 1.2 int cmd_pid;
48     bool login_shell;
49 root 1.1
50 root 1.2 void logout ();
51     #endif
52 root 1.1 };
53    
54     #endif
55