xref: /original-bsd/usr.bin/uucp/port/ioctl.c (revision c3e32dec)
1 /*-
2  * Copyright (c) 1985, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.proprietary.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)ioctl.c	8.1 (Berkeley) 06/06/93";
10 #endif /* not lint */
11 
12 #include "uucp.h"
13 #include <sgtty.h>
14 
15 /*******
16  *	ioctl(fn, com, ttbuf)	for machines without ioctl
17  *	int fn, com;
18  *	struct sgttyb *ttbuf;
19  *
20  *	return codes - same as stty and gtty
21  */
22 
23 ioctl(fn, com, ttbuf)
24 register int fn, com;
25 struct sgttyb *ttbuf;
26 {
27 	struct sgttyb tb;
28 
29 	switch (com) {
30 	case TIOCHPCL:
31 		gtty(fn, &tb);
32 		tb.sg_flags |= 1;
33 		return(stty(fn, &tb));
34 	case TIOCGETP:
35 		return(gtty(fn, ttbuf));
36 	case TIOCSETP:
37 		return(stty(fn, ttbuf));
38 	case TIOCEXCL:
39 	case TIOCNXCL:
40 	default:
41 		return(-1);
42 	}
43 }
44