Add a case so that FIONREAD on the master side of a pty returns the size of the output queue (that is, the data coming from the program on the slave side) rather than falling through to ttioctl which returns the size of the input queue (the amount written to the master).
Add a case so that FIONREAD on the master side of a pty returns the size
of the output queue (that is, the data coming from the program on the
slave side) rather than falling through to ttioctl which returns the
size of the input queue (the amount written to the master).

ok deraadt

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars