problems with sigset, sighold and sigrelse.
JPAYNE at BBNG.ARPA
JPAYNE at BBNG.ARPA
Sun Aug 7 23:43:00 AEST 1983
If you look at the code in the tty driver, you will see that ntyinput
calls flushtty(tp, FREAD | FWRITE) when the character typed is the
interrupt or quit character, and THEN it calls gsignal who calls
psignal who checks to see if the signal is held ...
This is exactly the problem I described a while ago, but one that
nobody seemed to have a solution for. It is not a coincidence that
write says that it successfully wrote 100 characters. ntwrite tries
to optimize its output by moving characters from u.u_base to an
internal buffer of size 100 (note the 100), and then, if all the
characters are simple printable characters, ntwrite does 1
b_to_q(its_buffer, OBUFSIZE, tp->t_outq). There are two problems.
One is ntyinput calls flushtty (maybe wflushtty in certain cases would
be better), and the other is a little more complicated. ntwrite calls
iomove to move the data from u.u_base to ntwrite's internal buffer.
iomove decrements u.u_count, so upon return from iomove, however many
bytes requested from iomove are logically written.
Actually ntwrite calls
b_to_q(its_buffer, UP_TO_LAST_PRINTABLE_CHARACTER, tp->t_outq),
so if UP_TO_LAST_PRINTABLE_CHARACTER happens to be 47, then 47 characters
stand a good chance of actually being sent to the terminal.
Do you believe all this?
More information about the Comp.unix.wizards
mailing list