]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/tty_pty.c
xnu-517.9.5.tar.gz
[apple/xnu.git] / bsd / kern / tty_pty.c
index f4eb1b31b908b4506549e438849c29cd4ee3d0b6..7003a420244d32c5c35d14080aadd0a64979d9a8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -71,6 +71,7 @@
 #include <sys/uio.h>
 #include <sys/kernel.h>
 #include <sys/vnode.h>
+#include <sys/user.h>
 #include <sys/signalvar.h>
 
 #ifndef NeXT
 #include <machine/spl.h>
 
 #define FREE_BSDSTATIC __private_extern__
-#define d_open_t        open_close_fcn_t
-#define d_close_t       open_close_fcn_t
 #define d_devtotty_t    struct tty **
-#define d_ioctl_t       ioctl_fcn_t
-#define d_read_t        read_write_fcn_t 
-#define d_write_t       read_write_fcn_t
-#define d_select_t      select_fcn_t
+
+#ifdef d_stop_t
+#undef d_stop_t
+#endif
 typedef void d_stop_t  __P((struct tty *tp, int rw));
+
 #endif /* NeXT */
 
 #ifdef notyet
@@ -234,7 +234,7 @@ int pty_init(int n_ptys)
  done:
     return (0);
 }
-#endif DEVFS
+#endif /* DEVFS */
 
 /*ARGSUSED*/
 FREE_BSDSTATIC int
@@ -316,12 +316,14 @@ ptsread(dev, uio, flag)
        register struct tty *tp = pt_tty[minor(dev)];
        register struct pt_ioctl *pti = &pt_ioctl[minor(dev)];
        int error = 0;
+       struct uthread *ut;
 
+       ut = (struct uthread *)get_bsdthread_info(current_act());
 again:
        if (pti->pt_flags & PF_REMOTE) {
                while (isbackground(p, tp)) {
                        if ((p->p_sigignore & sigmask(SIGTTIN)) ||
-                           (p->p_sigmask & sigmask(SIGTTIN)) ||
+                           (ut->uu_sigmask & sigmask(SIGTTIN)) ||
                            p->p_pgrp->pg_jobc == 0 ||
                            p->p_flag & P_PPWAIT)
                                return (EIO);
@@ -558,9 +560,10 @@ ptsstop(tp, flush)
 }
 
 FREE_BSDSTATIC int
-ptcselect(dev, rw, p)
+ptcselect(dev, rw, wql, p)
        dev_t dev;
        int rw;
+       void * wql;
        struct proc *p;
 {
        register struct tty *tp = pt_tty[minor(dev)];
@@ -589,7 +592,7 @@ ptcselect(dev, rw, p)
                    ((pti->pt_flags&PF_PKT && pti->pt_send) ||
                     (pti->pt_flags&PF_UCNTL && pti->pt_ucntl)))
                        return (1);
-               selrecord(p, &pti->pt_selr);
+               selrecord(p, &pti->pt_selr, wql);
                break;
 
 
@@ -605,7 +608,7 @@ ptcselect(dev, rw, p)
                                    return (1);
                        }
                }
-               selrecord(p, &pti->pt_selw);
+               selrecord(p, &pti->pt_selw, wql);
                break;
 
        }