Sets or gets terminal state.
Standard C Library (libc.a)
#include <sgtty.h>
stty ( FileDescriptor, Buffer)
int FileDescriptor;
struct sgttyb *Buffer;
gtty (FileDescriptor, Buffer)
int FileDescriptor;
struct sgttyb *Buffer;
These subroutines have been made obsolete by the ioctl subroutine.
The stty subroutine sets the state of the terminal associated with the FileDescriptor parameter. The gtty subroutine retrieves the state of the terminal associated with FileDescriptor. To set the state of a terminal, the calling process must have write permission.
Use of the stty subroutine is equivalent to the ioctl (FileDescriptor, TIOSETP, Buffer) subroutine, while use of the gtty subroutine is equivalent to the ioctl (FileDescriptor, TIOGETP, Buffer) subroutine.
Item | Description |
---|---|
FileDescriptor | Specifies an open file descriptor. |
Buffer | Specifies the buffer. |
If the stty or gtty subroutine is successful, a value of 0 is returned. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.