Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

cfsetospeed - set output baud rate

&pagelevel(4)&pagelevel

Syntax

#include <termios.h>

int cfsetospeed (struct termios *termios_p, speed_t speed);

Description

cfsetospeed() sets the output baud rate stored in the termios structure pointed to by termios_p to speed.

cfgetospeed() has no effect on the baud rates set in the hardware until a subsequent successful call to tcsetattr() on the same termios structure.

Extension
Only the corresponding value in the termios structure is changed. Since different baud rates are not supported by the hardware, it is only relevant whether or not this value is equal to zero. All baud rates defined in termios.h can, however, be specified and stored in the termios structure. If baud rates which are not defined in termios.h are specified, they are not stored: -1 is returned, and errno is set to the value EINVAL. See tcsetattr() for more details. The zero baud rate, B0, is used to terminate the connection. If B0 is specified, the modem control lines are no longer be asserted. Normally, this disconnects the line. (End)

Return val.

0

-1

if successful.

if an error occurs. errno is set to indicate the error.

Errors

cfsetospeed() will fail if:

EINVAL

speed is not a valid baud rate or the value of speed is not within the permitted range of values defined in termios.h.

See also

cfgetispeed(), cfgetospeed(), cfsetispeed(), tcsetattr(), termios.h, section“General terminal interface”.