Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys - pass signo to fownsignal [ok by jd]



details:   https://anonhg.NetBSD.org/src/rev/1b7cf1d815a8
branches:  trunk
changeset: 552248:1b7cf1d815a8
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Sep 22 12:59:55 2003 +0000

description:
- pass signo to fownsignal [ok by jd]
- make urg signal handling use fownsignal
- remove out of band detection in sowakeup

diffstat:

 sys/kern/kern_descrip.c |   8 ++++----
 sys/kern/subr_log.c     |   6 +++---
 sys/kern/sys_pipe.c     |   6 +++---
 sys/kern/uipc_socket.c  |  16 +++-------------
 sys/kern/uipc_socket2.c |  21 +++++++--------------
 sys/net/bpf.c           |   6 +++---
 sys/net/if_tun.c        |   9 +++++----
 sys/sys/file.h          |   4 ++--
 8 files changed, 30 insertions(+), 46 deletions(-)

diffs (249 lines):

diff -r 6dca4d45ee82 -r 1b7cf1d815a8 sys/kern/kern_descrip.c
--- a/sys/kern/kern_descrip.c   Mon Sep 22 12:54:46 2003 +0000
+++ b/sys/kern/kern_descrip.c   Mon Sep 22 12:59:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_descrip.c,v 1.113 2003/09/21 19:17:03 jdolecek Exp $      */
+/*     $NetBSD: kern_descrip.c,v 1.114 2003/09/22 12:59:55 christos Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.113 2003/09/21 19:17:03 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.114 2003/09/22 12:59:55 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1585,13 +1585,13 @@
  * Send signal to descriptor owner, either process or process group.
  */
 void
-fownsignal(pid_t pgid, int code, int band, void *fdescdata)
+fownsignal(pid_t pgid, int signo, int code, int band, void *fdescdata)
 {
        struct proc *p1;
        ksiginfo_t ksi; 
 
        memset(&ksi, 0, sizeof(ksi));
-       ksi.ksi_signo = SIGIO;
+       ksi.ksi_signo = signo;
        ksi.ksi_code = code;
        ksi.ksi_band = band;
 
diff -r 6dca4d45ee82 -r 1b7cf1d815a8 sys/kern/subr_log.c
--- a/sys/kern/subr_log.c       Mon Sep 22 12:54:46 2003 +0000
+++ b/sys/kern/subr_log.c       Mon Sep 22 12:59:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_log.c,v 1.32 2003/09/21 19:17:05 jdolecek Exp $   */
+/*     $NetBSD: subr_log.c,v 1.33 2003/09/22 12:59:57 christos Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_log.c,v 1.32 2003/09/21 19:17:05 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_log.c,v 1.33 2003/09/22 12:59:57 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -281,7 +281,7 @@
                return;
        selnotify(&logsoftc.sc_selp, 0);
        if (logsoftc.sc_state & LOG_ASYNC)
-               fownsignal(logsoftc.sc_pgid, 0, 0, NULL);
+               fownsignal(logsoftc.sc_pgid, SIGIO, 0, 0, NULL);
        if (logsoftc.sc_state & LOG_RDWAIT) {
                wakeup((caddr_t)msgbufp);
                logsoftc.sc_state &= ~LOG_RDWAIT;
diff -r 6dca4d45ee82 -r 1b7cf1d815a8 sys/kern/sys_pipe.c
--- a/sys/kern/sys_pipe.c       Mon Sep 22 12:54:46 2003 +0000
+++ b/sys/kern/sys_pipe.c       Mon Sep 22 12:59:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_pipe.c,v 1.43 2003/09/21 19:17:07 jdolecek Exp $   */
+/*     $NetBSD: sys_pipe.c,v 1.44 2003/09/22 12:59:57 christos Exp $   */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.43 2003/09/21 19:17:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.44 2003/09/22 12:59:57 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -432,7 +432,7 @@
                break;
        }
 
-       fownsignal(sigp->pipe_pgid, code, band, selp);
+       fownsignal(sigp->pipe_pgid, SIGIO, code, band, selp);
 }
 
 /* ARGSUSED */
diff -r 6dca4d45ee82 -r 1b7cf1d815a8 sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Mon Sep 22 12:54:46 2003 +0000
+++ b/sys/kern/uipc_socket.c    Mon Sep 22 12:59:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket.c,v 1.89 2003/09/15 00:22:20 christos Exp $        */
+/*     $NetBSD: uipc_socket.c,v 1.90 2003/09/22 12:59:58 christos Exp $        */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.89 2003/09/15 00:22:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.90 2003/09/22 12:59:58 christos Exp $");
 
 #include "opt_sock_counters.h"
 #include "opt_sosend_loan.h"
@@ -1507,17 +1507,7 @@
 void
 sohasoutofband(struct socket *so)
 {
-       struct proc *p;
-       ksiginfo_t ksi;
-       memset(&ksi, 0, sizeof(ksi));
-       ksi.ksi_signo = SIGURG;
-       ksi.ksi_band = POLLPRI|POLLRDBAND;
-       ksi.ksi_code = POLL_PRI;
-
-       if (so->so_pgid < 0)
-               kgsignal(-so->so_pgid, &ksi, so);
-       else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
-               kpsignal(p, &ksi, so);
+       fownsignal(so->so_pgid, SIGURG, POLL_PRI, POLLPRI|POLLRDBAND, so);
        selwakeup(&so->so_rcv.sb_sel);
 }
 
diff -r 6dca4d45ee82 -r 1b7cf1d815a8 sys/kern/uipc_socket2.c
--- a/sys/kern/uipc_socket2.c   Mon Sep 22 12:54:46 2003 +0000
+++ b/sys/kern/uipc_socket2.c   Mon Sep 22 12:59:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket2.c,v 1.56 2003/09/21 19:17:11 jdolecek Exp $       */
+/*     $NetBSD: uipc_socket2.c,v 1.57 2003/09/22 12:59:59 christos Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.56 2003/09/21 19:17:11 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.57 2003/09/22 12:59:59 christos Exp $");
 
 #include "opt_mbuftrace.h"
 
@@ -311,18 +311,11 @@
        }
        if (sb->sb_flags & SB_ASYNC) {
                int band;
-               if (code == POLL_IN) {
-                       if (so->so_oobmark || (so->so_state & SS_RCVATMARK))
-                               band = (POLLPRI | POLLRDBAND);
-                       else
-                               band = (POLLIN | POLLRDNORM);
-               } else {
-                       if (so->so_oobmark)
-                               band = (POLLPRI | POLLWRBAND);
-                       else
-                               band = (POLLOUT | POLLWRNORM);
-               }
-               fownsignal(so->so_pgid, code, band, so);
+               if (code == POLL_IN)
+                       band = POLLIN|POLLRDNORM;
+               else
+                       band = POLLOUT|POLLWRNORM;
+               fownsignal(so->so_pgid, SIGIO, code, band, so);
        }
        if (sb->sb_flags & SB_UPCALL)
                (*so->so_upcall)(so, so->so_upcallarg, M_DONTWAIT);
diff -r 6dca4d45ee82 -r 1b7cf1d815a8 sys/net/bpf.c
--- a/sys/net/bpf.c     Mon Sep 22 12:54:46 2003 +0000
+++ b/sys/net/bpf.c     Mon Sep 22 12:59:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.85 2003/09/21 19:17:13 jdolecek Exp $        */
+/*     $NetBSD: bpf.c,v 1.86 2003/09/22 13:00:01 christos Exp $        */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.85 2003/09/21 19:17:13 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.86 2003/09/22 13:00:01 christos Exp $");
 
 #include "bpfilter.h"
 
@@ -520,7 +520,7 @@
 {
        wakeup((caddr_t)d);
        if (d->bd_async)
-               fownsignal(d->bd_pgid, 0, 0, NULL);
+               fownsignal(d->bd_pgid, SIGIO, 0, 0, NULL);
 
        selnotify(&d->bd_sel, 0);
        /* XXX */
diff -r 6dca4d45ee82 -r 1b7cf1d815a8 sys/net/if_tun.c
--- a/sys/net/if_tun.c  Mon Sep 22 12:54:46 2003 +0000
+++ b/sys/net/if_tun.c  Mon Sep 22 12:59:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tun.c,v 1.65 2003/09/22 03:29:34 jdolecek Exp $     */
+/*     $NetBSD: if_tun.c,v 1.66 2003/09/22 13:00:03 christos Exp $     */
 
 /*
  * Copyright (c) 1988, Julian Onions <jpo%cs.nott.ac.uk@localhost>
@@ -15,7 +15,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.65 2003/09/22 03:29:34 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.66 2003/09/22 13:00:03 christos Exp $");
 
 #include "tun.h"
 
@@ -189,7 +189,7 @@
                wakeup((caddr_t)tp);
        }
        if (tp->tun_flags & TUN_ASYNC && tp->tun_pgid)
-               fownsignal(tp->tun_pgid, POLL_HUP, 0, NULL);
+               fownsignal(tp->tun_pgid, SIGIO, POLL_HUP, 0, NULL);
 
        selwakeup(&tp->tun_rsel);
 
@@ -515,7 +515,8 @@
                wakeup((caddr_t)tp);
        }
        if (tp->tun_flags & TUN_ASYNC && tp->tun_pgid)
-               fownsignal(tp->tun_pgid, POLL_IN, POLLIN|POLLRDNORM, NULL);
+               fownsignal(tp->tun_pgid, SIGIO, POLL_IN, POLLIN|POLLRDNORM,
+                   NULL);
 
        selnotify(&tp->tun_rsel, 0);
        simple_unlock(&tp->tun_lock);
diff -r 6dca4d45ee82 -r 1b7cf1d815a8 sys/sys/file.h
--- a/sys/sys/file.h    Mon Sep 22 12:54:46 2003 +0000
+++ b/sys/sys/file.h    Mon Sep 22 12:59:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: file.h,v 1.47 2003/09/21 19:17:17 jdolecek Exp $       */
+/*     $NetBSD: file.h,v 1.48 2003/09/22 13:00:04 christos Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -164,7 +164,7 @@
 
 int    fsetown(struct proc *, pid_t *, int, const void *);
 int    fgetown(struct proc *, pid_t, int, void *);
-void   fownsignal(pid_t, int, int, void *);
+void   fownsignal(pid_t, int, int, int, void *);
 
 #endif /* _KERNEL */
 



Home | Main Index | Thread Index | Old Index