Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Oct 1995 17:33:46 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, davidg@Root.COM
Cc:        CVS-commiters@freefall.freebsd.org, cvs-sys@freefall.freebsd.org
Subject:   Re: cvs commit: src/sys/kern tty_pty.c
Message-ID:  <199510260733.RAA12694@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>   I've been testing the changes here. These seem to fix the data loss
>>problems, but a cntrl-C still causes everything to wedge until I kill the
>>'od' in another window:

>   I forgot to mention that the old code did this, too, so this isn't a new
>problem.

>-DG

>>root       179   112   196  508 ptcout S     p0  11:54PM    0:01.71 od -v /dev/zero
>>root       180   112   184   68 ttywai SE+   p0  11:54PM    0:00.54 cat /dev/ttyp8

[This is for od -v /dev/zero >/dev/ptyp8 & cat /dev/ttyp8

I didn't try to fix this.  There may be no correct fix.  It wouldn't be
correct to abort any current i/o and return EOF/EIO for all future i/o
on the master pty.  Returning EOF for read() would be equivalent to not
waiting in ptsclose() and returning EIO for write() would break output
intended for other processes.  There is interesting behaviour if another
process reads from the slave:

	cat /dev/ttyp8

The od resumes output and the new cat reads it, but this has no effect on
the wedged cat.  The wedged cat is in last-close() while another process
has the device open!  Bad things might happen when the last-close()
completes.  It is probably a bug to allow opens of devices being
last-close()d.

Bruce



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