Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!mtuxo!mtunh!mtung!mtunf!ariel!vax135!petsd!pesnta!amd!amdcad!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.micro.att Subject: Re: ATT 3b2 (SVR2) questions Message-ID: <2471@sun.uucp> Date: Tue, 23-Jul-85 07:04:33 EDT Article-I.D.: sun.2471 Posted: Tue Jul 23 07:04:33 1985 Date-Received: Thu, 25-Jul-85 08:05:28 EDT References: <746@wlcrjs.UUCP>, <373@cuae2.UUCP> <513@bu-cs.UUCP> Organization: Sun Microsystems, Inc. Lines: 43 > "A read will not be satisfied until at least MIN characters have been > received or the timeout value has expired...The MIN and TIME values are > in the position for the EOF and EOL characters respectively. The time value > represents tenths of seconds." > > Not too clear is it: Does a zero value in TIME produce non-blocking I/O > (timeouts occur immediately?) or should that be -1? or does that end up > to be 255 on most machines and then the read times out in 25.5 seconds? The only real explanation of what (V)MIN and (V)TIME do that tells *everything* is in the System V Interface Definition; it gets a subsection to itself which is 5 paragraphs long. I think the System III rules were quite fine, thank you - they took less space to explain, and the only thing they didn't do is provide a way to do read timeouts, but that's what "alarm" is for. Basically, if MIN is non-zero: If TIME is zero, there is no timeout of any sort; the read doesn't complete until (int)c_cc[VMIN] characters have come in. If time is non-zero, the read completes if (int)c_cc[VMIN] characters have come in or *at least one* character has come in and (int)c_cc[VTIME] 10ths of a second have elapsed since the first character came in. If MIN is zero: If TIME is zero, you get a no-delay read (that's what the S5ID says, at least; I haven't checked the code). If TIME is non-zero, the read completes as soon as a character comes in or (int)c_cc[VMIN] 10ths of a second have elapsed since the "read" system call was first made. > And I won't even mention how bad an idea it was to put termio into the > administrator's manual (hasn't anyone at ATTIS heard of students?) AMEN. WAKE UP, SOMEBODY, AND PUT THAT SECTION IN THE *P*R*O*G*R*A*M*M*E*R*S* MANUAL WHERE IT BELONGS! Administrators don't care how to write screen editors. Programmers do. Guy Harris