cfgetospeed

return the output baud rate that is stored in a termios structure

Synopsis:

#include <termios.h>
speed_t cfgetospeed( 
            const struct termios *termios_p );

Description:

The cfgetospeed() function returns the output baud rate that is stored in the termios structure pointed to by termios_p.

A valid termios control structure for an opened device can be obtained using the tcgetattr() function.

Returns:

the output baud rate stored in *termios_p.

If an error occurs, (-1) is returned and errno is set.

Errors:

EINVAL
One of the arguments is invalid.
ENOTTY
This function is not supported by the system.

See also:

errno, cfgetispeed(), cfsetispeed(), cfsetospeed(), tcgetattr(), tcsetattr()

Examples:

#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

void main()
  {
    int fd;
    struct termios termios_p;
    speed_t speed;

    fd = open( "/dev/ser1", O_RDWR );
    tcgetattr( fd, &termios_p);

    /*
     *	Get output baud rate
     */
    speed = cfgetospeed( &termios_p);
    printf( "Output baud: %ld\n", speed );

    close( fd );
  }

Classification:

POSIX 1003.1

Systems:

QNX