home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / linux / 6417 < prev    next >
Encoding:
Text File  |  1992-07-22  |  3.2 KB  |  72 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!modcomp!jgreen
  3. From: jgreen@modcomp.uucp (Joe Green)
  4. Subject: Re: Termios question: Semantics of VMIN/VTIME on Linux/SunOS ?
  5. Organization: MODCOMP, an AEG company
  6. Date: Wed, 22 Jul 1992 13:20:03 GMT
  7. Message-ID: <jgreen.711811203@rss>
  8. References: <arumble.711530378@extro.ucc.su.OZ.AU> <1992Jul19.201601.13942@klaava.Helsinki.FI> <arumble.711729320@extro.ucc.su.OZ.AU> <1992Jul21.183946.9138@klaava.Helsinki.FI>
  9. Sender: news@modcomp.uucp (Mr. News)
  10. Lines: 60
  11.  
  12. torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) writes:
  13. >As I already mentioned, I'm very open to changing the behaviour: but I
  14. >need to have actual "chapter and verse" from the posix standard before I
  15. >start changing things.  The current behaviour works with a lot of
  16. >programs, and conforms to the only docs I have, so I really need some
  17. >strong arguments to change it. 
  18.  
  19. It looks like the current behavior is correct.  In fact, the description
  20. you gave is in almost the same format as the POSIX spec--is the Sun man
  21. page formatted this way?
  22.  
  23. The actual description from ISO/IEC 9945-1:1990 (also IEEE Std 1003.1-1990)
  24. is:
  25.  
  26. --------------------------------------------------------------------------
  27. 7.1.1.7.1  Case A: MIN > 0, TIME > 0
  28.  
  29. In this case TIME serves as an interbyte timer and is activated after
  30. the first byte is received.  Since it is an interbyte timer, it is reset
  31. after a byte is received.  The interaction between MIN and TIME is as
  32. follows:  as soon as one byte is received, the interbyte timer is
  33. started.  If MIN bytes are received before the interbyte timer expires
  34. (remember that the timer is reset upon receipt of each byte), the read
  35. is satisfied.  If the timer expires before MIN bytes are received, the
  36. characters received to that point are returned to the user.  Note that
  37. if TIME expires, at least one byte shall be returned because the timer
  38. would not have been enabled unless a byte was received...
  39.  
  40. 7.1.1.7.2  Case B: MIN > 0, TIME = 0
  41.  
  42. In this case, since the value of TIME is zero, the timer plays no role
  43. and only MIN is significant.  A pending read is not satisfied until MIN
  44. bytes are received (i.e., the pending read shall block until MIN bytes
  45. are received) ...
  46.  
  47. 7.1.1.7.3  Case C: MIN = 0, TIME > 0
  48.  
  49. In this case since MIN = 0, TIME no longer represents an interbyte
  50. timer.  It now serves as a read timer that is activated as soon as the
  51. read() function is processed.  A read is satisfied as soon as a single
  52. byte is received or the read timer expires.  Note that in this case if
  53. the timer expires, no bytes shall be returned...
  54.  
  55. 7.1.1.7.4  Case D: MIN = 0, TIME = 0
  56.  
  57. The minimum of either the number of bytes requested or the number of
  58. bytes currently available shall be returned without waiting for more
  59. bytes to be input...
  60. --------------------------------------------------------------------------
  61.  
  62. The one question I have is regarding returning when the number of bytes
  63. requested has been satisfied (the "buffer size" is reached).  Only "Case D"
  64. is explicitly required to do this.  Should cases "A" and "B" wait until MIN
  65. is reached, even if fewer bytes have been requested?  (I think this is
  66. probably an unusual situation.)
  67.  
  68. --
  69. Joe Green                jgreen@modcomp.UUCP
  70. Modular Computer Systems, Inc.        modcomp!jgreen@uunet.UU.NET
  71.                     uunet!modcomp!jgreen
  72.