home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / bsd / 11183 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  1.4 KB

  1. Xref: sparky comp.unix.bsd:11183 comp.lang.c:19605
  2. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!swrinde!emory!kd4nc!n4hgf!wa4cyb!jmd
  3. From: jmd@wa4cyb.UUCP (John Dashner)
  4. Newsgroups: comp.unix.bsd,comp.lang.c
  5. Subject: Re: a unix terminal question
  6. Message-ID: <4@wa4cyb.UUCP>
  7. Date: 12 Jan 93 12:30:25 GMT
  8. References: <uonuhjc@zola.esd.sgi.com>
  9. Followup-To: comp.unix.bsd,comp.lang.c
  10. Organization: John Dashner & Assoc.
  11. Lines: 20
  12. X-Newsreader: TIN [version 1.1 PL7]
  13.  
  14. D.P. Suresh (dps@delhi.esd.sgi.com) wrote:
  15.  
  16.     [stuff deleted from terry@weber.edu]
  17.  
  18. :     /* We shall specify 0.5 sec as the waiting time */
  19. :     timeout.tv_sec  = 0;    /*   0 seconds */
  20. :     timeout.tv_usec = 500;    /* 500 microseconds */
  21.                           ^^^
  22. I agree entirely with Terry and DP Suresh about all that has been said
  23. but would like to point out in the code fragment above, that .tv_usec
  24. is being set in this example to 5/10,000ths of a second rather than
  25. .5 seconds as alleged.  It would need to be: timeout.tv_usec = 500000;
  26. to achieve the goals as stated in the comment preceding this fragment.
  27.  
  28. Some systems support a reasonable ``cbreak'' mode that in effect returns
  29. control to a process as each character is typed.  Depending on the needs
  30. as speculated on by Terry that you have in mind, this mode may be all
  31. that you need.  Your 'man' pages should have a discussion about the
  32. kinds of serial support you have.
  33.