Source-Changes-HG archive

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

[src/trunk]: src/sys/kern convert to ANSI KNF



details:   https://anonhg.NetBSD.org/src/rev/109394731755
branches:  trunk
changeset: 504296:109394731755
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Feb 26 21:58:30 2001 +0000

description:
convert to ANSI KNF

diffstat:

 sys/kern/kern_sig.c    |  369 ++++++++++++++++++++++--------------------------
 sys/kern/sys_generic.c |  329 +++++++++++++++++++------------------------
 2 files changed, 312 insertions(+), 386 deletions(-)

diffs (truncated from 1324 to 300 lines):

diff -r 4aee8e15a002 -r 109394731755 sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Mon Feb 26 21:09:57 2001 +0000
+++ b/sys/kern/kern_sig.c       Mon Feb 26 21:58:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig.c,v 1.111 2001/02/23 22:01:50 nathanw Exp $   */
+/*     $NetBSD: kern_sig.c,v 1.112 2001/02/26 21:58:30 lukem Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -77,20 +77,20 @@
 
 #include <uvm/uvm_extern.h>
 
-static void proc_stop __P((struct proc *p));
-void killproc __P((struct proc *, char *));
-static int build_corename __P((struct proc *, char [MAXPATHLEN]));
+static void    proc_stop(struct proc *p);
+void           killproc(struct proc *, char *);
+static int     build_corename(struct proc *, char [MAXPATHLEN]);
 #if COMPAT_NETBSD32
-static int coredump32 __P((struct proc *, struct vnode *));
+static int     coredump32(struct proc *, struct vnode *);
 #endif
-sigset_t contsigmask, stopsigmask, sigcantmask;
+sigset_t       contsigmask, stopsigmask, sigcantmask;
 
-struct pool sigacts_pool;      /* memory pool for sigacts structures */
+struct pool    sigacts_pool;   /* memory pool for sigacts structures */
 
 /*
  * Can process p, with pcred pc, send the signal signum to process q?
  */
-#define CANSIGNAL(p, pc, q, signum) \
+#define        CANSIGNAL(p, pc, q, signum) \
        ((pc)->pc_ucred->cr_uid == 0 || \
            (pc)->p_ruid == (q)->p_cred->p_ruid || \
            (pc)->pc_ucred->cr_uid == (q)->p_cred->p_ruid || \
@@ -102,8 +102,9 @@
  * Initialize signal-related data structures.
  */
 void
-signal_init()
+signal_init(void)
 {
+
        pool_init(&sigacts_pool, sizeof(struct sigacts), 0, 0, 0, "sigapl",
            0, pool_page_alloc_nointr, pool_page_free_nointr, M_SUBPROC);
 }
@@ -114,10 +115,7 @@
  * copy it from parent.
  */
 void
-sigactsinit(np, pp, share)
-       struct proc *np;        /* new process */
-       struct proc *pp;        /* parent process */
-       int share;
+sigactsinit(struct proc *np, struct proc *pp, int share)
 {
        struct sigacts *ps;
 
@@ -140,8 +138,7 @@
  * signal state.
  */
 void
-sigactsunshare(p)
-       struct proc *p;
+sigactsunshare(struct proc *p)
 {
        struct sigacts *oldps;
 
@@ -159,11 +156,11 @@
  * Release a sigctx structure.
  */
 void
-sigactsfree(p)
-       struct proc *p;
+sigactsfree(struct proc *p)
 {
-       struct sigacts *ps = p->p_sigacts;
+       struct sigacts *ps;
 
+       ps = p->p_sigacts;
        if (--ps->sa_refcnt > 0)
                return;
 
@@ -171,15 +168,13 @@
 }
 
 int
-sigaction1(p, signum, nsa, osa)
-       struct proc *p;
-       int signum;
-       const struct sigaction *nsa;
-       struct sigaction *osa;
+sigaction1(struct proc *p, int signum, const struct sigaction *nsa,
+       struct sigaction *osa)
 {
-       struct sigacts *ps = p->p_sigacts;
-       int prop;
+       struct sigacts  *ps;
+       int             prop;
 
+       ps = p->p_sigacts;
        if (signum <= 0 || signum >= NSIG)
                return (EINVAL);
 
@@ -208,8 +203,8 @@
                                /*
                                 * Paranoia: since SA_NOCLDWAIT is implemented
                                 * by reparenting the dying child to PID 1 (and
-                                * trust it to reap the zombie), PID 1 itself is
-                                * forbidden to set SA_NOCLDWAIT.
+                                * trust it to reap the zombie), PID 1 itself
+                                * is forbidden to set SA_NOCLDWAIT.
                                 */
                                if (p->p_pid == 1)
                                        p->p_flag &= ~P_NOCLDWAIT;
@@ -223,16 +218,19 @@
                else
                        sigdelset(&SIGACTION_PS(ps, signum).sa_mask, signum);
                /*
-               * Set bit in p_sigctx.ps_sigignore for signals that are set to SIG_IGN,
-               * and for signals set to SIG_DFL where the default is to ignore.
-               * However, don't put SIGCONT in p_sigctx.ps_sigignore,
-               * as we have to restart the process.
-               */
+                * Set bit in p_sigctx.ps_sigignore for signals that are set to
+                * SIG_IGN, and for signals set to SIG_DFL where the default is
+                * to ignore. However, don't put SIGCONT in
+                * p_sigctx.ps_sigignore, as we have to restart the process.
+                */
                if (nsa->sa_handler == SIG_IGN ||
                    (nsa->sa_handler == SIG_DFL && (prop & SA_IGNORE) != 0)) {
-                       sigdelset(&p->p_sigctx.ps_siglist, signum);     /* never to be seen again */
-                       if (signum != SIGCONT)
-                               sigaddset(&p->p_sigctx.ps_sigignore, signum);   /* easier in psignal */
+                                               /* never to be seen again */
+                       sigdelset(&p->p_sigctx.ps_siglist, signum);
+                       if (signum != SIGCONT) {
+                                               /* easier in psignal */
+                               sigaddset(&p->p_sigctx.ps_sigignore, signum);
+                       }
                        sigdelset(&p->p_sigctx.ps_sigcatch, signum);
                } else {
                        sigdelset(&p->p_sigctx.ps_sigignore, signum);
@@ -249,18 +247,15 @@
 
 /* ARGSUSED */
 int
-sys___sigaction14(p, v, retval)
-       struct proc *p;
-       void *v;
-       register_t *retval;
+sys___sigaction14(struct proc *p, void *v, register_t *retval)
 {
        struct sys___sigaction14_args /* {
-               syscallarg(int) signum;
-               syscallarg(const struct sigaction *) nsa;
-               syscallarg(struct sigaction *) osa;
+               syscallarg(int)                         signum;
+               syscallarg(const struct sigaction *)    nsa;
+               syscallarg(struct sigaction *)          osa;
        } */ *uap = v;
-       struct sigaction nsa, osa;
-       int error;
+       struct sigaction        nsa, osa;
+       int                     error;
 
        if (SCARG(uap, nsa)) {
                error = copyin(SCARG(uap, nsa), &nsa, sizeof(nsa));
@@ -285,13 +280,12 @@
  * stack.
  */
 void
-siginit(p)
-       struct proc *p;
+siginit(struct proc *p)
 {
-       struct sigacts *ps = p->p_sigacts;
-       int signum;
-       int prop;
+       struct sigacts  *ps;
+       int             signum, prop;
 
+       ps = p->p_sigacts;
        sigemptyset(&contsigmask);
        sigemptyset(&stopsigmask);
        sigemptyset(&sigcantmask);
@@ -326,13 +320,12 @@
  * Reset signals for an exec of the specified process.
  */
 void
-execsigs(p)
-       struct proc *p;
+execsigs(struct proc *p)
 {
-       struct sigacts *ps = p->p_sigacts;
-       int signum;
-       int prop;
+       struct sigacts  *ps;
+       int             signum, prop;
 
+       ps = p->p_sigacts;
        /*
         * Reset caught signals.  Held signals remain held
         * through p_sigctx.ps_sigmask (unless they were caught,
@@ -343,7 +336,8 @@
                        prop = sigprop[signum];
                        if (prop & SA_IGNORE) {
                                if ((prop & SA_CONT) == 0)
-                                       sigaddset(&p->p_sigctx.ps_sigignore, signum);
+                                       sigaddset(&p->p_sigctx.ps_sigignore,
+                                           signum);
                                sigdelset(&p->p_sigctx.ps_siglist, signum);
                        }
                        SIGACTION_PS(ps, signum).sa_handler = SIG_DFL;
@@ -363,11 +357,7 @@
 }
 
 int
-sigprocmask1(p, how, nss, oss)
-       struct proc *p;
-       int how;
-       const sigset_t *nss;
-       sigset_t *oss;
+sigprocmask1(struct proc *p, int how, const sigset_t *nss, sigset_t *oss)
 {
 
        if (oss)
@@ -405,18 +395,15 @@
  * the library stub does the rest.
  */
 int
-sys___sigprocmask14(p, v, retval)
-       struct proc *p;
-       void *v;
-       register_t *retval;
+sys___sigprocmask14(struct proc *p, void *v, register_t *retval)
 {
        struct sys___sigprocmask14_args /* {
-               syscallarg(int) how;
-               syscallarg(const sigset_t *) set;
-               syscallarg(sigset_t *) oset;
+               syscallarg(int)                 how;
+               syscallarg(const sigset_t *)    set;
+               syscallarg(sigset_t *)          oset;
        } */ *uap = v;
-       sigset_t nss, oss;
-       int error;
+       sigset_t        nss, oss;
+       int             error;
 
        if (SCARG(uap, set)) {
                error = copyin(SCARG(uap, set), &nss, sizeof(nss));
@@ -436,9 +423,7 @@
 }
 
 void
-sigpending1(p, ss)
-       struct proc *p;
-       sigset_t *ss;
+sigpending1(struct proc *p, sigset_t *ss)
 {
 
        *ss = p->p_sigctx.ps_siglist;
@@ -447,13 +432,10 @@
 
 /* ARGSUSED */
 int
-sys___sigpending14(p, v, retval)
-       struct proc *p;
-       void *v;
-       register_t *retval;
+sys___sigpending14(struct proc *p, void *v, register_t *retval)
 {
        struct sys___sigpending14_args /* {
-               syscallarg(sigset_t *) set;
+               syscallarg(sigset_t *)  set;
        } */ *uap = v;
        sigset_t ss;
 
@@ -462,12 +444,11 @@
 }
 
 int
-sigsuspend1(p, ss)
-       struct proc *p;
-       const sigset_t *ss;
+sigsuspend1(struct proc *p, const sigset_t *ss)
 {
-       struct sigacts *ps = p->p_sigacts;
+       struct sigacts *ps;
 
+       ps = p->p_sigacts;
        if (ss) {
                /*
                 * When returning from sigpause, we want
@@ -498,16 +479,13 @@
  */
 /* ARGSUSED */



Home | Main Index | Thread Index | Old Index