Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jun 1995 21:43:44 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        ache@astral.msk.su, bde@zeta.org.au, cvs-sys@freefall.cdrom.com, davidg@freefall.cdrom.com
Subject:   Re: cvs commit: src/sys/kern tty.c
Message-ID:  <199506051143.VAA28604@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>Your fix is questionable and need discussion: I dislike your idea
>of having two separate timeouts for modem hang, I prefer
>one big timeout for all modem hangs on writes. Modem hang is
>one state and we don't need two or more timeouts to handle
>it differently on exit and on writes, it is unneded complexity.

We need separate timeouts to minimize breaking of standards.  POSIX
specifies that write() to any devices that supports blocking writes
shall block if O_NONBLOCK is clear.  We are already beyond the standard
from supporting CRTSCTS (which allows ininite blockage) and drainwait
(which allows canceling the infinite blockage).  I want writes to block
forever and exits not to block forever.  Timeouts are a reasonable way
of controlling the behaviour.

>I agree with you that right now not all places checked and left
>this work until after release time.

>I agree with you that non-blocking writes can't return EWOULDBLOCK,
>as correct fix I suggest to change EWOULDBLOCK to EIO.

>Right after tsleep:
>	if (error == EWOULDBLOCK)
>		error = EIO;

>Bruce and David, please review this thing for commit
>as fixing wrong error return code of write.

It's too close to release to decide.  You've been testing long enough
with error EWOULDBLOCK to notice serious problems with it.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506051143.VAA28604>