xref: /csrg-svn/usr.bin/uucp/port/ioctl.c (revision 17835)
113659Ssam #ifndef lint
2*17835Sralph static char sccsid[] = "@(#)ioctl.c	5.2 (Berkeley) 01/22/85";
313659Ssam #endif
413659Ssam 
513659Ssam #include "uucp.h"
613659Ssam #include <sgtty.h>
713659Ssam 
813659Ssam /*******
913659Ssam  *	ioctl(fn, com, ttbuf)	for machines without ioctl
1013659Ssam  *	int fn, com;
1113659Ssam  *	struct sgttyb *ttbuf;
1213659Ssam  *
1313659Ssam  *	return codes - same as stty and gtty
1413659Ssam  */
1513659Ssam 
1613659Ssam ioctl(fn, com, ttbuf)
1713659Ssam register int fn, com;
1813659Ssam struct sgttyb *ttbuf;
1913659Ssam {
2013659Ssam 	struct sgttyb tb;
2113659Ssam 
2213659Ssam 	switch (com) {
2313659Ssam 	case TIOCHPCL:
2413659Ssam 		gtty(fn, &tb);
2513659Ssam 		tb.sg_flags |= 1;
2613659Ssam 		return(stty(fn, &tb));
2713659Ssam 	case TIOCGETP:
2813659Ssam 		return(gtty(fn, ttbuf));
2913659Ssam 	case TIOCSETP:
3013659Ssam 		return(stty(fn, ttbuf));
3113659Ssam 	case TIOCEXCL:
32*17835Sralph 	case TIOCNXCL:
3313659Ssam 	default:
3413659Ssam 		return(-1);
3513659Ssam 	}
3613659Ssam }
37