/*
 * 5799-WZQ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:ioctl.c 12.0$ */
/* $ACIS:ioctl.c 12.0$ */
/* $Source: /ibm/acis/usr/src/usr.bin/uucp/RCS/ioctl.c,v $ */

#ifndef lint
static char *rcsid = "$Header:ioctl.c 12.0$";
#endif

#ifndef lint
static char sccsid[] = "@(#)ioctl.c	5.2 (Berkeley) 1/22/85";
#endif

#include "uucp.h"
#include <sgtty.h>

/*******
 *	ioctl(fn, com, ttbuf)	for machines without ioctl
 *	int fn, com;
 *	struct sgttyb *ttbuf;
 *
 *	return codes - same as stty and gtty
 */

ioctl(fn, com, ttbuf)
register int fn, com;
struct sgttyb *ttbuf;
{
	struct sgttyb tb;

	switch (com) {
	case TIOCHPCL:
		gtty(fn, &tb);
		tb.sg_flags |= 1;
		return(stty(fn, &tb));
	case TIOCGETP:
		return(gtty(fn, ttbuf));
	case TIOCSETP:
		return(stty(fn, ttbuf));
	case TIOCEXCL:
	case TIOCNXCL:
	default:
		return(-1);
	}
}
