source: rtems/c/src/exec/libcsupport/src/tcsetattr.c @ c7016198

4.104.114.84.95
Last change on this file since c7016198 was 3cad2919, checked in by Joel Sherrill <joel.sherrill@…>, on 10/01/99 at 15:55:30

Addition of more functionality by Eric Norum to support GNU readline.

  • Property mode set to 100644
File size: 968 bytes
RevLine 
[c4638fff]1/*
[07a3253d]2 *  tcsetattr() - POSIX 1003.1b 7.2.1 - Get and Set State
[c4638fff]3 *
4 *  COPYRIGHT (c) 1989-1998.
5 *  On-Line Applications Research Corporation (OAR).
6 *  Copyright assigned to U.S. Government, 1994.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
[07a3253d]15#include <rtems.h>
16#if defined(RTEMS_NEWLIB)
17
18#include <sys/types.h>
19#include <sys/stat.h>
[c4638fff]20#include <errno.h>
[07a3253d]21#include <termios.h>
[d001776f]22/* #include <sys/ioctl.h> */
23
24int ioctl();
[c4638fff]25
[23c4bbf5]26#include <rtems/libio.h>
[07a3253d]27#include "libio_.h"
28
29int tcsetattr(
30  int             fd,
31  int             opt,
32  struct termios *tp
[c4638fff]33)
34{
[3cad2919]35  switch (opt) {
36  default:
[07a3253d]37    set_errno_and_return_minus_one( ENOTSUP );
38
[3cad2919]39  case TCSADRAIN:
40    if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0)
41        return -1;
42    /*
43     * Fall through to....
44     */
45  case TCSANOW:
46    return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp );
47  }
[c4638fff]48}
49#endif
Note: See TracBrowser for help on using the repository browser.