BSD 4_2 development
[unix-history] / usr / man / man3 / stty.3c
CommitLineData
25a98407
C
1.TH STTY 3C "1 April 1983"
2.UC 4
3.SH NAME
4stty, gtty \- set and get terminal state (defunct)
5.SH SYNOPSIS
6.nf
7.B #include <sgtty.h>
8.sp
9.B stty(fd, buf)
10.B int fd;
11.B struct sgttyb *buf;
12.sp
13.B gtty(fd, buf)
14.B int fd;
15.B struct sgttyb *buf;
16.fi
17.SH DESCRIPTION
18.ft B
19This interface is obsoleted by ioctl(2).
20.ft R
21.PP
22.I Stty
23sets the state of the terminal associated with
24.IR fd .
25.I Gtty
26retrieves the state of the terminal associated
27with
28.IR fd .
29To set the state of a terminal the call must have
30write permission.
31.PP
32The
33.I stty
34call is actually ``ioctl(fd, TIOCSETP, buf)'', while
35the
36.I gtty
37call is ``ioctl(fd, TIOCGETP, buf)''.
38See
39.IR ioctl (2)
40and
41.IR tty (4)
42for an explanation.
43.SH DIAGNOSTICS
44If the call is successful 0 is returned, otherwise \-1 is
45returned and the global variable
46.I errno
47contains the reason for the failure.
48.SH SEE ALSO
49ioctl(2),
50tty(4)