The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/kern/kern_proc.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1982, 1986, 1989, 1991, 1993
    3  *      The Regents of the University of California.  All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 3. All advertising materials mentioning features or use of this software
   14  *    must display the following acknowledgement:
   15  *      This product includes software developed by the University of
   16  *      California, Berkeley and its contributors.
   17  * 4. Neither the name of the University nor the names of its contributors
   18  *    may be used to endorse or promote products derived from this software
   19  *    without specific prior written permission.
   20  *
   21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   31  * SUCH DAMAGE.
   32  *
   33  *      @(#)kern_proc.c 8.7 (Berkeley) 2/14/95
   34  * $FreeBSD: releng/5.2/sys/kern/kern_proc.c 121127 2003-10-16 08:39:15Z jeff $
   35  */
   36 
   37 #include <sys/cdefs.h>
   38 __FBSDID("$FreeBSD: releng/5.2/sys/kern/kern_proc.c 121127 2003-10-16 08:39:15Z jeff $");
   39 
   40 #include "opt_ktrace.h"
   41 #include "opt_kstack_pages.h"
   42 
   43 #include <sys/param.h>
   44 #include <sys/systm.h>
   45 #include <sys/kernel.h>
   46 #include <sys/lock.h>
   47 #include <sys/malloc.h>
   48 #include <sys/mutex.h>
   49 #include <sys/proc.h>
   50 #include <sys/sysent.h>
   51 #include <sys/sched.h>
   52 #include <sys/smp.h>
   53 #include <sys/sysctl.h>
   54 #include <sys/filedesc.h>
   55 #include <sys/tty.h>
   56 #include <sys/signalvar.h>
   57 #include <sys/sx.h>
   58 #include <sys/user.h>
   59 #include <sys/jail.h>
   60 #ifdef KTRACE
   61 #include <sys/uio.h>
   62 #include <sys/ktrace.h>
   63 #endif
   64 
   65 #include <vm/vm.h>
   66 #include <vm/vm_extern.h>
   67 #include <vm/pmap.h>
   68 #include <vm/vm_map.h>
   69 #include <vm/uma.h>
   70 #include <machine/critical.h>
   71 
   72 MALLOC_DEFINE(M_PGRP, "pgrp", "process group header");
   73 MALLOC_DEFINE(M_SESSION, "session", "session header");
   74 static MALLOC_DEFINE(M_PROC, "proc", "Proc structures");
   75 MALLOC_DEFINE(M_SUBPROC, "subproc", "Proc sub-structures");
   76 
   77 static void doenterpgrp(struct proc *, struct pgrp *);
   78 static void orphanpg(struct pgrp *pg);
   79 static void pgadjustjobc(struct pgrp *pgrp, int entering);
   80 static void pgdelete(struct pgrp *);
   81 static void proc_ctor(void *mem, int size, void *arg);
   82 static void proc_dtor(void *mem, int size, void *arg);
   83 static void proc_init(void *mem, int size);
   84 static void proc_fini(void *mem, int size);
   85 
   86 /*
   87  * Other process lists
   88  */
   89 struct pidhashhead *pidhashtbl;
   90 u_long pidhash;
   91 struct pgrphashhead *pgrphashtbl;
   92 u_long pgrphash;
   93 struct proclist allproc;
   94 struct proclist zombproc;
   95 struct sx allproc_lock;
   96 struct sx proctree_lock;
   97 struct mtx pargs_ref_lock;
   98 struct mtx ppeers_lock;
   99 uma_zone_t proc_zone;
  100 uma_zone_t ithread_zone;
  101 
  102 int kstack_pages = KSTACK_PAGES;
  103 int uarea_pages = UAREA_PAGES;
  104 SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, "");
  105 SYSCTL_INT(_kern, OID_AUTO, uarea_pages, CTLFLAG_RD, &uarea_pages, 0, "");
  106 
  107 #define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start))
  108 
  109 CTASSERT(sizeof(struct kinfo_proc) == KINFO_PROC_SIZE);
  110 
  111 /*
  112  * Initialize global process hashing structures.
  113  */
  114 void
  115 procinit()
  116 {
  117 
  118         sx_init(&allproc_lock, "allproc");
  119         sx_init(&proctree_lock, "proctree");
  120         mtx_init(&pargs_ref_lock, "struct pargs.ref", NULL, MTX_DEF);
  121         mtx_init(&ppeers_lock, "p_peers", NULL, MTX_DEF);
  122         LIST_INIT(&allproc);
  123         LIST_INIT(&zombproc);
  124         pidhashtbl = hashinit(maxproc / 4, M_PROC, &pidhash);
  125         pgrphashtbl = hashinit(maxproc / 4, M_PROC, &pgrphash);
  126         proc_zone = uma_zcreate("PROC", sched_sizeof_proc(),
  127             proc_ctor, proc_dtor, proc_init, proc_fini,
  128             UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
  129         uihashinit();
  130 }
  131 
  132 /*
  133  * Prepare a proc for use.
  134  */
  135 static void
  136 proc_ctor(void *mem, int size, void *arg)
  137 {
  138         struct proc *p;
  139 
  140         p = (struct proc *)mem;
  141 }
  142 
  143 /*
  144  * Reclaim a proc after use.
  145  */
  146 static void
  147 proc_dtor(void *mem, int size, void *arg)
  148 {
  149         struct proc *p;
  150         struct thread *td;
  151         struct ksegrp *kg;
  152         struct kse *ke;
  153 
  154         /* INVARIANTS checks go here */
  155         p = (struct proc *)mem;
  156         KASSERT((p->p_numthreads == 1),
  157             ("bad number of threads in exiting process"));
  158         td = FIRST_THREAD_IN_PROC(p);
  159         KASSERT((td != NULL), ("proc_dtor: bad thread pointer"));
  160         kg = FIRST_KSEGRP_IN_PROC(p);
  161         KASSERT((kg != NULL), ("proc_dtor: bad kg pointer"));
  162         ke = FIRST_KSE_IN_KSEGRP(kg);
  163         KASSERT((ke != NULL), ("proc_dtor: bad ke pointer"));
  164 
  165         /* Dispose of an alternate kstack, if it exists.
  166          * XXX What if there are more than one thread in the proc?
  167          *     The first thread in the proc is special and not
  168          *     freed, so you gotta do this here.
  169          */
  170         if (((p->p_flag & P_KTHREAD) != 0) && (td->td_altkstack != 0))
  171                 vm_thread_dispose_altkstack(td);
  172 
  173         /*
  174          * We want to make sure we know the initial linkages.
  175          * so for now tear them down and remake them.
  176          * This is probably un-needed as we can probably rely
  177          * on the state coming in here from wait4().
  178          */
  179         proc_linkup(p, kg, ke, td);
  180 }
  181 
  182 /*
  183  * Initialize type-stable parts of a proc (when newly created).
  184  */
  185 static void
  186 proc_init(void *mem, int size)
  187 {
  188         struct proc *p;
  189         struct thread *td;
  190         struct ksegrp *kg;
  191         struct kse *ke;
  192 
  193         p = (struct proc *)mem;
  194         p->p_sched = (struct p_sched *)&p[1];
  195         vm_proc_new(p);
  196         td = thread_alloc();
  197         ke = kse_alloc();
  198         kg = ksegrp_alloc();
  199         proc_linkup(p, kg, ke, td);
  200         bzero(&p->p_mtx, sizeof(struct mtx));
  201         mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
  202 }
  203 
  204 /*
  205  * Tear down type-stable parts of a proc (just before being discarded)
  206  */
  207 static void
  208 proc_fini(void *mem, int size)
  209 {
  210         struct proc *p;
  211         struct thread *td;
  212         struct ksegrp *kg;
  213         struct kse *ke;
  214 
  215         p = (struct proc *)mem;
  216         KASSERT((p->p_numthreads == 1),
  217             ("bad number of threads in freeing process"));
  218         td = FIRST_THREAD_IN_PROC(p);
  219         KASSERT((td != NULL), ("proc_dtor: bad thread pointer"));
  220         kg = FIRST_KSEGRP_IN_PROC(p);
  221         KASSERT((kg != NULL), ("proc_dtor: bad kg pointer"));
  222         ke = FIRST_KSE_IN_KSEGRP(kg);
  223         KASSERT((ke != NULL), ("proc_dtor: bad ke pointer"));
  224         vm_proc_dispose(p);
  225         thread_free(td);
  226         ksegrp_free(kg);
  227         kse_free(ke);
  228         mtx_destroy(&p->p_mtx);
  229 }
  230 
  231 /*
  232  * Is p an inferior of the current process?
  233  */
  234 int
  235 inferior(p)
  236         register struct proc *p;
  237 {
  238 
  239         sx_assert(&proctree_lock, SX_LOCKED);
  240         for (; p != curproc; p = p->p_pptr)
  241                 if (p->p_pid == 0)
  242                         return (0);
  243         return (1);
  244 }
  245 
  246 /*
  247  * Locate a process by number
  248  */
  249 struct proc *
  250 pfind(pid)
  251         register pid_t pid;
  252 {
  253         register struct proc *p;
  254 
  255         sx_slock(&allproc_lock);
  256         LIST_FOREACH(p, PIDHASH(pid), p_hash)
  257                 if (p->p_pid == pid) {
  258                         PROC_LOCK(p);
  259                         break;
  260                 }
  261         sx_sunlock(&allproc_lock);
  262         return (p);
  263 }
  264 
  265 /*
  266  * Locate a process group by number.
  267  * The caller must hold proctree_lock.
  268  */
  269 struct pgrp *
  270 pgfind(pgid)
  271         register pid_t pgid;
  272 {
  273         register struct pgrp *pgrp;
  274 
  275         sx_assert(&proctree_lock, SX_LOCKED);
  276 
  277         LIST_FOREACH(pgrp, PGRPHASH(pgid), pg_hash) {
  278                 if (pgrp->pg_id == pgid) {
  279                         PGRP_LOCK(pgrp);
  280                         return (pgrp);
  281                 }
  282         }
  283         return (NULL);
  284 }
  285 
  286 /*
  287  * Create a new process group.
  288  * pgid must be equal to the pid of p.
  289  * Begin a new session if required.
  290  */
  291 int
  292 enterpgrp(p, pgid, pgrp, sess)
  293         register struct proc *p;
  294         pid_t pgid;
  295         struct pgrp *pgrp;
  296         struct session *sess;
  297 {
  298         struct pgrp *pgrp2;
  299 
  300         sx_assert(&proctree_lock, SX_XLOCKED);
  301 
  302         KASSERT(pgrp != NULL, ("enterpgrp: pgrp == NULL"));
  303         KASSERT(p->p_pid == pgid,
  304             ("enterpgrp: new pgrp and pid != pgid"));
  305 
  306         pgrp2 = pgfind(pgid);
  307 
  308         KASSERT(pgrp2 == NULL,
  309             ("enterpgrp: pgrp with pgid exists"));
  310         KASSERT(!SESS_LEADER(p),
  311             ("enterpgrp: session leader attempted setpgrp"));
  312 
  313         mtx_init(&pgrp->pg_mtx, "process group", NULL, MTX_DEF | MTX_DUPOK);
  314 
  315         if (sess != NULL) {
  316                 /*
  317                  * new session
  318                  */
  319                 mtx_init(&sess->s_mtx, "session", NULL, MTX_DEF);
  320                 PROC_LOCK(p);
  321                 p->p_flag &= ~P_CONTROLT;
  322                 PROC_UNLOCK(p);
  323                 PGRP_LOCK(pgrp);
  324                 sess->s_leader = p;
  325                 sess->s_sid = p->p_pid;
  326                 sess->s_count = 1;
  327                 sess->s_ttyvp = NULL;
  328                 sess->s_ttyp = NULL;
  329                 bcopy(p->p_session->s_login, sess->s_login,
  330                             sizeof(sess->s_login));
  331                 pgrp->pg_session = sess;
  332                 KASSERT(p == curproc,
  333                     ("enterpgrp: mksession and p != curproc"));
  334         } else {
  335                 pgrp->pg_session = p->p_session;
  336                 SESS_LOCK(pgrp->pg_session);
  337                 pgrp->pg_session->s_count++;
  338                 SESS_UNLOCK(pgrp->pg_session);
  339                 PGRP_LOCK(pgrp);
  340         }
  341         pgrp->pg_id = pgid;
  342         LIST_INIT(&pgrp->pg_members);
  343 
  344         /*
  345          * As we have an exclusive lock of proctree_lock,
  346          * this should not deadlock.
  347          */
  348         LIST_INSERT_HEAD(PGRPHASH(pgid), pgrp, pg_hash);
  349         pgrp->pg_jobc = 0;
  350         SLIST_INIT(&pgrp->pg_sigiolst);
  351         PGRP_UNLOCK(pgrp);
  352 
  353         doenterpgrp(p, pgrp);
  354 
  355         return (0);
  356 }
  357 
  358 /*
  359  * Move p to an existing process group
  360  */
  361 int
  362 enterthispgrp(p, pgrp)
  363         register struct proc *p;
  364         struct pgrp *pgrp;
  365 {
  366 
  367         sx_assert(&proctree_lock, SX_XLOCKED);
  368         PROC_LOCK_ASSERT(p, MA_NOTOWNED);
  369         PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED);
  370         PGRP_LOCK_ASSERT(p->p_pgrp, MA_NOTOWNED);
  371         SESS_LOCK_ASSERT(p->p_session, MA_NOTOWNED);
  372         KASSERT(pgrp->pg_session == p->p_session,
  373                 ("%s: pgrp's session %p, p->p_session %p.\n",
  374                 __func__,
  375                 pgrp->pg_session,
  376                 p->p_session));
  377         KASSERT(pgrp != p->p_pgrp,
  378                 ("%s: p belongs to pgrp.", __func__));
  379 
  380         doenterpgrp(p, pgrp);
  381 
  382         return (0);
  383 }
  384 
  385 /*
  386  * Move p to a process group
  387  */
  388 static void
  389 doenterpgrp(p, pgrp)
  390         struct proc *p;
  391         struct pgrp *pgrp;
  392 {
  393         struct pgrp *savepgrp;
  394 
  395         sx_assert(&proctree_lock, SX_XLOCKED);
  396         PROC_LOCK_ASSERT(p, MA_NOTOWNED);
  397         PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED);
  398         PGRP_LOCK_ASSERT(p->p_pgrp, MA_NOTOWNED);
  399         SESS_LOCK_ASSERT(p->p_session, MA_NOTOWNED);
  400 
  401         savepgrp = p->p_pgrp;
  402 
  403         /*
  404          * Adjust eligibility of affected pgrps to participate in job control.
  405          * Increment eligibility counts before decrementing, otherwise we
  406          * could reach 0 spuriously during the first call.
  407          */
  408         fixjobc(p, pgrp, 1);
  409         fixjobc(p, p->p_pgrp, 0);
  410 
  411         PGRP_LOCK(pgrp);
  412         PGRP_LOCK(savepgrp);
  413         PROC_LOCK(p);
  414         LIST_REMOVE(p, p_pglist);
  415         p->p_pgrp = pgrp;
  416         PROC_UNLOCK(p);
  417         LIST_INSERT_HEAD(&pgrp->pg_members, p, p_pglist);
  418         PGRP_UNLOCK(savepgrp);
  419         PGRP_UNLOCK(pgrp);
  420         if (LIST_EMPTY(&savepgrp->pg_members))
  421                 pgdelete(savepgrp);
  422 }
  423 
  424 /*
  425  * remove process from process group
  426  */
  427 int
  428 leavepgrp(p)
  429         register struct proc *p;
  430 {
  431         struct pgrp *savepgrp;
  432 
  433         sx_assert(&proctree_lock, SX_XLOCKED);
  434         savepgrp = p->p_pgrp;
  435         PGRP_LOCK(savepgrp);
  436         PROC_LOCK(p);
  437         LIST_REMOVE(p, p_pglist);
  438         p->p_pgrp = NULL;
  439         PROC_UNLOCK(p);
  440         PGRP_UNLOCK(savepgrp);
  441         if (LIST_EMPTY(&savepgrp->pg_members))
  442                 pgdelete(savepgrp);
  443         return (0);
  444 }
  445 
  446 /*
  447  * delete a process group
  448  */
  449 static void
  450 pgdelete(pgrp)
  451         register struct pgrp *pgrp;
  452 {
  453         struct session *savesess;
  454 
  455         sx_assert(&proctree_lock, SX_XLOCKED);
  456         PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED);
  457         SESS_LOCK_ASSERT(pgrp->pg_session, MA_NOTOWNED);
  458 
  459         /*
  460          * Reset any sigio structures pointing to us as a result of
  461          * F_SETOWN with our pgid.
  462          */
  463         funsetownlst(&pgrp->pg_sigiolst);
  464 
  465         PGRP_LOCK(pgrp);
  466         if (pgrp->pg_session->s_ttyp != NULL &&
  467             pgrp->pg_session->s_ttyp->t_pgrp == pgrp)
  468                 pgrp->pg_session->s_ttyp->t_pgrp = NULL;
  469         LIST_REMOVE(pgrp, pg_hash);
  470         savesess = pgrp->pg_session;
  471         SESS_LOCK(savesess);
  472         savesess->s_count--;
  473         SESS_UNLOCK(savesess);
  474         PGRP_UNLOCK(pgrp);
  475         if (savesess->s_count == 0) {
  476                 mtx_destroy(&savesess->s_mtx);
  477                 FREE(pgrp->pg_session, M_SESSION);
  478         }
  479         mtx_destroy(&pgrp->pg_mtx);
  480         FREE(pgrp, M_PGRP);
  481 }
  482 
  483 static void
  484 pgadjustjobc(pgrp, entering)
  485         struct pgrp *pgrp;
  486         int entering;
  487 {
  488 
  489         PGRP_LOCK(pgrp);
  490         if (entering)
  491                 pgrp->pg_jobc++;
  492         else {
  493                 --pgrp->pg_jobc;
  494                 if (pgrp->pg_jobc == 0)
  495                         orphanpg(pgrp);
  496         }
  497         PGRP_UNLOCK(pgrp);
  498 }
  499 
  500 /*
  501  * Adjust pgrp jobc counters when specified process changes process group.
  502  * We count the number of processes in each process group that "qualify"
  503  * the group for terminal job control (those with a parent in a different
  504  * process group of the same session).  If that count reaches zero, the
  505  * process group becomes orphaned.  Check both the specified process'
  506  * process group and that of its children.
  507  * entering == 0 => p is leaving specified group.
  508  * entering == 1 => p is entering specified group.
  509  */
  510 void
  511 fixjobc(p, pgrp, entering)
  512         register struct proc *p;
  513         register struct pgrp *pgrp;
  514         int entering;
  515 {
  516         register struct pgrp *hispgrp;
  517         register struct session *mysession;
  518 
  519         sx_assert(&proctree_lock, SX_LOCKED);
  520         PROC_LOCK_ASSERT(p, MA_NOTOWNED);
  521         PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED);
  522         SESS_LOCK_ASSERT(pgrp->pg_session, MA_NOTOWNED);
  523 
  524         /*
  525          * Check p's parent to see whether p qualifies its own process
  526          * group; if so, adjust count for p's process group.
  527          */
  528         mysession = pgrp->pg_session;
  529         if ((hispgrp = p->p_pptr->p_pgrp) != pgrp &&
  530             hispgrp->pg_session == mysession)
  531                 pgadjustjobc(pgrp, entering);
  532 
  533         /*
  534          * Check this process' children to see whether they qualify
  535          * their process groups; if so, adjust counts for children's
  536          * process groups.
  537          */
  538         LIST_FOREACH(p, &p->p_children, p_sibling) {
  539                 hispgrp = p->p_pgrp;
  540                 if (hispgrp == pgrp ||
  541                     hispgrp->pg_session != mysession)
  542                         continue;
  543                 PROC_LOCK(p);
  544                 if (p->p_state == PRS_ZOMBIE) {
  545                         PROC_UNLOCK(p);
  546                         continue;
  547                 }
  548                 PROC_UNLOCK(p);
  549                 pgadjustjobc(hispgrp, entering);
  550         }
  551 }
  552 
  553 /*
  554  * A process group has become orphaned;
  555  * if there are any stopped processes in the group,
  556  * hang-up all process in that group.
  557  */
  558 static void
  559 orphanpg(pg)
  560         struct pgrp *pg;
  561 {
  562         register struct proc *p;
  563 
  564         PGRP_LOCK_ASSERT(pg, MA_OWNED);
  565 
  566         LIST_FOREACH(p, &pg->pg_members, p_pglist) {
  567                 PROC_LOCK(p);
  568                 if (P_SHOULDSTOP(p)) {
  569                         PROC_UNLOCK(p);
  570                         LIST_FOREACH(p, &pg->pg_members, p_pglist) {
  571                                 PROC_LOCK(p);
  572                                 psignal(p, SIGHUP);
  573                                 psignal(p, SIGCONT);
  574                                 PROC_UNLOCK(p);
  575                         }
  576                         return;
  577                 }
  578                 PROC_UNLOCK(p);
  579         }
  580 }
  581 
  582 #include "opt_ddb.h"
  583 #ifdef DDB
  584 #include <ddb/ddb.h>
  585 
  586 DB_SHOW_COMMAND(pgrpdump, pgrpdump)
  587 {
  588         register struct pgrp *pgrp;
  589         register struct proc *p;
  590         register int i;
  591 
  592         for (i = 0; i <= pgrphash; i++) {
  593                 if (!LIST_EMPTY(&pgrphashtbl[i])) {
  594                         printf("\tindx %d\n", i);
  595                         LIST_FOREACH(pgrp, &pgrphashtbl[i], pg_hash) {
  596                                 printf(
  597                         "\tpgrp %p, pgid %ld, sess %p, sesscnt %d, mem %p\n",
  598                                     (void *)pgrp, (long)pgrp->pg_id,
  599                                     (void *)pgrp->pg_session,
  600                                     pgrp->pg_session->s_count,
  601                                     (void *)LIST_FIRST(&pgrp->pg_members));
  602                                 LIST_FOREACH(p, &pgrp->pg_members, p_pglist) {
  603                                         printf("\t\tpid %ld addr %p pgrp %p\n", 
  604                                             (long)p->p_pid, (void *)p,
  605                                             (void *)p->p_pgrp);
  606                                 }
  607                         }
  608                 }
  609         }
  610 }
  611 #endif /* DDB */
  612 void
  613 fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp);
  614 
  615 /*
  616  * Fill in a kinfo_proc structure for the specified process.
  617  * Must be called with the target process locked.
  618  */
  619 void
  620 fill_kinfo_proc(struct proc *p, struct kinfo_proc *kp)
  621 {
  622         fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), kp);
  623 }
  624 
  625 void
  626 fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp)
  627 {
  628         struct proc *p;
  629         struct thread *td0;
  630         struct kse *ke;
  631         struct ksegrp *kg;
  632         struct tty *tp;
  633         struct session *sp;
  634         struct timeval tv;
  635         struct sigacts *ps;
  636 
  637         p = td->td_proc;
  638 
  639         bzero(kp, sizeof(*kp));
  640 
  641         kp->ki_structsize = sizeof(*kp);
  642         kp->ki_paddr = p;
  643         PROC_LOCK_ASSERT(p, MA_OWNED);
  644         kp->ki_addr =/* p->p_addr; */0; /* XXXKSE */
  645         kp->ki_args = p->p_args;
  646         kp->ki_textvp = p->p_textvp;
  647 #ifdef KTRACE
  648         kp->ki_tracep = p->p_tracevp;
  649         mtx_lock(&ktrace_mtx);
  650         kp->ki_traceflag = p->p_traceflag;
  651         mtx_unlock(&ktrace_mtx);
  652 #endif
  653         kp->ki_fd = p->p_fd;
  654         kp->ki_vmspace = p->p_vmspace;
  655         if (p->p_ucred) {
  656                 kp->ki_uid = p->p_ucred->cr_uid;
  657                 kp->ki_ruid = p->p_ucred->cr_ruid;
  658                 kp->ki_svuid = p->p_ucred->cr_svuid;
  659                 /* XXX bde doesn't like KI_NGROUPS */
  660                 kp->ki_ngroups = min(p->p_ucred->cr_ngroups, KI_NGROUPS);
  661                 bcopy(p->p_ucred->cr_groups, kp->ki_groups,
  662                     kp->ki_ngroups * sizeof(gid_t));
  663                 kp->ki_rgid = p->p_ucred->cr_rgid;
  664                 kp->ki_svgid = p->p_ucred->cr_svgid;
  665         }
  666         if (p->p_sigacts) {
  667                 ps = p->p_sigacts;
  668                 mtx_lock(&ps->ps_mtx);
  669                 kp->ki_sigignore = ps->ps_sigignore;
  670                 kp->ki_sigcatch = ps->ps_sigcatch;
  671                 mtx_unlock(&ps->ps_mtx);
  672         }
  673         mtx_lock_spin(&sched_lock);
  674         if (p->p_state != PRS_NEW &&
  675             p->p_state != PRS_ZOMBIE &&
  676             p->p_vmspace != NULL) {
  677                 struct vmspace *vm = p->p_vmspace;
  678 
  679                 kp->ki_size = vm->vm_map.size;
  680                 kp->ki_rssize = vmspace_resident_count(vm); /*XXX*/
  681                 if (p->p_sflag & PS_INMEM)
  682                         kp->ki_rssize += UAREA_PAGES;
  683                 FOREACH_THREAD_IN_PROC(p, td0) {
  684                         if (!TD_IS_SWAPPED(td0))
  685                                 kp->ki_rssize += td0->td_kstack_pages;
  686                         if (td0->td_altkstack_obj != NULL)
  687                                 kp->ki_rssize += td0->td_altkstack_pages;
  688                 }
  689                 kp->ki_swrss = vm->vm_swrss;
  690                 kp->ki_tsize = vm->vm_tsize;
  691                 kp->ki_dsize = vm->vm_dsize;
  692                 kp->ki_ssize = vm->vm_ssize;
  693         }
  694         if ((p->p_sflag & PS_INMEM) && p->p_stats) {
  695                 kp->ki_start = p->p_stats->p_start;
  696                 timevaladd(&kp->ki_start, &boottime);
  697                 kp->ki_rusage = p->p_stats->p_ru;
  698                 kp->ki_childtime.tv_sec = p->p_stats->p_cru.ru_utime.tv_sec +
  699                     p->p_stats->p_cru.ru_stime.tv_sec;
  700                 kp->ki_childtime.tv_usec = p->p_stats->p_cru.ru_utime.tv_usec +
  701                     p->p_stats->p_cru.ru_stime.tv_usec;
  702         }
  703         if (p->p_state != PRS_ZOMBIE) {
  704 #if 0
  705                 if (td == NULL) {
  706                         /* XXXKSE: This should never happen. */
  707                         printf("fill_kinfo_proc(): pid %d has no threads!\n",
  708                             p->p_pid);
  709                         mtx_unlock_spin(&sched_lock);
  710                         return;
  711                 }
  712 #endif
  713                 if (td->td_wmesg != NULL) {
  714                         strlcpy(kp->ki_wmesg, td->td_wmesg,
  715                             sizeof(kp->ki_wmesg));
  716                 }
  717                 if (TD_ON_LOCK(td)) {
  718                         kp->ki_kiflag |= KI_LOCKBLOCK;
  719                         strlcpy(kp->ki_lockname, td->td_lockname,
  720                             sizeof(kp->ki_lockname));
  721                 }
  722 
  723                 if (p->p_state == PRS_NORMAL) { /*  XXXKSE very approximate */
  724                         if (TD_ON_RUNQ(td) ||
  725                             TD_CAN_RUN(td) ||
  726                             TD_IS_RUNNING(td)) {
  727                                 kp->ki_stat = SRUN;
  728                         } else if (P_SHOULDSTOP(p)) {
  729                                 kp->ki_stat = SSTOP;
  730                         } else if (TD_IS_SLEEPING(td)) {
  731                                 kp->ki_stat = SSLEEP;
  732                         } else if (TD_ON_LOCK(td)) {
  733                                 kp->ki_stat = SLOCK;
  734                         } else {
  735                                 kp->ki_stat = SWAIT;
  736                         }
  737                 } else {
  738                         kp->ki_stat = SIDL;
  739                 }
  740 
  741                 kp->ki_sflag = p->p_sflag;
  742                 kp->ki_swtime = p->p_swtime;
  743                 kp->ki_pid = p->p_pid;
  744                 kg = td->td_ksegrp;
  745                 ke = td->td_kse;
  746                 bintime2timeval(&p->p_runtime, &tv);
  747                 kp->ki_runtime =
  748                     tv.tv_sec * (u_int64_t)1000000 + tv.tv_usec;
  749 
  750                 /* things in the KSE GROUP */
  751                 kp->ki_estcpu = kg->kg_estcpu;
  752                 kp->ki_slptime = kg->kg_slptime;
  753                 kp->ki_pri.pri_user = kg->kg_user_pri;
  754                 kp->ki_pri.pri_class = kg->kg_pri_class;
  755                 kp->ki_nice = kg->kg_nice;
  756 
  757                 /* Things in the thread */
  758                 kp->ki_wchan = td->td_wchan;
  759                 kp->ki_pri.pri_level = td->td_priority;
  760                 kp->ki_pri.pri_native = td->td_base_pri;
  761                 kp->ki_lastcpu = td->td_lastcpu;
  762                 kp->ki_oncpu = td->td_oncpu;
  763                 kp->ki_tdflags = td->td_flags;
  764                 kp->ki_pcb = td->td_pcb;
  765                 kp->ki_kstack = (void *)td->td_kstack;
  766                 kp->ki_pctcpu = sched_pctcpu(td);
  767 
  768                 /* Things in the kse */
  769                 if (ke)
  770                         kp->ki_rqindex = ke->ke_rqindex;
  771                 else
  772                         kp->ki_rqindex = 0;
  773 
  774         } else {
  775                 kp->ki_stat = SZOMB;
  776         }
  777         mtx_unlock_spin(&sched_lock);
  778         sp = NULL;
  779         tp = NULL;
  780         if (p->p_pgrp) {
  781                 kp->ki_pgid = p->p_pgrp->pg_id;
  782                 kp->ki_jobc = p->p_pgrp->pg_jobc;
  783                 sp = p->p_pgrp->pg_session;
  784 
  785                 if (sp != NULL) {
  786                         kp->ki_sid = sp->s_sid;
  787                         SESS_LOCK(sp);
  788                         strlcpy(kp->ki_login, sp->s_login,
  789                             sizeof(kp->ki_login));
  790                         if (sp->s_ttyvp)
  791                                 kp->ki_kiflag |= KI_CTTY;
  792                         if (SESS_LEADER(p))
  793                                 kp->ki_kiflag |= KI_SLEADER;
  794                         tp = sp->s_ttyp;
  795                         SESS_UNLOCK(sp);
  796                 }
  797         }
  798         if ((p->p_flag & P_CONTROLT) && tp != NULL) {
  799                 kp->ki_tdev = dev2udev(tp->t_dev);
  800                 kp->ki_tpgid = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID;
  801                 if (tp->t_session)
  802                         kp->ki_tsid = tp->t_session->s_sid;
  803         } else
  804                 kp->ki_tdev = NOUDEV;
  805         if (p->p_comm[0] != '\0') {
  806                 strlcpy(kp->ki_comm, p->p_comm, sizeof(kp->ki_comm));
  807                 strlcpy(kp->ki_ocomm, p->p_comm, sizeof(kp->ki_ocomm));
  808         }
  809         kp->ki_siglist = p->p_siglist;
  810         SIGSETOR(kp->ki_siglist, td->td_siglist);
  811         kp->ki_sigmask = td->td_sigmask;
  812         kp->ki_xstat = p->p_xstat;
  813         kp->ki_acflag = p->p_acflag;
  814         kp->ki_flag = p->p_flag;
  815         /* If jailed(p->p_ucred), emulate the old P_JAILED flag. */
  816         if (jailed(p->p_ucred))
  817                 kp->ki_flag |= P_JAILED;
  818         kp->ki_lock = p->p_lock;
  819         if (p->p_pptr)
  820                 kp->ki_ppid = p->p_pptr->p_pid;
  821 }
  822 
  823 /*
  824  * Locate a zombie process by number
  825  */
  826 struct proc *
  827 zpfind(pid_t pid)
  828 {
  829         struct proc *p;
  830 
  831         sx_slock(&allproc_lock);
  832         LIST_FOREACH(p, &zombproc, p_list)
  833                 if (p->p_pid == pid) {
  834                         PROC_LOCK(p);
  835                         break;
  836                 }
  837         sx_sunlock(&allproc_lock);
  838         return (p);
  839 }
  840 
  841 #define KERN_PROC_ZOMBMASK      0x3
  842 #define KERN_PROC_NOTHREADS     0x4
  843 
  844 /*
  845  * Must be called with the process locked and will return with it unlocked.
  846  */
  847 static int
  848 sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags)
  849 {
  850         struct thread *td;
  851         struct kinfo_proc kinfo_proc;
  852         int error = 0;
  853         struct proc *np;
  854         pid_t pid = p->p_pid;
  855 
  856         PROC_LOCK_ASSERT(p, MA_OWNED);
  857 
  858         if (flags & KERN_PROC_NOTHREADS) {
  859                 fill_kinfo_proc(p, &kinfo_proc);
  860                 PROC_UNLOCK(p);
  861                 error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc,
  862                                    sizeof(kinfo_proc));
  863                 PROC_LOCK(p);
  864         } else {
  865                 _PHOLD(p);
  866                 FOREACH_THREAD_IN_PROC(p, td) {
  867                         fill_kinfo_thread(td, &kinfo_proc);
  868                         PROC_UNLOCK(p);
  869                         error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc,
  870                                            sizeof(kinfo_proc));
  871                         PROC_LOCK(p);
  872                         if (error)
  873                                 break;
  874                 }
  875                 _PRELE(p);
  876         }
  877         PROC_UNLOCK(p);
  878         if (error)
  879                 return (error);
  880         if (flags & KERN_PROC_ZOMBMASK)
  881                 np = zpfind(pid);
  882         else {
  883                 if (pid == 0)
  884                         return (0);
  885                 np = pfind(pid);
  886         }
  887         if (np == NULL)
  888                 return EAGAIN;
  889         if (np != p) {
  890                 PROC_UNLOCK(np);
  891                 return EAGAIN;
  892         }
  893         PROC_UNLOCK(np);
  894         return (0);
  895 }
  896 
  897 static int
  898 sysctl_kern_proc(SYSCTL_HANDLER_ARGS)
  899 {
  900         int *name = (int*) arg1;
  901         u_int namelen = arg2;
  902         struct proc *p;
  903         int flags, doingzomb;
  904         int error = 0;
  905 
  906         if (oidp->oid_number == KERN_PROC_PID) {
  907                 if (namelen != 1) 
  908                         return (EINVAL);
  909                 p = pfind((pid_t)name[0]);
  910                 if (!p)
  911                         return (ESRCH);
  912                 if ((error = p_cansee(curthread, p))) {
  913                         PROC_UNLOCK(p);
  914                         return (error);
  915                 }
  916                 error = sysctl_out_proc(p, req, KERN_PROC_NOTHREADS);
  917                 return (error);
  918         }
  919 
  920         switch (oidp->oid_number) {
  921         case KERN_PROC_ALL:
  922                 if (namelen != 0)
  923                         return (EINVAL);
  924                 break;
  925         case KERN_PROC_PROC:
  926                 if (namelen != 0 && namelen != 1)
  927                         return (EINVAL);
  928                 break;
  929         default:
  930                 if (namelen != 1)
  931                         return (EINVAL);
  932                 break;
  933         }
  934         
  935         if (!req->oldptr) {
  936                 /* overestimate by 5 procs */
  937                 error = SYSCTL_OUT(req, 0, sizeof (struct kinfo_proc) * 5);
  938                 if (error)
  939                         return (error);
  940         }
  941         sysctl_wire_old_buffer(req, 0);
  942         sx_slock(&allproc_lock);
  943         for (doingzomb=0 ; doingzomb < 2 ; doingzomb++) {
  944                 if (!doingzomb)
  945                         p = LIST_FIRST(&allproc);
  946                 else
  947                         p = LIST_FIRST(&zombproc);
  948                 for (; p != 0; p = LIST_NEXT(p, p_list)) {
  949                         /*
  950                          * Skip embryonic processes.
  951                          */
  952                         mtx_lock_spin(&sched_lock);
  953                         if (p->p_state == PRS_NEW) {
  954                                 mtx_unlock_spin(&sched_lock);
  955                                 continue;
  956                         }
  957                         mtx_unlock_spin(&sched_lock);
  958                         PROC_LOCK(p);
  959                         /*
  960                          * Show a user only appropriate processes.
  961                          */
  962                         if (p_cansee(curthread, p)) {
  963                                 PROC_UNLOCK(p);
  964                                 continue;
  965                         }
  966                         flags = 0;
  967                         /*
  968                          * TODO - make more efficient (see notes below).
  969                          * do by session.
  970                          */
  971                         switch (oidp->oid_number) {
  972 
  973                         case KERN_PROC_PGRP:
  974                                 /* could do this by traversing pgrp */
  975                                 if (p->p_pgrp == NULL || 
  976                                     p->p_pgrp->pg_id != (pid_t)name[0]) {
  977                                         PROC_UNLOCK(p);
  978                                         continue;
  979                                 }
  980                                 break;
  981 
  982                         case KERN_PROC_TTY:
  983                                 if ((p->p_flag & P_CONTROLT) == 0 ||
  984                                     p->p_session == NULL) {
  985                                         PROC_UNLOCK(p);
  986                                         continue;
  987                                 }
  988                                 SESS_LOCK(p->p_session);
  989                                 if (p->p_session->s_ttyp == NULL ||
  990                                     dev2udev(p->p_session->s_ttyp->t_dev) != 
  991                                     (udev_t)name[0]) {
  992                                         SESS_UNLOCK(p->p_session);
  993                                         PROC_UNLOCK(p);
  994                                         continue;
  995                                 }
  996                                 SESS_UNLOCK(p->p_session);
  997                                 break;
  998 
  999                         case KERN_PROC_UID:
 1000                                 if (p->p_ucred == NULL || 
 1001                                     p->p_ucred->cr_uid != (uid_t)name[0]) {
 1002                                         PROC_UNLOCK(p);
 1003                                         continue;
 1004                                 }
 1005                                 break;
 1006 
 1007                         case KERN_PROC_RUID:
 1008                                 if (p->p_ucred == NULL || 
 1009                                     p->p_ucred->cr_ruid != (uid_t)name[0]) {
 1010                                         PROC_UNLOCK(p);
 1011                                         continue;
 1012                                 }
 1013                                 break;
 1014 
 1015                         case KERN_PROC_PROC:
 1016                                 flags |= KERN_PROC_NOTHREADS;
 1017                                 break;
 1018 
 1019                         default:
 1020                                 break;
 1021 
 1022                         }
 1023 
 1024                         error = sysctl_out_proc(p, req, flags | doingzomb);
 1025                         if (error) {
 1026                                 sx_sunlock(&allproc_lock);
 1027                                 return (error);
 1028                         }
 1029                 }
 1030         }
 1031         sx_sunlock(&allproc_lock);
 1032         return (0);
 1033 }
 1034 
 1035 struct pargs *
 1036 pargs_alloc(int len)
 1037 {
 1038         struct pargs *pa;
 1039 
 1040         MALLOC(pa, struct pargs *, sizeof(struct pargs) + len, M_PARGS,
 1041                 M_WAITOK);
 1042         pa->ar_ref = 1;
 1043         pa->ar_length = len;
 1044         return (pa);
 1045 }
 1046 
 1047 void
 1048 pargs_free(struct pargs *pa)
 1049 {
 1050 
 1051         FREE(pa, M_PARGS);
 1052 }
 1053 
 1054 void
 1055 pargs_hold(struct pargs *pa)
 1056 {
 1057 
 1058         if (pa == NULL)
 1059                 return;
 1060         PARGS_LOCK(pa);
 1061         pa->ar_ref++;
 1062         PARGS_UNLOCK(pa);
 1063 }
 1064 
 1065 void
 1066 pargs_drop(struct pargs *pa)
 1067 {
 1068 
 1069         if (pa == NULL)
 1070                 return;
 1071         PARGS_LOCK(pa);
 1072         if (--pa->ar_ref == 0) {
 1073                 PARGS_UNLOCK(pa);
 1074                 pargs_free(pa);
 1075         } else
 1076                 PARGS_UNLOCK(pa);
 1077 }
 1078 
 1079 /*
 1080  * This sysctl allows a process to retrieve the argument list or process
 1081  * title for another process without groping around in the address space
 1082  * of the other process.  It also allow a process to set its own "process 
 1083  * title to a string of its own choice.
 1084  */
 1085 static int
 1086 sysctl_kern_proc_args(SYSCTL_HANDLER_ARGS)
 1087 {
 1088         int *name = (int*) arg1;
 1089         u_int namelen = arg2;
 1090         struct pargs *newpa, *pa;
 1091         struct proc *p;
 1092         int error = 0;
 1093 
 1094         if (namelen != 1) 
 1095                 return (EINVAL);
 1096 
 1097         p = pfind((pid_t)name[0]);
 1098         if (!p)
 1099                 return (ESRCH);
 1100 
 1101         if ((!ps_argsopen) && (error = p_cansee(curthread, p))) {
 1102                 PROC_UNLOCK(p);
 1103                 return (error);
 1104         }
 1105 
 1106         if (req->newptr && curproc != p) {
 1107                 PROC_UNLOCK(p);
 1108                 return (EPERM);
 1109         }
 1110 
 1111         pa = p->p_args;
 1112         pargs_hold(pa);
 1113         PROC_UNLOCK(p);
 1114         if (req->oldptr != NULL && pa != NULL)
 1115                 error = SYSCTL_OUT(req, pa->ar_args, pa->ar_length);
 1116         pargs_drop(pa);
 1117         if (error != 0 || req->newptr == NULL)
 1118                 return (error);
 1119 
 1120         if (req->newlen + sizeof(struct pargs) > ps_arg_cache_limit)
 1121                 return (ENOMEM);
 1122         newpa = pargs_alloc(req->newlen);
 1123         error = SYSCTL_IN(req, newpa->ar_args, req->newlen);
 1124         if (error != 0) {
 1125                 pargs_free(newpa);
 1126                 return (error);
 1127         }
 1128         PROC_LOCK(p);
 1129         pa = p->p_args;
 1130         p->p_args = newpa;
 1131         PROC_UNLOCK(p);
 1132         pargs_drop(pa);
 1133         return (0);
 1134 }
 1135 
 1136 static int
 1137 sysctl_kern_proc_sv_name(SYSCTL_HANDLER_ARGS)
 1138 {
 1139         struct proc *p;
 1140         char *sv_name;
 1141         int *name;
 1142         int namelen;
 1143         int error;
 1144 
 1145         namelen = arg2;
 1146         if (namelen != 1) 
 1147                 return (EINVAL);
 1148 
 1149         name = (int *)arg1;
 1150         if ((p = pfind((pid_t)name[0])) == NULL)
 1151                 return (ESRCH);
 1152         if ((error = p_cansee(curthread, p))) {
 1153                 PROC_UNLOCK(p);
 1154                 return (error);
 1155         }
 1156         sv_name = p->p_sysent->sv_name;
 1157         PROC_UNLOCK(p);
 1158         return (sysctl_handle_string(oidp, sv_name, 0, req));
 1159 }
 1160 
 1161 
 1162 SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD,  0, "Process table");
 1163 
 1164 SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT,
 1165         0, 0, sysctl_kern_proc, "S,proc", "Return entire process table");
 1166 
 1167 SYSCTL_NODE(_kern_proc, KERN_PROC_PGRP, pgrp, CTLFLAG_RD, 
 1168         sysctl_kern_proc, "Process table");
 1169 
 1170 SYSCTL_NODE(_kern_proc, KERN_PROC_TTY, tty, CTLFLAG_RD, 
 1171         sysctl_kern_proc, "Process table");
 1172 
 1173 SYSCTL_NODE(_kern_proc, KERN_PROC_UID, uid, CTLFLAG_RD, 
 1174         sysctl_kern_proc, "Process table");
 1175 
 1176 SYSCTL_NODE(_kern_proc, KERN_PROC_RUID, ruid, CTLFLAG_RD, 
 1177         sysctl_kern_proc, "Process table");
 1178 
 1179 SYSCTL_NODE(_kern_proc, KERN_PROC_PID, pid, CTLFLAG_RD, 
 1180         sysctl_kern_proc, "Process table");
 1181 
 1182 SYSCTL_NODE(_kern_proc, KERN_PROC_PROC, proc, CTLFLAG_RD,
 1183         sysctl_kern_proc, "Return process table, no threads");
 1184 
 1185 SYSCTL_NODE(_kern_proc, KERN_PROC_ARGS, args, CTLFLAG_RW | CTLFLAG_ANYBODY,
 1186         sysctl_kern_proc_args, "Process argument list");
 1187 
 1188 SYSCTL_NODE(_kern_proc, KERN_PROC_SV_NAME, sv_name, CTLFLAG_RD,
 1189         sysctl_kern_proc_sv_name, "Process syscall vector name (ABI type)");

Cache object: f1d7d94c9f37979e1b275eb49a50b4c7


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.