Re: [PATCH] Characters discarded on large writes to pty master

2012-12-29 Thread Mark Shroyer
On Thu, Dec 27, 2012 at 03:03:22PM -0500, Todd C. Miller wrote: Alternately, we can simply convert the while loop to a do-while. As far as I can tell that loop is always entered with either uio-uio_resid 0 or cc 0. - todd That works fine here, for what it's worth... (though I don't know

Re: [PATCH] Characters discarded on large writes to pty master

2012-12-27 Thread Todd C. Miller
Alternately, we can simply convert the while loop to a do-while. As far as I can tell that loop is always entered with either uio-uio_resid 0 or cc 0. - todd Index: sys/kern/tty_pty.c === RCS file: /cvs/src/sys/kern/tty_pty.c,v

[PATCH] Characters discarded on large writes to pty master

2012-12-25 Thread Mark Shroyer
I've encountered characters being lost while writing large buffers to a pseudoterminal master on OpenBSD 5.2. The linked program ptycheck.c exercises this behavior on 5.2 i386/amd64 (as well as 4.7 and 4.8 i386): https://gist.github.com/4377173 Briefly, the program opens a pty pair and