xref: /original-bsd/lib/libcompat/4.1/stty.3 (revision a1c2194a)
1.\" Copyright (c) 1983, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)stty.3	6.4 (Berkeley) 04/19/91
7.\"
8.Dd
9.Dt STTY 3
10.Os BSD 4.2
11.Sh NAME
12.Nm stty ,
13.Nm gtty
14.Nd set and get terminal state (defunct)
15.Sh SYNOPSIS
16.Fd #include <sgtty.h>
17.Fn stty "int fd" "struct sgttyb *buf"
18.Fn gtty "int fd" "struct sgttyb *buf"
19.Sh DESCRIPTION
20.Bf -symbolic
21These interfaces are obsoleted by ioctl(2).
22They are available from the compatibility library, libcompat.
23.Ef
24.Pp
25The
26.Fn stty
27function
28sets the state of the terminal associated with
29.Fa fd .
30The
31.Fn gtty
32function
33retrieves the state of the terminal associated
34with
35.Fa fd .
36To set the state of a terminal the call must have
37write permission.
38.Pp
39The
40.Fn stty
41call is actually
42.Ql ioctl(fd, TIOCSETP, buf) ,
43while
44the
45.Fn gtty
46call is
47.Ql ioctl(fd, TIOCGETP, buf) .
48See
49.Xr ioctl 2
50and
51.Xr tty 4
52for an explanation.
53.Sh DIAGNOSTICS
54If the call is successful 0 is returned, otherwise \-1 is
55returned and the global variable
56.Va errno
57contains the reason for the failure.
58.Sh SEE ALSO
59.Xr ioctl 2 ,
60.Xr tty 4
61.Sh HISTORY
62The
63.Fn stty
64and
65.Fn gtty
66functions appeared in
67.Bx 4.2 .
68