Cleaned up the struct sgtty workaround and made it more generic.
This commit is contained in:
parent
779fe568fc
commit
f2046954e6
|
@ -10,7 +10,9 @@
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "warn.h"
|
#include "warn.h"
|
||||||
|
|
||||||
|
#ifdef WANT_SGTTY
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef V7IOCTL /* define the proper V7 requests */
|
#ifdef V7IOCTL /* define the proper V7 requests */
|
||||||
|
|
||||||
|
@ -45,7 +47,9 @@ int do_ioctl(fd, req, addr)
|
||||||
ptr addr;
|
ptr addr;
|
||||||
{
|
{
|
||||||
register long e;
|
register long e;
|
||||||
|
#ifdef WANT_SGTTY
|
||||||
struct sgttyb sg_buf;
|
struct sgttyb sg_buf;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BSD_X /* from system.h */
|
#ifdef BSD_X /* from system.h */
|
||||||
#ifndef V7IOCTL
|
#ifndef V7IOCTL
|
||||||
|
@ -66,6 +70,8 @@ int do_ioctl(fd, req, addr)
|
||||||
#ifdef V7IOCTL
|
#ifdef V7IOCTL
|
||||||
switch (req) { /* translate the V7 requests */
|
switch (req) { /* translate the V7 requests */
|
||||||
/* and reject the non-V7 ones */
|
/* and reject the non-V7 ones */
|
||||||
|
|
||||||
|
#ifdef WANT_SGTTY
|
||||||
case V7IOGETP:
|
case V7IOGETP:
|
||||||
req = TIOCGETP;
|
req = TIOCGETP;
|
||||||
break;
|
break;
|
||||||
|
@ -81,6 +87,8 @@ int do_ioctl(fd, req, addr)
|
||||||
case V7IOHPCL:
|
case V7IOHPCL:
|
||||||
req = TIOCHPCL;
|
req = TIOCHPCL;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BSD_X /* from system.h */
|
#ifdef BSD_X /* from system.h */
|
||||||
case V7IOSETN:
|
case V7IOSETN:
|
||||||
req = TIOCSETN;
|
req = TIOCSETN;
|
||||||
|
@ -108,11 +116,7 @@ int do_ioctl(fd, req, addr)
|
||||||
/****** Struct sgttyb ioctl's ********/
|
/****** Struct sgttyb ioctl's ********/
|
||||||
/*************************************/
|
/*************************************/
|
||||||
|
|
||||||
#if 0
|
#ifdef WANT_SGTTY
|
||||||
/* FIXME: I'm not entirely certain what these do; I think they have
|
|
||||||
* to do with serial port manipulation. If so, they need to be rewritten
|
|
||||||
* to use the Posix standards. ---dtrg */
|
|
||||||
|
|
||||||
case TIOCGETP:
|
case TIOCGETP:
|
||||||
/* Get fd's current param's and store at dsp2 */
|
/* Get fd's current param's and store at dsp2 */
|
||||||
if ( (e = ioctl(fd, req, (char *) &sg_buf)) == -1
|
if ( (e = ioctl(fd, req, (char *) &sg_buf)) == -1
|
||||||
|
|
|
@ -16,7 +16,10 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
|
|
||||||
|
#ifdef WANT_SGTTY
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BSD_X /* from system.h */
|
#ifdef BSD_X /* from system.h */
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
|
@ -85,8 +88,9 @@ int tms2mem(addr, tmsb)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#ifdef WANT_SGTTY
|
||||||
/* FIXME: see the related fixme in m_ioctlc. ---dtrg */
|
/* FIXME: see the related fixme in sysidf.h. --- dtrg */
|
||||||
|
|
||||||
int sgttyb2mem(addr, sgttybb)
|
int sgttyb2mem(addr, sgttybb)
|
||||||
ptr addr;
|
ptr addr;
|
||||||
struct sgttyb *sgttybb;
|
struct sgttyb *sgttybb;
|
||||||
|
@ -146,8 +150,9 @@ PRIVATE unsigned long mem_ldfld(addr, offset, length)
|
||||||
return mem_ldu(addr + offset, length);
|
return mem_ldu(addr + offset, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#ifdef WANT_SGTTY
|
||||||
/* FIXME: see the related fixme in m_ioctlc. ---dtrg */
|
/* FIXME: see the related fixme in sysidf.h. --- dtrg */
|
||||||
|
|
||||||
int mem2sgtty(addr, sgttybb)
|
int mem2sgtty(addr, sgttybb)
|
||||||
ptr addr;
|
ptr addr;
|
||||||
struct sgttyb *sgttybb;
|
struct sgttyb *sgttybb;
|
||||||
|
|
|
@ -19,3 +19,9 @@
|
||||||
#define SYS_V
|
#define SYS_V
|
||||||
#endif /* SYS_5 */
|
#endif /* SYS_5 */
|
||||||
|
|
||||||
|
/* FIXME: A lot of modern systems, including Linux, don't have struct sgtty
|
||||||
|
* and associated ioctls. If you *do* have it, uncomment this. All this
|
||||||
|
* code should probably be rewritten one day to use termios instead, which
|
||||||
|
* seems to be the standard that won. --- dtrg */
|
||||||
|
|
||||||
|
//#define WANT_SGTTY
|
||||||
|
|
Loading…
Reference in a new issue