Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jul 2002 16:10:50 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        bruno schwander <bruno@tinkerbox.org>
Cc:        Cyrille Lefevre <cyrille.lefevre@laposte.net>, hackers@FreeBSD.ORG
Subject:   Re: termios guru ?
Message-ID:  <3D2E107A.362AF9EB@mindspring.com>
References:  <Pine.BSF.4.21.0207111505070.7694-100000@duron.bschwand.net>

next in thread | previous in thread | raw e-mail | index | archive | help
bruno schwander wrote:
> thanks, I see the idea but cfmakeraw has some other effects... newlines
> output by the program are not translated, etc.
> 
> My main program now is the VMIN/VTIME stuff. The way irit tries to use is,
> is basically to be able to do async stdin reading, but this does not
> work. Whenever I try those settings, no input is ever read by the
> program. It fgetc() constantly returns -1.
> 
> Any idea why ?

     In noncanonical mode input processing, input bytes are not assembled into
     lines, and erase and kill processing does not occur.  The values of the
     VMIN and VTIME members of the c_cc array are used to determine how to
     process the bytes received.

     MIN represents the minimum number of bytes that should be received when
     the read(2) function successfully returns.  TIME is a timer of 0.1 second
     granularity that is used to time out bursty and short term data transmis-
     sions.  If MIN is greater than { MAX_INPUT}, the response to the request
     is undefined.  The four possible values for MIN and TIME and their inter-
     actions are described below.

What's "MAX_INPUT" set to?

Try running:

	system("stty -a");

From your program, after you set the terminal modes, to make sure you set
them correctly.

Make sure you are using termios, not termio.

See also the source code to raw(3) and cbreak(3) in the curses library
source code.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D2E107A.362AF9EB>