🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.usg
Article #37

Resetting VMIN on active line doesn't work.

#37
From: Kenneth Almquist
Date: Sat, 07 Jul 1984 23:26
22 lines
1601 bytes
I have a pair of programs that talk over an asynchronous link.  The
protocal requires a routine to read n bytes off the link.  Since I
didn't want to read a character at a time, I wrote code that looked
like:
	ttymodes.c_cc[VMIN] = n;
	ioctl(fd, TCSETA, &ttymodes);
	count = read(fd, buf, n);

The problem with this code is that resetting VMIN does not affect the
value of delct.  Thus if n characters have already been received when
this code is executed, the read will roadblock waiting for additional
characters unless delct is already set.  It will not be if the previous
value of VMIN was greater than n.

I haven't tried to fix this yet.  It is possible to work around it by
setting VMIN to a large value and VTIME to 1.  Unfortunately that adds
a delay of about 0.15 second between the time the end of a message is
received and the time the message is made available to a program.  My
belief is that I should be able to set VMIN to a large value, and then
have read return when the number of characters requested by the read
is available.
				Kenneth Almquist
Technical Details
Message-ID: <669@hou3c.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!hou3c!ka

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site hou3c.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!hou3c!ka
From: ka@hou3c.UUCP (Kenneth Almquist)
Newsgroups: net.bugs.usg
Subject: Resetting VMIN on active line doesn't work.
Message-ID: <669@hou3c.UUCP>
Date: Sat, 7-Jul-84 19:26:19 EDT
Article-I.D.: hou3c.669
Posted: Sat Jul  7 19:26:19 1984
Date-Received: Sun, 8-Jul-84 00:32:11 EDT
Distribution: net
Organization: Bell Labs, Holmdel, NJ
Lines: 22