[illumos-Developer] cfmakeraw (was: First Illumos patches)

Cyril Plisko cyril.plisko at mountall.com
Sun Jun 12 02:19:15 PDT 2011


On Wed, Jun 8, 2011 at 8:33 PM, Andrew Stormont
<andrew.stormont at nexenta.com> wrote:
> Hi Cyril,
>
> Yes I forgot to add the file.  Patch attached should be good.


Andy,

sorry it took me some time to get to review.

I only looked at cfmakeraw.c

+/*
+ * 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;
+}

You are not touching c_cc[VMIN] and c_cc[VTIME] fields. Is it on purpose ?

For raw mode I am usually setting it to:

c_cc[VMIN] = 1;
c_cc[VTIME] = 0;

-- 
Regards,
        Cyril



More information about the Developer mailing list