Re: termios VMIN VTIME

2014-04-04 Thread trifle menot
On 4/4/14, John D. Verne wrote: > The meaning of VMIN, VTIME change depending on if they are non-zero or not. > VTIME is not always an inter-character timer I know. > but they way you are using it, it is. Yes, POSIX case A: MIN>0 and TIME>0. Case B, MIN>0 and TIME=0, is useless if MIN > 1. A

Re: termios VMIN VTIME

2014-04-04 Thread trifle menot
On 4/4/14, Steve Williams wrote: >> The POSIX writers erred by making VTIME an interbyte timer. > What real life problem are you trying to solve? Theory of operation. > Why do you need to have < 250 bytes in the returned buffer? Same principle as a 16550 UART FIFO timeout. > Is it importa

Re: termios VMIN VTIME

2014-04-04 Thread trifle menot
On 4/4/14, Philip Guenther wrote: > The original poster has already be pointed to the POSIX spec and had > it explained that OpenBSD won't be changing this behavior as long as > it's in POSIX. I didn't ask OpenBSD for code. OpenBSD management seems defensive, perhaps paranoid, that everyone is a

Re: termios VMIN VTIME

2014-04-03 Thread Philip Guenther
The original poster has already be pointed to the POSIX spec and had it explained that OpenBSD won't be changing this behavior as long as it's in POSIX. At this point, there's nothing OpenBSD-related left: *productive* discussion of changing the behavior should be on the austin-group (i.e, POSIX)

Re: termios VMIN VTIME

2014-04-03 Thread Steve Williams
On 4/3/2014 1:40 AM, trifle menot wrote: On 4/2/14, Mihai Popescu wrote: Dude, what the hell are you trying to do? Just explain in plain words here. I am interested in working with rs232 and i wasted my time reading and wainting for your damn problem. a) Set raw mode. b) Set VMIN = 250 and VT

Re: termios VMIN VTIME

2014-04-03 Thread John D. Verne
On Apr 3, 2014, at 3:40, trifle menot wrote: > On 4/2/14, Mihai Popescu wrote: > >> Dude, what the hell are you trying to do? Just explain in plain words here. >> I am interested in working with rs232 >> and i wasted my time reading and wainting for your damn problem. > [...] > > Now suppose

Re: termios VMIN VTIME

2014-04-03 Thread trifle menot
On 4/2/14, Mihai Popescu wrote: > Dude, what the hell are you trying to do? Just explain in plain words here. > I am interested in working with rs232 > and i wasted my time reading and wainting for your damn problem. a) Set raw mode. b) Set VMIN = 250 and VTIME = 1. c) Set port speed to 115200.

Re: termios VMIN VTIME

2014-04-02 Thread Mihai Popescu
Dude, what the hell are you trying to do? Just explain in plain words here. I am interested in working with rs232 and i wasted my time reading and wainting for your damn problem.

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Tue, Apr 1, 2014 at 3:37 AM, Philip Guenther wrote: > you stated that my description was wrong and not what you were > looking for on at least one point of behavior. If by that, you mean this: >>If no data is received, it should still return after 0.1s. > No, read() should not return 10

Re: termios VMIN VTIME

2014-03-31 Thread Philip Guenther
On Mon, Mar 31, 2014 at 8:14 PM, trifle menot wrote: > On Tue, Apr 1, 2014 at 3:00 AM, Philip Guenther wrote: > >>> Show me where POSIX says VTIME must be an interbyte timer. >> >> http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap11.html#tag_11_01_07 > > I missed that during my sea

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Tue, Apr 1, 2014 at 3:00 AM, Philip Guenther wrote: >> Show me where POSIX says VTIME must be an interbyte timer. > > http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap11.html#tag_11_01_07 I missed that during my search. POSIX says so. OK. > And you *still* haven't provided a

Re: termios VMIN VTIME

2014-03-31 Thread Philip Guenther
On Mon, Mar 31, 2014 at 7:52 PM, trifle menot wrote: > On Tue, Apr 1, 2014 at 2:39 AM, Philip Guenther wrote: > >> Your question is "why haven't OS developers done what I think is >> right?" >> The answer to that question is "because the POSIX standard says we >> shouldn't, and is quite clear abo

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Tue, Apr 1, 2014 at 2:12 AM, Theo de Raadt wrote: > your cute little nickname should have hinted that you don't have a > mature understanding of the world. Thanks for the psychoanalysis, doctor. Is your advice free, or do you charge for it?

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Tue, Apr 1, 2014 at 2:39 AM, Philip Guenther wrote: > Your question is "why haven't OS developers done what I think is > right?" > The answer to that question is "because the POSIX standard says we > shouldn't, and is quite clear about this." Show me where POSIX says VTIME must be an interbyt

Re: termios VMIN VTIME

2014-03-31 Thread Philip Guenther
On Mon, Mar 31, 2014 at 6:13 PM, trifle menot wrote: > On Tue, Apr 1, 2014 at 12:23 AM, Philip Guenther wrote: >> I *sounds* like the problem you're trying to solve** is some thing like >> I want to efficiently read data from a serial line, returning >> whenever at least >> 250 bytes ar

Re: termios VMIN VTIME

2014-03-31 Thread Theo de Raadt
> > I suspect they all follow an official specification. Careful test code > > compared to the specification would decide. > > > It might show them all to be right, leaving the obvious conclusion about > > who is wrong. > > To test it, I used two Perl scripts, sender and receiver, a two port > s

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Tue, Apr 1, 2014 at 1:39 AM, Theo de Raadt wrote: > I suspect they all follow an official specification. Careful test code > compared to the specification would decide. > It might show them all to be right, leaving the obvious conclusion about > who is wrong. To test it, I used two Perl scr

Re: termios VMIN VTIME

2014-03-31 Thread Theo de Raadt
>On Tue, Apr 1, 2014 at 1:18 AM, Theo de Raadt wrote: > >> Are you saying OpenBSD does it wrong, or that all the operating systems >> do it wrong? > >I tested Linux and OpenBSD. Both wrong. > >The termios man pages from NetBSD and FreeBSD are identical to >OpenBSD. So I expect they're wrong too.

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Tue, Apr 1, 2014 at 1:18 AM, Theo de Raadt wrote: > Are you saying OpenBSD does it wrong, or that all the operating systems > do it wrong? I tested Linux and OpenBSD. Both wrong. The termios man pages from NetBSD and FreeBSD are identical to OpenBSD. So I expect they're wrong too.

Re: termios VMIN VTIME

2014-03-31 Thread Theo de Raadt
> > I *sounds* like the problem you're trying to solve** is some thing like > > I want to efficiently read data from a serial line, returning > > whenever at least > > 250 bytes are available or when more then 0.1s has passed. > > If no data is received, it should still return after

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Tue, Apr 1, 2014 at 12:23 AM, Philip Guenther wrote: > I *sounds* like the problem you're trying to solve** is some thing like > I want to efficiently read data from a serial line, returning > whenever at least > 250 bytes are available or when more then 0.1s has passed. > If no

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Mon, Mar 31, 2014 at 11:52 PM, Theo de Raadt wrote: > In the future, please submit concise reports rather than a link to > something vague which is part of a long conversation on some site out > there. It will indicate you are serious. I may do that. > Perhaps VMIN and VTIME were designed b

Re: termios VMIN VTIME

2014-03-31 Thread Philip Guenther
On Mon, Mar 31, 2014 at 5:01 PM, trifle menot wrote: > On Mon, Mar 31, 2014 at 11:17 PM, Philip Guenther wrote: > >> You haven't convinced me the design needs fixing, nor have you proved >> that the goal that you (sorta) describe can't already be solved with >> the existing APIs. > >> "What probl

Re: termios VMIN VTIME

2014-03-31 Thread trifle menot
On Mon, Mar 31, 2014 at 11:17 PM, Philip Guenther wrote: > You haven't convinced me the design needs fixing, nor have you proved > that the goal that you (sorta) describe can't already be solved with > the existing APIs. > "What problem are you trying to solve?" a) set VMIN = 250; don't read()

Re: termios VMIN VTIME

2014-03-31 Thread Theo de Raadt
> On stackoverflow I said: > > http://stackoverflow.com/questions/20154157/termios-vmin-vtime-and-blocking-non-blocking-read-operations/22771908#22771908 > > Any thoughts on fixing the design, in favor or opposed? In the future, please submit concise reports rather than a li

Re: termios VMIN VTIME

2014-03-31 Thread Philip Guenther
On Mon, Mar 31, 2014 at 2:41 PM, trifle menot wrote: > On stackoverflow I said: > > http://stackoverflow.com/questions/20154157/termios-vmin-vtime-and-blocking-non-blocking-read-operations/22771908#22771908 > > Any thoughts on fixing the design, in favor or opposed? You haven

termios VMIN VTIME

2014-03-31 Thread trifle menot
On stackoverflow I said: http://stackoverflow.com/questions/20154157/termios-vmin-vtime-and-blocking-non-blocking-read-operations/22771908#22771908 Any thoughts on fixing the design, in favor or opposed?