[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BIOSBUF problems, and another diff
hello
i'm using BIOSBUF=n since some problems with GF*bugsic binaries mixing
GEM calls and console Bconout so this did not hit me yet but, :) when
do_bconin calls tty_getchar and that gets a SIGTTIN it will go to
sleep... and whatever device driver you may install and dup2 a bios fd
could block for other reasons too, or maybe just overflow the user
process supervisor stack when that is smaller than curproc->sysstack.
the buffered Bconout stuff itself should be safe (except for those
broken `GEM' programs etc but thats their own fault), its just the
Bconin and Bco(n)stat shortcuts i'm worried about... and i don't know
if the overhead of the extra checks and ioctl FIONREAD is really smaller
than the saved build_context and movel.s?
what do you think?
something different, this fixes tty selects when another process sleeps
in a VTIME read: (have to wake select_coll)
Index: tty.c
@@ -131,9 +131,9 @@
if (tty->vtime && (mode & (T_RAW|T_CBREAK)) &&
!(f->flags & (O_NDELAY|O_HEAD)) &&
(!(tty->state & TS_ESC) || !(rdmode & ESCSEQ))) {
- long bytes = 0;
+ long r, bytes = 0;
- if ((*f->dev->select)(f, (long)curproc, O_RDONLY) != 1) {
+ if ((r = (*f->dev->select)(f, (long)curproc, O_RDONLY)) != 1) {
TIMEOUT *t;
curproc->wait_cond = (long)wakeselect; /* flag */
@@ -150,7 +150,11 @@
canceltimeout(t);
}
(void)(*f->dev->ioctl)(f, FIONREAD, &bytes);
- (*f->dev->unselect)(f, (long)curproc, O_RDONLY);
+ if (!r) {
+ extern short select_coll; /* in dosfile.c */
+ (*f->dev->unselect)(f, (long)curproc, O_RDONLY);
+ wake(SELECT_Q, (long)&select_coll);
+ }
if (!bytes)
return bytes_read;
}
cheers
Juergen
--
J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
...ohne Gewehr
PGP public key fingerprint = 8A 18 58 54 03 7B FC 12 1F 8B 63 C7 19 27 CF DA