--- old/usr/src/grub/grub-0.97/grub/asmstub.c	2013-09-28 12:17:11.752917109 +0100
+++ new/usr/src/grub/grub-0.97/grub/asmstub.c	2013-09-28 12:17:11.761139000 +0100
@@ -1135,15 +1135,7 @@
     goto fail;
 
   /* Raw mode.  */
-#if defined(__sun)
-  termios.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
-  termios.c_oflag &= ~OPOST;
-  termios.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
-  termios.c_cflag &= ~(CSIZE|PARENB);
-  termios.c_cflag |= CS8;
-#else
   cfmakeraw (&termios);
-#endif
 
   /* Set the speed.  */
   termios_speed = get_termios_speed (speed);
--- old/usr/src/lib/libc/amd64/Makefile	2013-09-28 12:17:12.023148666 +0100
+++ new/usr/src/lib/libc/amd64/Makefile	2013-09-28 12:17:12.030637403 +0100
@@ -347,6 +347,7 @@
 	cfree.o			\
 	cfsetispeed.o		\
 	cfsetospeed.o		\
+	cfmakeraw.o		\
 	cftime.o		\
 	clock.o			\
 	closedir.o		\
--- old/usr/src/lib/libc/i386/Makefile.com	2013-09-28 12:17:12.293454615 +0100
+++ new/usr/src/lib/libc/i386/Makefile.com	2013-09-28 12:17:12.300766099 +0100
@@ -378,6 +378,7 @@
 	cfree.o			\
 	cfsetispeed.o		\
 	cfsetospeed.o		\
+	cfmakeraw.o		\
 	cftime.o		\
 	clock.o			\
 	closedir.o		\
--- /dev/null	2013-09-28 12:17:12.000000000 +0100
+++ new/usr/src/lib/libc/port/gen/cfmakeraw.c	2013-09-28 12:17:12.555723239 +0100
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ */
+
+#include "lint.h"
+#include <sys/types.h>
+#include <sys/termios.h>
+
+/*
+ * set the structure pointed to by termios_p to raw mode
+ */
+
+void
+cfmakeraw(struct termios *termios_p)
+{
+	termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|
+	    INLCR|IGNCR|ICRNL|IXON);
+	termios_p->c_oflag &= ~OPOST;
+	termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+	termios_p->c_cflag &= ~(CSIZE|PARENB);
+	termios_p->c_cflag |= CS8;
+	termios_p->c_cc[VMIN] = 1;
+	termios_p->c_cc[VTIME] = 0;
+}
--- old/usr/src/lib/libc/port/llib-lc	2013-09-28 12:17:12.670006925 +0100
+++ new/usr/src/lib/libc/port/llib-lc	2013-09-28 12:17:12.677070876 +0100
@@ -310,6 +310,9 @@
 /* cfsetospeed.c */
 int cfsetospeed(struct termios *termios_p, speed_t speed);
 
+/* cfmakeraw.c */
+void cfmakeraw(struct termios *termios_p);
+
 /* cftime.c */
 int cftime(char *buf, char *format, const time_t *t);
 int ascftime(char *buf, const char *format, const struct tm *tm);
--- old/usr/src/lib/libc/port/mapfile-vers	2013-09-28 12:17:12.964532181 +0100
+++ new/usr/src/lib/libc/port/mapfile-vers	2013-09-28 12:17:12.970436218 +0100
@@ -90,6 +90,11 @@
 $add amd64
 $endif
 
+SYMBOL_VERSION ILLUMOS_0.6 {
+    protected:
+	cfmakeraw;
+} ILLUMOS_0.5;
+
 SYMBOL_VERSION ILLUMOS_0.5 {	# common C++ ABI exit handlers
     protected:
 	__cxa_atexit;
--- old/usr/src/lib/libc/sparc/Makefile.com	2013-09-28 12:17:13.330038551 +0100
+++ new/usr/src/lib/libc/sparc/Makefile.com	2013-09-28 12:17:13.342205378 +0100
@@ -410,6 +410,7 @@
 	cfree.o			\
 	cfsetispeed.o		\
 	cfsetospeed.o		\
+	cfmakeraw.o		\
 	cftime.o		\
 	clock.o			\
 	closedir.o		\
--- old/usr/src/uts/common/sys/termios.h	2013-09-28 12:17:13.601035488 +0100
+++ new/usr/src/uts/common/sys/termios.h	2013-09-28 12:17:13.618642214 +0100
@@ -104,6 +104,7 @@
 extern int cfsetospeed(struct termios *, speed_t);
 extern speed_t cfgetispeed(const struct termios *);
 extern int cfsetispeed(struct termios *, speed_t);
+extern void cfmakeraw(struct termios *);
 extern int tcgetattr(int, struct termios *);
 extern int tcsetattr(int, int, const struct termios *);
 extern int tcsendbreak(int, int);
@@ -117,6 +118,7 @@
 extern int cfsetospeed();
 extern speed_t cfgetispeed();
 extern int cfsetispeed();
+extern void cfmakeraw();
 extern int tcgetattr();
 extern int tcsetattr();
 extern int tcsendbreak();
