gtty.c revision 1.1
11.1Scgd/* 21.1Scgd * Copyright (c) 1994 Christopher G. Demetriou 31.1Scgd * All rights reserved. 41.1Scgd * 51.1Scgd * Redistribution and use in source and binary forms, with or without 61.1Scgd * modification, are permitted provided that the following conditions 71.1Scgd * are met: 81.1Scgd * 1. Redistributions of source code must retain the above copyright 91.1Scgd * notice, this list of conditions and the following disclaimer. 101.1Scgd * 2. Redistributions in binary form must reproduce the above copyright 111.1Scgd * notice, this list of conditions and the following disclaimer in the 121.1Scgd * documentation and/or other materials provided with the distribution. 131.1Scgd * 3. All advertising materials mentioning features or use of this software 141.1Scgd * must display the following acknowledgement: 151.1Scgd * This product includes software developed by Christopher G. Demetriou. 161.1Scgd * 4. The name of the author may not be used to endorse or promote products 171.1Scgd * derived from this software without specific prior written permission 181.1Scgd * 191.1Scgd * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 201.1Scgd * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 211.1Scgd * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 221.1Scgd * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 231.1Scgd * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 241.1Scgd * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 251.1Scgd * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 261.1Scgd * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 271.1Scgd * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 281.1Scgd * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 291.1Scgd */ 301.1Scgd 311.1Scgd#ifndef lint 321.1Scgdstatic char rcsid[] = "$Id: gtty.c,v 1.1 1994/05/21 05:20:34 cgd Exp $"; 331.1Scgd#endif /* not lint */ 341.1Scgd 351.1Scgd#include <sgtty.h> 361.1Scgd 371.1Scgd/* 381.1Scgd * Get tty modes. 391.1Scgd * This was defined in ioctl_compat.h as: 401.1Scgd * #define gtty(fd, tty) ioctl(fd, TIOCGETP, tty) 411.1Scgd */ 421.1Scgdint 431.1Scgdgtty(fd, tty) 441.1Scgd int fd; 451.1Scgd struct sgttyb *tty; 461.1Scgd{ 471.1Scgd 481.1Scgd return (ioctl(fd, TIOCGETP, tty)); 491.1Scgd} 50