Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tcattribute(3C) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

tccontrol(3C)

cfspeed(3C)

termio(7)

TCATTRIBUTE(3C)

NAME

tcgetattr, tcsetattr − control tty device

SYNOPSIS

#include <termios.h>
 
int tcgetattr (fildes, termios_p)
int fildes;
struct termios *termios_p;
 
int tcsetattr (fildes, optional_actions, termios_p)
int fildes;
int optional_actions;
struct termios *termios_p;

DESCRIPTION

Tcgetattr gets the parameters associated with fildes and stores them in the termios structure referenced by termios_p. If the terminal device does not support split baud rates, the input baud rate stored in the termios structure is zero.  This function is allowed from a background process (See termio(7)). However, the terminal attributes may be subsequently changed by a foreground process.

Tcsetattr sets the parameters associated with fildes (unless support is required from underlying hardware that is not available) from the termios structure referenced by termios_p as follows:

1.  If optional_actions is TCSANOW, the change is immediate. 

2.  If optional_actions is TCSADRAIN, the change occurs after all output written to fildes is transmitted. 

3.  If optional_actions is TCSAFLUSH, the change occurs after all output written to fildes is transmitted, and all input that has been received but not read is discarded. 

RETURN VALUE

Upon successful completion, a value of zero is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

ERRORS

These functions will fail if one or more of the following is true:

[EBADF] Fildes is not a valid file descriptor. 

[ENOTTY] The file associated with fildes is not a terminal. 

[EINVAL] The optional_actions argument is not a proper value. 

WARNINGS

A request to set a hardware parameter to a value that is not supported by the hardware being used will be ignored.  The remaining parameter values of the request which are supported or which do not affect hardware will be set as requested.  For any hardware that does not support separate input and output baud rates, the requested output baud rate will be used to set the actual hardware baud rate.  Tcgetattr always returns the actual values set in hardware. 

SEE ALSO

tccontrol(3C), cfspeed(3C),  termio(7). 

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026