summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/tcattr.c
blob: aaa5ff6e6e3ff5c6705aab59de0cff65a5aae9d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 *  This file contains the RTEMS implementation of the POSIX API
 *  routines tcgetattr and tcsetattr.
 *
 *  $Id$
 *
 */

#include <rtems.h>
#if defined(RTEMS_NEWLIB)

#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <termios.h>

#include "internal.h"
#include "libio.h"

/*
 * tcgetattr/tcsetattr -- get/set attributes of a device.
 *
 *  submitted by K.Shibuya
 */

int
tcgetattr(int fd, struct termios *tp)
{
    return __rtems_ioctl(fd,RTEMS_IO_GET_ATTRIBUTES,tp);
}

int
tcsetattr(int fd, int opt, struct termios *tp)
{
    if(opt != TCSANOW)
      return -1;
    return __rtems_ioctl(fd,RTEMS_IO_SET_ATTRIBUTES,tp);
}

#endif