diff options
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r-- | sys/kern/sys_pipe.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 29e1e97a7aad..9b60e26c2543 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: sys_pipe.c,v 1.45 1998/11/11 10:03:55 truckman Exp $ + * $Id: sys_pipe.c,v 1.42 1998/06/07 17:11:39 dfr Exp $ */ /* @@ -256,6 +256,7 @@ pipeinit(cpipe) cpipe->pipe_atime = cpipe->pipe_ctime; cpipe->pipe_mtime = cpipe->pipe_ctime; bzero(&cpipe->pipe_sel, sizeof cpipe->pipe_sel); + cpipe->pipe_pgid = NO_PID; #ifndef PIPE_NODIRECT /* @@ -308,12 +309,18 @@ static __inline void pipeselwakeup(cpipe) struct pipe *cpipe; { + struct proc *p; + if (cpipe->pipe_state & PIPE_SEL) { cpipe->pipe_state &= ~PIPE_SEL; selwakeup(&cpipe->pipe_sel); } - if ((cpipe->pipe_state & PIPE_ASYNC) && cpipe->pipe_sigio) - pgsigio(cpipe->pipe_sigio, SIGIO, 0); + if (cpipe->pipe_state & PIPE_ASYNC) { + if (cpipe->pipe_pgid < 0) + gsignal(-cpipe->pipe_pgid, SIGIO); + else if ((p = pfind(cpipe->pipe_pgid)) != NULL) + psignal(p, SIGIO); + } } /* ARGSUSED */ @@ -495,7 +502,7 @@ pipe_build_write_buffer(wpipe, uio) if (!paddr) { int j; for(j=0;j<i;j++) - vm_page_unwire(wpipe->pipe_map.ms[j], 1); + vm_page_unwire(wpipe->pipe_map.ms[j]); return EFAULT; } @@ -559,7 +566,7 @@ struct pipe *wpipe; } } for (i=0;i<wpipe->pipe_map.npages;i++) - vm_page_unwire(wpipe->pipe_map.ms[i], 1); + vm_page_unwire(wpipe->pipe_map.ms[i]); } /* @@ -946,20 +953,12 @@ pipe_ioctl(fp, cmd, data, p) *(int *)data = mpipe->pipe_buffer.cnt; return (0); - case FIOSETOWN: - return (fsetown(*(int *)data, &mpipe->pipe_sigio)); - - case FIOGETOWN: - *(int *)data = fgetown(mpipe->pipe_sigio); - return (0); - - /* This is deprecated, FIOSETOWN should be used instead. */ case TIOCSPGRP: - return (fsetown(-(*(int *)data), &mpipe->pipe_sigio)); + mpipe->pipe_pgid = *(int *)data; + return (0); - /* This is deprecated, FIOGETOWN should be used instead. */ case TIOCGPGRP: - *(int *)data = -fgetown(mpipe->pipe_sigio); + *(int *)data = mpipe->pipe_pgid; return (0); } @@ -1039,7 +1038,6 @@ pipe_close(fp, p) { struct pipe *cpipe = (struct pipe *)fp->f_data; - funsetown(cpipe->pipe_sigio); pipeclose(cpipe); fp->f_data = NULL; return 0; |