CFGETOSPEED(3V) — NEWS-OS Programmer’s Manual
NAME
cfgetospeed, cfsetospeed, cfgetispeed, cfsetispeed − get and set baud rate
SYNOPSIS
#include <termios.h>
speed_t cfgetospeed(termios_p)
struct termios ∗termios_p;
int cfsetospeed(termios_p, speed)
struct termios ∗termios_p;
speed_t speed;
speed_t cfgetispeed(termios_p)
struct termios ∗termios_p;
int cfsetispeed(termios_p, speed)
struct termios ∗termios_p;
speed_t speed;
DESCRIPTION
The baud rate functions are provided for getting and setting the values of the input and ouput baud rates in the termios structure.
The effects on the terminal device do not become effective until tcsetattr(3V) is successfully called.
The input and output baud rates are stored in the termios structure which is described in detail in termio(4V). The values shown in the table are supported. The names in this table are defined in <termios.h>.
NameDescriptionNameDescription
B0Hang upB600600 baud
B5050 baudB12001200 baud
B7575 baudB18001800 baud
B110110 baudB24002400 baud
B134134.5 baudB48004800 baud
B150150 baudB96009600 baud
B200200 baudB1920019200 baud
B300300 baudB3840038400 baud
cfgetospeed returns the output baud rate stored in the termios structure pointed to by termios_p.
cfsetospeed sets the output baud rate stored in the termios structure pointed to by termios_p to speed. The zero baud rate, B0, is used to terminate the connection. If B0 is specified, the modem control lines shall no longer be asserted. Normally, this will disconnect the line.
cfgetispeed returns the input baud rate stored in the termios structure.
cfsetispeed sets the input baud rate stored in the termios structure to speed. If the input baud rate is set to zero, the input baud rate will be specified by the value of the output baud rate.
cfsetispeed and cfsetospeed return 0 on success. They return −1 and set errno on failure. The errno indicates the following error.
EINVAL speed is greater than B38400 or less than 0.
SEE ALSO
NEWS-OSRelease 4.2.1R