From 9c250bc275dfc72fa5d738fa4b0b6c96f2fdbf34 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Mon, 16 Apr 2018 08:30:45 +0200
Subject: [PATCH] WIP Remove old tty code.

---
 Makefile_upgrade.inc     |   5 ++
 include/Makefile         |   5 +-
 include/sgtty.h          |  35 -------------
 lib/libcompat/4.1/gtty.c |  49 -------------------
 lib/libcompat/4.1/stty.3 |  95 ------------------------------------
 lib/libcompat/4.1/stty.c |  49 -------------------
 lib/libcompat/Makefile   |   9 +---
 sys/sys/ioctl.h          |  11 -----
 sys/sys/ioctl_compat.h   | 124 +----------------------------------------------
 sys/sys/param.h          |   3 +-
 sys/sys/ttychars.h       |  62 ------------------------
 sys/sys/ttydev.h         |  60 -----------------------
 12 files changed, 13 insertions(+), 494 deletions(-)
 delete mode 100644 include/sgtty.h
 delete mode 100644 lib/libcompat/4.1/gtty.c
 delete mode 100644 lib/libcompat/4.1/stty.3
 delete mode 100644 lib/libcompat/4.1/stty.c
 delete mode 100644 sys/sys/ttychars.h
 delete mode 100644 sys/sys/ttydev.h

diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc
index c9ed29c114..96314346da 100644
--- a/Makefile_upgrade.inc
+++ b/Makefile_upgrade.inc
@@ -3382,6 +3382,11 @@ TO_REMOVE+=/usr/share/man/man9/devfs_clone_bitmap_fff.9.gz
 TO_REMOVE+=/usr/share/man/man7/stabs.7.gz
 TO_REMOVE+=/boot/kernel/libalias.ko
 TO_REMOVE+=/usr/include/net/libalias
+TO_REMOVE+=/usr/include/sgtty.h
+TO_REMOVE+=/usr/include/sys/ttychars.h
+TO_REMOVE+=/usr/include/sys/ttydev.h
+TO_REMOVE+=/usr/share/man/man3/gtty.3.gz
+TO_REMOVE+=/usr/share/man/man3/stty.3.gz
 
 .if !defined(WANT_INSTALLER)
 TO_REMOVE+=/usr/sbin/dfuibe_installer
diff --git a/include/Makefile b/include/Makefile
index c07af86484..a6aa4649b6 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -18,9 +18,8 @@ INCS=	a.out.h ar.h assert.h bitstring.h cpio.h ctype.h db.h \
 	netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h \
 	paths.h printf.h pthread.h pthread_np.h pwd.h \
 	ranlib.h readpassphrase.h \
-	res_update.h resolv.h re_comp.h rmd160.h \
-	runetype.h search.h setjmp.h sgtty.h \
-	signal.h spawn.h stdalign.h stdarg.h stdbool.h \
+	re_comp.h resolv.h res_update.h rmd160.h runetype.h \
+	search.h setjmp.h signal.h spawn.h stdalign.h stdarg.h stdbool.h \
 	stddef.h stdint.h stdio.h stdlib.h stdnoreturn.h \
 	string.h stringlist.h strings.h sysexits.h \
 	tar.h time.h \
diff --git a/include/sgtty.h b/include/sgtty.h
deleted file mode 100644
index e050830cea..0000000000
--- a/include/sgtty.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 1985, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)sgtty.h	8.1 (Berkeley) 6/2/93
- */
-
-#ifndef USE_OLD_TTY
-#define	USE_OLD_TTY
-#endif
-#include <sys/ioctl.h>
diff --git a/lib/libcompat/4.1/gtty.c b/lib/libcompat/4.1/gtty.c
deleted file mode 100644
index c146c0aef4..0000000000
--- a/lib/libcompat/4.1/gtty.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1994 Christopher G. Demetriou
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by Christopher G. Demetriou.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libcompat/4.1/gtty.c,v 1.5 1999/08/28 00:04:13 peter Exp $
- * $DragonFly: src/lib/libcompat/4.1/gtty.c,v 1.3 2008/09/30 16:57:04 swildner Exp $
- */
-
-#include <sgtty.h>
-
-/*
- * Get tty modes.
- * This was defined in ioctl_compat.h as:
- *	#define	gtty(fd, tty)	ioctl(fd, TIOCGETP, tty)
- */
-
-#undef gtty
-
-int
-gtty(int fd, struct sgttyb *tty)
-{
-
-	return (ioctl(fd, TIOCGETP, tty));
-}
diff --git a/lib/libcompat/4.1/stty.3 b/lib/libcompat/4.1/stty.3
deleted file mode 100644
index d431417639..0000000000
--- a/lib/libcompat/4.1/stty.3
+++ /dev/null
@@ -1,95 +0,0 @@
-.\" Copyright (c) 1983, 1991, 1993
-.\"	The Regents of the University of California.  All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\"     @(#)stty.3	8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libcompat/4.1/stty.3,v 1.4.2.4 2001/12/17 10:08:28 ru Exp $
-.\" $DragonFly: src/lib/libcompat/4.1/stty.3,v 1.2 2003/06/17 04:26:48 dillon Exp $
-.\"
-.Dd June 4, 1993
-.Dt STTY 3
-.Os
-.Sh NAME
-.Nm stty ,
-.Nm gtty
-.Nd set and get terminal state (defunct)
-.Sh LIBRARY
-.Lb libcompat
-.Sh SYNOPSIS
-.In sgtty.h
-.Ft int
-.Fn stty "int fd" "struct sgttyb *buf"
-.Ft int
-.Fn gtty "int fd" "struct sgttyb *buf"
-.Sh DESCRIPTION
-.Bf -symbolic
-These interfaces are obsoleted by
-.Xr ioctl 2 .
-.Ef
-.Pp
-The
-.Fn stty
-function
-sets the state of the terminal associated with
-.Fa fd .
-The
-.Fn gtty
-function
-retrieves the state of the terminal associated
-with
-.Fa fd .
-To set the state of a terminal the call must have
-write permission.
-.Pp
-The
-.Fn stty
-call is actually
-.Ql ioctl(fd, TIOCSETP, buf) ,
-while
-the
-.Fn gtty
-call is
-.Ql ioctl(fd, TIOCGETP, buf) .
-See
-.Xr ioctl 2
-and
-.Xr tty 4
-for an explanation.
-.Sh DIAGNOSTICS
-If the call is successful 0 is returned, otherwise \-1 is
-returned and the global variable
-.Va errno
-contains the reason for the failure.
-.Sh SEE ALSO
-.Xr ioctl 2 ,
-.Xr tty 4
-.Sh HISTORY
-The
-.Fn stty
-and
-.Fn gtty
-functions appeared in
-.Bx 4.2 .
diff --git a/lib/libcompat/4.1/stty.c b/lib/libcompat/4.1/stty.c
deleted file mode 100644
index 5f93cd234f..0000000000
--- a/lib/libcompat/4.1/stty.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1994 Christopher G. Demetriou
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by Christopher G. Demetriou.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libcompat/4.1/stty.c,v 1.5 1999/08/28 00:04:13 peter Exp $
- * $DragonFly: src/lib/libcompat/4.1/stty.c,v 1.3 2008/09/30 16:57:04 swildner Exp $
- */
-
-#include <sgtty.h>
-
-/*
- * Set tty modes.
- * This was defined in ioctl_compat.h as:
- *	#define	stty(fd, tty)	ioctl(fd, TIOCSETP, tty)
- */
-
-#undef stty
-
-int
-stty(int fd, struct sgttyb *tty)
-{
-
-	return (ioctl(fd, TIOCSETP, tty));
-}
diff --git a/lib/libcompat/Makefile b/lib/libcompat/Makefile
index 669bdf96af..887e675526 100644
--- a/lib/libcompat/Makefile
+++ b/lib/libcompat/Makefile
@@ -8,17 +8,12 @@ WARNS?=	2
 .PATH:	${.CURDIR}/4.1 ${.CURDIR}/4.3 ${.CURDIR}/4.4
 
 # compat 4.1 sources
-SRCS+=	ftime.c gtty.c stty.c
-
-MAN+=	4.1/ftime.3 4.1/stty.3
-
-MLINKS+=stty.3 gtty.3
+SRCS+=	ftime.c
+MAN+=	4.1/ftime.3
 
 # compat 4.3 sources
 SRCS+=	re_comp.c rexec.c
-
 MAN+=	4.3/re_comp.3 4.3/rexec.3
-
 MLINKS+=re_comp.3 re_exec.3
 
 # compat 4.4 sources
diff --git a/sys/sys/ioctl.h b/sys/sys/ioctl.h
index 08191ad4dc..4be0eb5d4e 100644
--- a/sys/sys/ioctl.h
+++ b/sys/sys/ioctl.h
@@ -62,14 +62,3 @@ struct ttysize {
 #include <sys/sockio.h>
 
 #endif /* !_SYS_IOCTL_H_ */
-
-/*
- * Keep outside _SYS_IOCTL_H_
- * Compatibility with old terminal driver
- *
- * Source level -> #define USE_OLD_TTY
- * Kernel level -> options COMPAT_43
- */
-#if defined(USE_OLD_TTY) || defined(COMPAT_43)
-#include <sys/ioctl_compat.h>
-#endif
diff --git a/sys/sys/ioctl_compat.h b/sys/sys/ioctl_compat.h
index e175e31b86..01db1904ce 100644
--- a/sys/sys/ioctl_compat.h
+++ b/sys/sys/ioctl_compat.h
@@ -39,133 +39,13 @@
 #define	_SYS_IOCTL_COMPAT_H_
 
 #include <sys/ioccom.h>
-#include <sys/ttychars.h>
-#include <sys/ttydev.h>
 
-struct tchars {
-	char	t_intrc;	/* interrupt */
-	char	t_quitc;	/* quit */
-	char	t_startc;	/* start output */
-	char	t_stopc;	/* stop output */
-	char	t_eofc;		/* end-of-file */
-	char	t_brkc;		/* input delimiter (like nl) */
-};
-
-struct ltchars {
-	char	t_suspc;	/* stop process signal */
-	char	t_dsuspc;	/* delayed stop process signal */
-	char	t_rprntc;	/* reprint line */
-	char	t_flushc;	/* flush output (toggles) */
-	char	t_werasc;	/* word erase */
-	char	t_lnextc;	/* literal next character */
-};
-
-/*
- * Structure for TIOCGETP and TIOCSETP ioctls.
- */
-#ifndef _SGTTYB_
-#define	_SGTTYB_
-struct sgttyb {
-	char	sg_ispeed;		/* input speed */
-	char	sg_ospeed;		/* output speed */
-	char	sg_erase;		/* erase character */
-	char	sg_kill;		/* kill character */
-	short	sg_flags;		/* mode flags */
-};
-#endif
-
-#ifdef USE_OLD_TTY
-# undef  TIOCGETD
-# define TIOCGETD	_IOR('t', 0, int)	/* get line discipline */
-# undef  TIOCSETD
-# define TIOCSETD	_IOW('t', 1, int)	/* set line discipline */
-#else
-# define OTIOCGETD	_IOR('t', 0, int)	/* get line discipline */
-# define OTIOCSETD	_IOW('t', 1, int)	/* set line discipline */
-#endif
-#define	TIOCHPCL	_IO('t', 2)		/* hang up on last close */
-#define	TIOCGETP	_IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
-#define	TIOCSETP	_IOW('t', 9,struct sgttyb)/* set parameters -- stty */
-#define	TIOCSETN	_IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
-#define	TIOCSETC	_IOW('t',17,struct tchars)/* set special characters */
-#define	TIOCGETC	_IOR('t',18,struct tchars)/* get special characters */
-#define		TANDEM		0x00000001	/* send stopc on out q full */
-#define		CBREAK		0x00000002	/* half-cooked mode */
-#define		LCASE		0x00000004	/* simulate lower case */
-#define		ECHO		0x00000008	/* echo input */
-#define		CRMOD		0x00000010	/* map \r to \r\n on output */
-#define		RAW		0x00000020	/* no i/o processing */
-#define		ODDP		0x00000040	/* get/send odd parity */
-#define		EVENP		0x00000080	/* get/send even parity */
-#define		ANYP		0x000000c0	/* get any parity/send none */
-#define		NLDELAY		0x00000300	/* \n delay */
-#define			NL0	0x00000000
-#define			NL1	0x00000100	/* tty 37 */
-#define			NL2	0x00000200	/* vt05 */
-#define			NL3	0x00000300
-#define		TBDELAY		0x00000c00	/* horizontal tab delay */
-#define			TAB0	0x00000000
-#define			TAB1	0x00000400	/* tty 37 */
-#define			TAB2	0x00000800
-#define		XTABS		0x00000c00	/* expand tabs on output */
-#define		CRDELAY		0x00003000	/* \r delay */
-#define			CR0	0x00000000
-#define			CR1	0x00001000	/* tn 300 */
-#define			CR2	0x00002000	/* tty 37 */
-#define			CR3	0x00003000	/* concept 100 */
-#define		VTDELAY		0x00004000	/* vertical tab delay */
-#define			FF0	0x00000000
-#define			FF1	0x00004000	/* tty 37 */
-#define		BSDELAY		0x00008000	/* \b delay */
-#define			BS0	0x00000000
-#define			BS1	0x00008000
-#define		ALLDELAY	(NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
-#define		CRTBS		0x00010000	/* do backspacing for crt */
-#define		PRTERA		0x00020000	/* \ ... / erase */
-#define		CRTERA		0x00040000	/* " \b " to wipe out char */
-#define		TILDE		0x00080000	/* hazeltine tilde kludge */
-#define		MDMBUF		0x00100000	/*start/stop output on carrier*/
-#define		LITOUT		0x00200000	/* literal output */
-#define		TOSTOP		0x00400000	/*SIGSTOP on background output*/
-#define		FLUSHO		0x00800000	/* flush output to terminal */
-#define		NOHANG		0x01000000	/* (no-op) was no SIGHUP on carrier drop */
-#define		L001000		0x02000000
-#define		CRTKIL		0x04000000	/* kill line with " \b " */
-#define		PASS8		0x08000000
-#define		CTLECH		0x10000000	/* echo control chars as ^X */
-#define		PENDIN		0x20000000	/* tp->t_rawq needs reread */
-#define		DECCTQ		0x40000000	/* only ^Q starts after ^S */
-#define		NOFLSH		0x80000000	/* no output flush on signal */
-#define	TIOCLBIS	_IOW('t', 127, int)	/* bis local mode bits */
-#define	TIOCLBIC	_IOW('t', 126, int)	/* bic local mode bits */
-#define	TIOCLSET	_IOW('t', 125, int)	/* set entire local mode word */
-#define	TIOCLGET	_IOR('t', 124, int)	/* get local modes */
-#define		LCRTBS		(CRTBS>>16)
-#define		LPRTERA		(PRTERA>>16)
-#define		LCRTERA		(CRTERA>>16)
-#define		LTILDE		(TILDE>>16)
-#define		LMDMBUF		(MDMBUF>>16)
-#define		LLITOUT		(LITOUT>>16)
-#define		LTOSTOP		(TOSTOP>>16)
-#define		LFLUSHO		(FLUSHO>>16)
-#define		LNOHANG		(NOHANG>>16)
-#define		LCRTKIL		(CRTKIL>>16)
-#define		LPASS8		(PASS8>>16)
-#define		LCTLECH		(CTLECH>>16)
-#define		LPENDIN		(PENDIN>>16)
-#define		LDECCTQ		(DECCTQ>>16)
-#define		LNOFLSH		(NOFLSH>>16)
-#define	TIOCSLTC	_IOW('t',117,struct ltchars)/* set local special chars*/
-#define	TIOCGLTC	_IOR('t',116,struct ltchars)/* get local special chars*/
-#define OTIOCCONS	_IO('t', 98)	/* for hp300 -- sans int arg */
+/* XXX publish these so stty(1) can still report them */
 #define	OTTYDISC	0
 #define	NETLDISC	1
 #define	NTTYDISC	2
 
-/*
- * XXX This should really be DAIOCTRIM and be defined in
- *     <bus/cam/scsi/scsi_daio.h>. 't' is wrong, too.
- */
+/* XXX this will eventually go away */
 #define IOCTLTRIM	_IOW('t', 128, off_t[2])
 
 #endif /* !_SYS_IOCTL_COMPAT_H_ */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 5b8edd1a86..d50d78694c 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -173,9 +173,10 @@
  * 500300 - 5.3 development
  * 500301 - rename some public UFS constants
  * 500302 - move IOCTLTRIM to a better header and rename it to DAIOCTRIM
+ * 500303 - get rid of sgtty (superseded by termios)
  */
 #undef __DragonFly_version
-#define __DragonFly_version 500302	/* propagated to newvers */
+#define __DragonFly_version 500303	/* propagated to newvers */
 
 #include <sys/_null.h>
 
diff --git a/sys/sys/ttychars.h b/sys/sys/ttychars.h
deleted file mode 100644
index 94d050cb23..0000000000
--- a/sys/sys/ttychars.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)ttychars.h	8.2 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/sys/ttychars.h,v 1.7 1999/08/28 00:52:06 peter Exp $
- * $DragonFly: src/sys/sys/ttychars.h,v 1.2 2003/06/17 04:28:59 dillon Exp $
- */
-
-#ifndef _SYS_TTYCHARS_H_
-#define _SYS_TTYCHARS_H_
-
-/*
- * 4.3 COMPATIBILITY FILE
- *
- * User visible structures and constants related to terminal handling.
- */
-
-struct ttychars {
-	char	tc_erase;	/* erase last character */
-	char	tc_kill;	/* erase entire line */
-	char	tc_intrc;	/* interrupt */
-	char	tc_quitc;	/* quit */
-	char	tc_startc;	/* start output */
-	char	tc_stopc;	/* stop output */
-	char	tc_eofc;	/* end-of-file */
-	char	tc_brkc;	/* input delimiter (like nl) */
-	char	tc_suspc;	/* stop process signal */
-	char	tc_dsuspc;	/* delayed stop process signal */
-	char	tc_rprntc;	/* reprint line */
-	char	tc_flushc;	/* flush output (toggles) */
-	char	tc_werasc;	/* word erase */
-	char	tc_lnextc;	/* literal next character */
-};
-#ifdef USE_OLD_TTY
-#include <sys/ttydefaults.h>	/* to pick up character defaults */
-#endif
-#endif /* !_SYS_TTYCHARS_H_ */
diff --git a/sys/sys/ttydev.h b/sys/sys/ttydev.h
deleted file mode 100644
index 152b1a1502..0000000000
--- a/sys/sys/ttydev.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 1982, 1986, 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)ttydev.h	8.2 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/sys/ttydev.h,v 1.7 1999/08/28 00:52:07 peter Exp $
- * $DragonFly: src/sys/sys/ttydev.h,v 1.2 2003/06/17 04:28:59 dillon Exp $
- */
-
-/* COMPATIBILITY HEADER FILE */
-
-#ifndef _SYS_TTYDEV_H_
-#define	_SYS_TTYDEV_H_
-
-#ifdef USE_OLD_TTY
-#define B0	0
-#define B50	1
-#define B75	2
-#define B110	3
-#define B134	4
-#define B150	5
-#define B200	6
-#define B300	7
-#define B600	8
-#define B1200	9
-#define	B1800	10
-#define B2400	11
-#define B4800	12
-#define B9600	13
-#define EXTA	14
-#define EXTB	15
-#define B57600  16
-#define B115200 17
-#endif /* USE_OLD_TTY */
-
-#endif /* !_SYS_TTYDEV_H_ */
-- 
2.16.2

