/* $NetBSD: gtty.c,v 1.8 2003/07/26 19:24:55 salo Exp $ */ /* * 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 for the * NetBSD Project. See http://www.NetBSD.org/ for * information about NetBSD. * 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. * * <> */ #include #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: gtty.c,v 1.8 2003/07/26 19:24:55 salo Exp $"); #endif /* LIBC_SCCS and not lint */ #include #include #include /* * Get tty modes. * This was defined in ioctl_compat.h as: * #define gtty(fd, tty) ioctl(fd, TIOCGETP, tty) */ int gtty(fd, tty) int fd; struct sgttyb *tty; { _DIAGASSERT(fd != -1); _DIAGASSERT(tty != 0); return (ioctl(fd, TIOCGETP, tty)); } andvar 2017-04-23Add vis DQ.christos 2016-01-14add stravischristos 2015-05-23add VIS_NOLOCALE flagchristos 2014-09-26add VIS_META/VIS_SHELL support to encode all shell metacharacters.christos 2013-02-20More fixes from J.R. Oldroyd. We introduce a new function that canchristos 2012-12-14Add VIS_GLOB (Brooks Davis)christos 2011-03-12Fix various vis/unvis issues:christos 2010-11-27add VIS_NOESCAPE and VIS_HTTP1866christos 2009-02-10Add RFC 2045 MIME Quoted-Printable support.christos 2005-09-13compat code reorgchristos 2005-02-03de-__P -- the hack is long since useless. Discussed with christos,perry 2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc 2002-12-12this needs <sys/types.h>lukem 2002-03-23Add VIS_HTTPSTYLE and strunvisx (From FreeBSD)christos