bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Is termio broken......?


From: Hankinson, Jeremy
Subject: RE: Is termio broken......?
Date: Wed, 10 Jan 2001 09:12:20 -0500

Hi Ulrich,
        This code works on Intel Linux and other UNIX's i.e. Solaris, HP-UX 
etc. and more importantly OSF. According to the defn of termio in 
asm/termios.h, when ICANON is 'on' (on Alpha Linux) VEOF and VEOL  are mapped 
to 4 & 5 but when ICANON if off VMIN and VTIME should be 4 & 5 (for termio) for 
backwards compatibility.


Jeremy Hankinson
Ingres Dev - Linux
Computer Associates 
Islandia, NY
e-mail: address@hidden
tel: +1 631 342 5086


-----Original Message-----
From: Ulrich Drepper [mailto:address@hidden
Sent: Tuesday, January 09, 2001 10:57 PM
To: Hankinson, Jeremy
Cc: address@hidden
Subject: Re: Is termio broken......?


"Hankinson, Jeremy" <address@hidden> writes:

> When using the old style termio structure to control terminal
> behavior on RedHat 6.2, turning off ICANON (non canonical mode),
> should mean that you can control how functions like read() behave,
> buy setting termio.c_cc[VMIN] and termio.c_cc[VTIME]. However, the
> following code does not behave as expected;

Your code is broken:

>     _tty.c_cc[VMIN] = 1;      /* set min no. chars to 1 */
>     _tty.c_cc[VTIME] = 1;     /* timout = 0.1 secs */

This is modifying memory outside the data structure.  struct termio's
c_cc field has only 8 elements.  Your best bet is to use numeric
values.  I don't think we'll add symbolic values for termio.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]