*BSD News Article 9796


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA6517 ; Sun, 10 Jan 93 13:04:03 EST
Xref: sserve comp.unix.bsd:9853 comp.lang.c:37856
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!swrinde!emory!kd4nc!n4hgf!wa4cyb!jmd
From: jmd@wa4cyb.UUCP (John Dashner)
Newsgroups: comp.unix.bsd,comp.lang.c
Subject: Re: a unix terminal question
Message-ID: <4@wa4cyb.UUCP>
Date: 12 Jan 93 12:30:25 GMT
References: <uonuhjc@zola.esd.sgi.com>
Followup-To: comp.unix.bsd,comp.lang.c
Organization: John Dashner & Assoc.
Lines: 20
X-Newsreader: TIN [version 1.1 PL7]

D.P. Suresh (dps@delhi.esd.sgi.com) wrote:
: 

	[stuff deleted from terry@weber.edu]

: 
: 	/* We shall specify 0.5 sec as the waiting time */
: 	timeout.tv_sec  = 0;	/*   0 seconds */
: 	timeout.tv_usec = 500;	/* 500 microseconds */
                          ^^^
I agree entirely with Terry and DP Suresh about all that has been said
but would like to point out in the code fragment above, that .tv_usec
is being set in this example to 5/10,000ths of a second rather than
..5 seconds as alleged.  It would need to be: timeout.tv_usec = 500000;
to achieve the goals as stated in the comment preceding this fragment.

Some systems support a reasonable ``cbreak'' mode that in effect returns
control to a process as each character is typed.  Depending on the needs
as speculated on by Terry that you have in mind, this mode may be all
that you need.  Your 'man' pages should have a discussion about the
kinds of serial support you have.