home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!modcomp!jgreen
- From: jgreen@modcomp.uucp (Joe Green)
- Subject: Re: Termios question: Semantics of VMIN/VTIME on Linux/SunOS ?
- Organization: MODCOMP, an AEG company
- Date: Wed, 22 Jul 1992 13:20:03 GMT
- Message-ID: <jgreen.711811203@rss>
- 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>
- Sender: news@modcomp.uucp (Mr. News)
- Lines: 60
-
- torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) writes:
- >As I already mentioned, I'm very open to changing the behaviour: but I
- >need to have actual "chapter and verse" from the posix standard before I
- >start changing things. The current behaviour works with a lot of
- >programs, and conforms to the only docs I have, so I really need some
- >strong arguments to change it.
-
- It looks like the current behavior is correct. In fact, the description
- you gave is in almost the same format as the POSIX spec--is the Sun man
- page formatted this way?
-
- The actual description from ISO/IEC 9945-1:1990 (also IEEE Std 1003.1-1990)
- is:
-
- --------------------------------------------------------------------------
- 7.1.1.7.1 Case A: MIN > 0, TIME > 0
-
- In this case TIME serves as an interbyte timer and is activated after
- the first byte is received. Since it is an interbyte timer, it is reset
- after a byte is received. The interaction between MIN and TIME is as
- follows: as soon as one byte is received, the interbyte timer is
- started. If MIN bytes are received before the interbyte timer expires
- (remember that the timer is reset upon receipt of each byte), the read
- is satisfied. If the timer expires before MIN bytes are received, the
- characters received to that point are returned to the user. Note that
- if TIME expires, at least one byte shall be returned because the timer
- would not have been enabled unless a byte was received...
-
- 7.1.1.7.2 Case B: MIN > 0, TIME = 0
-
- In this case, since the value of TIME is zero, the timer plays no role
- and only MIN is significant. A pending read is not satisfied until MIN
- bytes are received (i.e., the pending read shall block until MIN bytes
- are received) ...
-
- 7.1.1.7.3 Case C: MIN = 0, TIME > 0
-
- In this case since MIN = 0, TIME no longer represents an interbyte
- timer. It now serves as a read timer that is activated as soon as the
- read() function is processed. A read is satisfied as soon as a single
- byte is received or the read timer expires. Note that in this case if
- the timer expires, no bytes shall be returned...
-
- 7.1.1.7.4 Case D: MIN = 0, TIME = 0
-
- The minimum of either the number of bytes requested or the number of
- bytes currently available shall be returned without waiting for more
- bytes to be input...
- --------------------------------------------------------------------------
-
- The one question I have is regarding returning when the number of bytes
- requested has been satisfied (the "buffer size" is reached). Only "Case D"
- is explicitly required to do this. Should cases "A" and "B" wait until MIN
- is reached, even if fewer bytes have been requested? (I think this is
- probably an unusual situation.)
-
- --
- Joe Green jgreen@modcomp.UUCP
- Modular Computer Systems, Inc. modcomp!jgreen@uunet.UU.NET
- uunet!modcomp!jgreen
-