diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-09-30 20:20:22 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-09-30 20:20:22 +0000 |
commit | 0341f71df178fd346332ced28efb677a6ef39414 (patch) | |
tree | 44cc85d6d7a465b4410e0fa06f9f5a1b21bc40b6 /sys/kern/tty.c | |
parent | e70c6b99c8b8b510eaef402242dd8cb86e300c6f (diff) | |
download | FreeBSD-src-0341f71df178fd346332ced28efb677a6ef39414.zip FreeBSD-src-0341f71df178fd346332ced28efb677a6ef39414.tar.gz |
First half of implementation of ksiginfo, signal queues, and such. This
gets signals operating based on a TailQ, and is good enough to run X11,
GNOME, and do job control. There are some intricate parts which could be
more refined to match the sigset_t versions, but those require further
evaluation of directions in which our signal system can expand and contract
to fit our needs.
After this has been in the tree for a while, I will make in kernel API
changes, most notably to trapsignal(9) and sendsig(9), to use ksiginfo
more robustly, such that we can actually pass information with our
(queued) signals to the userland. That will also result in using a
struct ksiginfo pointer, rather than a signal number, in a lot of
kern_sig.c, to refer to an individual pending signal queue member, but
right now there is no defined behaviour for such.
CODAFS is unfinished in this regard because the logic is unclear in
some places.
Sponsored by: New Gold Technology
Reviewed by: bde, tjr, jake [an older version, logic similar]
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index c075a47..590e8de 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -102,6 +102,7 @@ #include <sys/malloc.h> #include <sys/filedesc.h> #include <sys/sysctl.h> +#include <sys/ksiginfo.h> #include <vm/vm.h> #include <vm/pmap.h> @@ -1841,21 +1842,24 @@ int ttycheckoutq(struct tty *tp, int wait) { int hiwat, s; - sigset_t oldmask; + sigset_t oldmask, newmask; hiwat = tp->t_ohiwat; SIGEMPTYSET(oldmask); s = spltty(); if (wait) - oldmask = curproc->p_siglist; + ksiginfo_to_sigset_t(curproc, &oldmask); if (tp->t_outq.c_cc > hiwat + OBUFSIZ + 100) while (tp->t_outq.c_cc > hiwat) { ttstart(tp); if (tp->t_outq.c_cc <= hiwat) break; - if (!(wait && SIGSETEQ(curproc->p_siglist, oldmask))) { - splx(s); - return (0); + if (!wait) { + ksiginfo_to_sigset_t(curproc, &newmask); + if (SIGSETEQ(newmask, oldmask)) { + splx(s); + return (0); + } } SET(tp->t_state, TS_SO_OLOWAT); tsleep(TSA_OLOWAT(tp), PZERO - 1, "ttoutq", hz); |