summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/tcattr.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1997-08-01 18:12:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1997-08-01 18:12:11 +0000
commit9deb5b8b2822eb49c7a31d35d37d9b59dcd6555c (patch)
tree2797615f5f5eab05772d2bb807ba95e0d632481b /c/src/lib/libc/tcattr.c
parentMerged very large and much appreciated patch from Chris Johns (diff)
downloadrtems-9deb5b8b2822eb49c7a31d35d37d9b59dcd6555c.tar.bz2
Katsutoshi Shibuya (shibuya@mxb.meshnet.or.jp)of BU-Denken Co., Ltd.
(Sapporo, Japan) submitted the extended console driver for the MVME162LX BSP and the POSIX tcsetattr() and tcgetattr() routines. This device driver supports four serial ports, cooked IO, and provides a portable base for Zilog 8530 based console drivers.
Diffstat (limited to 'c/src/lib/libc/tcattr.c')
-rw-r--r--c/src/lib/libc/tcattr.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/c/src/lib/libc/tcattr.c b/c/src/lib/libc/tcattr.c
new file mode 100644
index 0000000000..aaa5ff6e6e
--- /dev/null
+++ b/c/src/lib/libc/tcattr.c
@@ -0,0 +1,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