Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/cfgetospeed.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/cfgetospeed.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/cfgetospeed.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/cfgetospeed.html on line 8

cfgetospeed()

Return the output baud rate that's stored in a termios structure

Synopsis:

#include <termios.h>

speed_t cfgetospeed( 
            const struct termios* termios_p );

Arguments:

termios_p
A pointer to a termios structure that describes the terminal's control attributes.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

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

You can get a valid termios control structure for an opened device by calling tcgetattr().

Returns:

The output baud rate stored in *termios_p, or -1 if an error occurs (errno is set).

Errors:

EINVAL
One of the arguments is invalid.
ENOTTY
This function isn't supported by the system.

Examples:

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

int main( void )
  {
    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 );
    return EXIT_SUCCESS;
  }

Classification:

POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

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


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/cfgetospeed.html on line 166

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/cfgetospeed.html on line 166