TIOCGETP

Get a terminal's parameters

Synopsis:

#include <sys/ioctl.h>

#define TIOCGETP        _IOR('t', 8, struct sgttyb)

Arguments to ioctl():

Argument Value
fd A file descriptor that you obtained by opening the device
request TIOCGETP
Additional argument A pointer to a struct sgttyb

Description:

This command gets a terminal's parameters.

Input:

None.

Output:

A filled-in struct sgttyb (defined in <sgtty.h>):

struct sgttyb {
    char sg_ispeed; /* input speed */
    char sg_ospeed; /* output speed */
    char sg_erase;  /* erase character */
    char sg_kill;   /* kill character */
    int  sg_flags;  /* mode flags */
};

The mode flags, which are defined in <sys/termio.h> include the following:

as well as the following, which is defined in <termios.h>:

See also:

TIOCSETN, TIOCSETP

ioctl() in the QNX Neutrino C Library Reference