diff options
author | Daniel Ramirez <javamonn@gmail.com> | 2013-12-05 20:21:05 -0600 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-01-07 10:34:31 -0600 |
commit | 564ce0f42dc0b45f30b86bec2825825d773c5c58 (patch) | |
tree | 3a246c92d3067f1ffd0570f831d69468b85a7a21 /cpukit/libcsupport/src/cfsetspeed.c | |
parent | rhealstone: Add rh prefix to all test names (diff) | |
download | rtems-564ce0f42dc0b45f30b86bec2825825d773c5c58.tar.bz2 |
libcsupport: implemented termios functions cfsetspeed and cfmakeraw
Diffstat (limited to 'cpukit/libcsupport/src/cfsetspeed.c')
-rw-r--r-- | cpukit/libcsupport/src/cfsetspeed.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/cfsetspeed.c b/cpukit/libcsupport/src/cfsetspeed.c new file mode 100644 index 0000000000..f681ebf194 --- /dev/null +++ b/cpukit/libcsupport/src/cfsetspeed.c @@ -0,0 +1,41 @@ +/* @file + * + * @brief Baud Rate Functions + * @ingroup Termios + */ + +/* + * COPYRIGHT (c) 1989-2014. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems.h> +#if defined(RTEMS_NEWLIB) + +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <termios.h> +#include <rtems/seterr.h> + +int cfsetspeed( + struct termios *tp, + speed_t speed +) +{ + if ( speed & ~CBAUD ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + cfsetispeed( tp, speed ); + cfsetospeed( tp, speed ); + return 0; +} +#endif |