gtty.c revision 1.2
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.2Slukem#include <sys/cdefs.h>
321.1Scgd#ifndef lint
331.2Slukem__RCSID("$NetBSD: gtty.c,v 1.2 1997/10/09 10:20:16 lukem Exp $");
341.1Scgd#endif /* not lint */
351.1Scgd
361.1Scgd#include <sgtty.h>
371.1Scgd
381.1Scgd/*
391.1Scgd * Get tty modes.
401.1Scgd * This was defined in ioctl_compat.h as:
411.1Scgd *	#define	gtty(fd, tty)	ioctl(fd, TIOCGETP, tty)
421.1Scgd */
431.1Scgdint
441.1Scgdgtty(fd, tty)
451.1Scgd	int fd;
461.1Scgd	struct sgttyb *tty;
471.1Scgd{
481.1Scgd
491.1Scgd	return (ioctl(fd, TIOCGETP, tty));
501.1Scgd}
51