--- src/include/sgtty.h 2008-01-28 21:55:38.000000000 +0100 +++ src/include/sgtty.h 2008-01-28 21:57:43.000000000 +0100 @@ -1,39 +1,3 @@ -/* - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. 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 +/* $FreeBSD$ */ +#error "The sgtty interface has been replaced by termios(4)" +#error "Try to use or migrate to " --- src/lib/libcompat/4.1/gtty.c 2008-01-28 21:55:44.000000000 +0100 +++ src/lib/libcompat/4.1/gtty.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,52 +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. - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD: src/lib/libcompat/4.1/gtty.c,v 1.5 1999/08/28 00:04:13 peter Exp $"; -#endif /* not lint */ - -#include - -/* - * Get tty modes. - * This was defined in ioctl_compat.h as: - * #define gtty(fd, tty) ioctl(fd, TIOCGETP, tty) - */ - -#undef gtty - -int -gtty(fd, tty) - int fd; - struct sgttyb *tty; -{ - - return (ioctl(fd, TIOCGETP, tty)); -} --- src/lib/libcompat/4.1/stty.3 2008-01-28 21:55:44.000000000 +0100 +++ src/lib/libcompat/4.1/stty.3 1970-01-01 01:00:00.000000000 +0100 @@ -1,94 +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. -.\" 4. 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.10 2007/01/09 01:02:02 imp 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 . --- src/lib/libcompat/4.1/stty.c 2008-01-28 21:55:44.000000000 +0100 +++ src/lib/libcompat/4.1/stty.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,52 +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. - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD: src/lib/libcompat/4.1/stty.c,v 1.5 1999/08/28 00:04:13 peter Exp $"; -#endif /* not lint */ - -#include - -/* - * Set tty modes. - * This was defined in ioctl_compat.h as: - * #define stty(fd, tty) ioctl(fd, TIOCSETP, tty) - */ - -#undef stty - -int -stty(fd, tty) - int fd; - struct sgttyb *tty; -{ - - return (ioctl(fd, TIOCSETP, tty)); -} --- src/lib/libcompat/Makefile 2008-01-28 21:55:44.000000000 +0100 +++ src/lib/libcompat/Makefile 2008-01-28 21:58:21.000000000 +0100 @@ -12,12 +12,11 @@ # compat 4.1 sources # XXX MISSING: tell.c -SRCS+= ascftime.c cftime.c ftime.c getpw.c gtty.c stty.c +SRCS+= ascftime.c cftime.c ftime.c getpw.c -MAN+= 4.1/ftime.3 4.1/getpw.3 4.1/stty.3 +MAN+= 4.1/ftime.3 4.1/getpw.3 MAN+= 4.1/cftime.3 -MLINKS+=stty.3 gtty.3 MLINKS+=cftime.3 ascftime.3 # compat 4.3 sources --- src/sys/sys/ioctl.h 2008-01-28 21:54:25.000000000 +0100 +++ src/sys/sys/ioctl.h 2008-01-28 21:58:54.000000000 +0100 @@ -69,14 +69,3 @@ #include #endif /* !_SYS_IOCTL_H_ */ - -/* - * Keep outside _SYS_IOCTL_H_ - * Compatibility with old terminal driver - * - * Source level -> #define USE_OLD_TTY - * Kernel level -> options COMPAT_43TTY - */ -#if defined(USE_OLD_TTY) || defined(COMPAT_43TTY) -#include -#endif --- src/sys/sys/ioctl_compat.h 2008-01-28 21:54:25.000000000 +0100 +++ src/sys/sys/ioctl_compat.h 2008-01-28 22:41:38.000000000 +0100 @@ -38,11 +38,9 @@ #ifndef _SYS_IOCTL_COMPAT_H_ #define _SYS_IOCTL_COMPAT_H_ -#include -#include - -#ifdef USE_OLD_TTY -#warning "Old BSD tty API used and depends on COMPAT_43TTY. Use termios.h instead" +#ifdef _KERNEL +#ifndef COMPAT_43TTY +#error "only to be used within the TTY compatibility layer" #endif struct tchars { @@ -77,15 +75,8 @@ }; #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 OTIOCGETD _IOR('t', 0, int) /* get line discipline */ +#define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ #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 */ @@ -161,6 +152,9 @@ #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 */ +#endif /* _KERNEL */ + +/* XXX publish these so stty(1) can still report them */ #define OTTYDISC 0 #define NETLDISC 1 #define NTTYDISC 2 --- src/sys/sys/ttychars.h 2008-01-28 21:54:26.000000000 +0100 +++ src/sys/sys/ttychars.h 1970-01-01 01:00:00.000000000 +0100 @@ -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. - * 4. 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.10 2006/01/10 09:19:10 phk 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 /* to pick up character defaults */ -#endif - -#endif /* !_SYS_TTYCHARS_H_ */ --- src/sys/sys/ttydev.h 2008-01-28 21:54:26.000000000 +0100 +++ src/sys/sys/ttydev.h 1970-01-01 01:00:00.000000000 +0100 @@ -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. - * 4. 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.12 2006/01/10 09:19:10 phk 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 -#define B230400 18 -#define B460800 19 -#define B921600 20 -#endif /* USE_OLD_TTY */ - -#endif /* !_SYS_TTYDEV_H_ */