install approved copyright notice
[unix-history] / usr / src / lib / libcompat / 4.1 / stty.3
CommitLineData
5223acce
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
69eae6c6 5.\" @(#)stty.3 6.1 (Berkeley) %G%
5223acce 6.\"
69eae6c6 7.TH STTY 3C ""
5223acce
KM
8.UC 5
9.SH NAME
10stty, gtty \- set and get terminal state (defunct)
11.SH SYNOPSIS
12.nf
13.B #include <sgtty.h>
14.sp
15.B stty(fd, buf)
16.B int fd;
17.B struct sgttyb *buf;
18.sp
19.B gtty(fd, buf)
20.B int fd;
21.B struct sgttyb *buf;
22.fi
23.SH DESCRIPTION
24.ft B
25This interface is obsoleted by ioctl(2).
26.ft R
27.PP
28.I Stty
29sets the state of the terminal associated with
30.IR fd .
31.I Gtty
32retrieves the state of the terminal associated
33with
34.IR fd .
35To set the state of a terminal the call must have
36write permission.
37.PP
38The
39.I stty
40call is actually ``ioctl(fd, TIOCSETP, buf)'', while
41the
42.I gtty
43call is ``ioctl(fd, TIOCGETP, buf)''.
44See
45.IR ioctl (2)
46and
47.IR tty (4)
48for an explanation.
49.SH DIAGNOSTICS
50If the call is successful 0 is returned, otherwise \-1 is
51returned and the global variable
52.I errno
53contains the reason for the failure.
54.SH SEE ALSO
55ioctl(2),
56tty(4)