summaryrefslogtreecommitdiff
path: root/converters/hztty/patches/patch-ab
blob: 0581187b7477d94dd1550840e9a798bbadf3bfda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
$NetBSD: patch-ab,v 1.2 2005/01/19 16:11:41 tv Exp $

--- tty.c.orig	1995-01-29 15:24:55.000000000 -0500
+++ tty.c
@@ -26,7 +26,7 @@ static char *rcs_id="$Id: tty.c,v 2.1 19
 # define	TTYDEV		"/dev/pty/ttyxx"
 #else   /* !hpux */
 # define	PTYCHAR1	"pqrstuvwxyzPQRSTUVWXYZ"
-# define	PTYCHAR2	"0123456789abcdef"
+# define	PTYCHAR2	"0123456789abcdefghijklmnopqrstuv"
 # define	PTYDEV		"/dev/ptyxx"
 # define	TTYDEV		"/dev/ttyxx"
 #endif  /* !hpux */
@@ -39,6 +39,10 @@ extern char *ptsname();
 # include <sys/utsname.h>
 #endif
 
+#ifdef __INTERIX
+# define setpgrp() setpgid(0, 0)
+#endif
+
 static char ptydev[32];
 static char ttydev[32];
 static int pty_search();
@@ -61,7 +65,7 @@ int get_pty (pty)
 	    return 0;
 #endif /* SYSV && SYSV386 */
 
-#if (defined(att) || defined(ATT)) && (!defined(_SEQUENT_))
+#if (defined(att) || defined(ATT) || defined(__INTERIX)) && (!defined(_SEQUENT_))
 	{
 	    if ((*pty = open ("/dev/ptmx", O_RDWR)) < 0)
 		return 1;
@@ -414,7 +418,10 @@ void make_raw(oldtermptr, newtermptr)
 
 /******************************* UTMP stuffs *******************************/
 
+#ifndef __INTERIX
 #include <utmp.h>
+#endif
+
 #ifdef	HAS_UTMPX
 
 # include <utmpx.h>
@@ -428,6 +435,10 @@ void make_raw(oldtermptr, newtermptr)
 # define getutid	getutxid
 # define pututline	pututxline
 
+# ifdef __INTERIX
+#  define ut_xtime	ut_tv.tv_sec
+# endif
+
 #endif
 
 #ifdef USE_SYSV_UTMP
@@ -507,8 +518,10 @@ void addutmp()
 	utmp.ut_pid = getpid();
 
 # ifdef	HAS_UTMPX
+#  ifndef __INTERIX
 	utmpx.ut_syslen = 1;
 	utmpx.ut_session = getsid(0);
+#  endif
 	utmpx.ut_tv.tv_usec = 0;
 # endif