2014-08-11 13:27:10 +02:00

75 lines
1.8 KiB
Plaintext

$NetBSD: patch-ab,v 1.4 2013/07/18 12:07:24 joerg Exp $
--- tty.c.orig 1995-01-29 20:24:55.000000000 +0000
+++ tty.c
@@ -13,6 +13,7 @@ static char *rcs_id="$Id: tty.c,v 2.1 19
#endif /* lint */
#include "config.h"
+#include <termios.h>
/*
* Functions get_pty() and pty_search() in this file are adopted from
@@ -26,7 +27,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 +40,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 +66,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 +419,10 @@ void make_raw(oldtermptr, newtermptr)
/******************************* UTMP stuffs *******************************/
+#ifndef __INTERIX
#include <utmp.h>
+#endif
+
#ifdef HAS_UTMPX
# include <utmpx.h>
@@ -428,6 +436,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 +519,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