changeset 252:d27a89068280

set_serial_nonblock() added to libserial
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 21 Sep 2017 23:30:53 +0000
parents fb577c31e960
children 6f078c4a5506
files libserial-orig/Makefile libserial-orig/nonblock.c
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libserial-orig/Makefile	Thu Sep 21 23:25:02 2017 +0000
+++ b/libserial-orig/Makefile	Thu Sep 21 23:30:53 2017 +0000
@@ -1,6 +1,6 @@
 CC=	gcc
 CFLAGS=	-O2
-OBJS=	baudtab.o openport.o setbaud.o setbyname.o
+OBJS=	baudtab.o nonblock.o openport.o setbaud.o setbyname.o
 LIB=	libserial.a
 
 all:	${LIB}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libserial-orig/nonblock.c	Thu Sep 21 23:30:53 2017 +0000
@@ -0,0 +1,15 @@
+/*
+ * This module contains the set_serial_nonblock() function.
+ */
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+
+extern int target_fd;
+
+set_serial_nonblock(state)
+	int state;
+{
+	ioctl(target_fd, FIONBIO, &state);
+}