stty or gtty Subroutine

Purpose

Sets or gets terminal state.

Library

Standard C Library (libc.a)

Syntax

#include <sgtty.h>

stty ( FileDescriptor,  Buffer)
int FileDescriptor;
struct sgttyb *Buffer;

gtty (FileDescriptor, Buffer)
int FileDescriptor;
struct sgttyb *Buffer;

Description

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.

Parameters

Item Description
FileDescriptor Specifies an open file descriptor.
Buffer Specifies the buffer.

Return Values

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.