aboutsummaryrefslogtreecommitdiffstats
path: root/com32/libutil
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-11-14 10:50:27 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-11-14 10:50:27 +0000
commit4c7278413ef068bd8239fd8a6c69d64bd2c0a385 (patch)
tree4c39e8872de7babc24bed9fe528df28c8d82d427 /com32/libutil
parent749297b070d1fe3d82fd9e5c4306b4aaf257f2a1 (diff)
parent348ae6af01350a9a46f3076a2facd27918f0f603 (diff)
downloadsyslinux-4c7278413ef068bd8239fd8a6c69d64bd2c0a385.tar.gz
syslinux-4c7278413ef068bd8239fd8a6c69d64bd2c0a385.tar.xz
syslinux-4c7278413ef068bd8239fd8a6c69d64bd2c0a385.zip
Merge tag 'syslinux-5.00-pre10' into for-hpa/elflink/firmware
Pull in the latest prerelease that includes some bug fixes for ldlinux and a realloc() bug in core/. Conflicts: com32/cmenu/Makefile com32/elflink/ldlinux/Makefile com32/lib/Makefile core/pxelinux.asm
Diffstat (limited to 'com32/libutil')
-rw-r--r--com32/libutil/ansiraw.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/com32/libutil/ansiraw.c b/com32/libutil/ansiraw.c
index 2afd48a7..b67768c5 100644
--- a/com32/libutil/ansiraw.c
+++ b/com32/libutil/ansiraw.c
@@ -47,6 +47,7 @@ void console_ansi_raw(void)
#include <stdio.h>
#include <termios.h>
+#include <unistd.h>
static struct termios original_termios_settings;
@@ -82,4 +83,22 @@ void console_ansi_raw(void)
tcsetattr(0, TCSAFLUSH, &tio);
}
+int raw_read(int fd, void *buf, size_t count)
+{
+ struct termios tio, rtio;
+ int rv;
+
+ tcgetattr(fd, &tio);
+
+ cfmakeraw(&rtio);
+ tcsetattr(fd, 0, &rtio);
+
+ rv = read(fd, buf, count);
+
+ /* Restore settings */
+ tcsetattr(fd, 0, &tio);
+
+ return rv;
+}
+
#endif