FreeBSD kernel kern code
kern_exit.c File Reference
#include <sys/cdefs.h>
#include "opt_compat.h"
#include "opt_kdtrace.h"
#include "opt_ktrace.h"
#include "opt_procdesc.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/capability.h>
#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/procdesc.h>
#include <sys/pioctl.h>
#include <sys/jail.h>
#include <sys/tty.h>
#include <sys/wait.h>
#include <sys/vmmeter.h>
#include <sys/vnode.h>
#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/sbuf.h>
#include <sys/signalvar.h>
#include <sys/sched.h>
#include <sys/sx.h>
#include <sys/syscallsubr.h>
#include <sys/syslog.h>
#include <sys/ptrace.h>
#include <sys/acct.h>
#include <sys/filedesc.h>
#include <sys/sdt.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <security/audit/audit.h>
#include <security/mac/mac_framework.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_page.h>
#include <vm/uma.h>
Include dependency graph for kern_exit.c:

Go to the source code of this file.

Data Structures

struct  abort2_args
 

Functions

 __FBSDID ("$BSDSUniX$")
 
 SDT_PROVIDER_DECLARE (proc)
 
 SDT_PROBE_DEFINE1 (proc, kernel,, exit,"int")
 
struct proc * proc_realparent (struct proc *child)
 
static void clear_orphan (struct proc *p)
 
void sys_sys_exit (struct thread *td, struct sys_exit_args *uap)
 
void exit1 (struct thread *td, int rv)
 
int sys_abort2 (struct thread *td, struct abort2_args *uap)
 
int sys_wait4 (struct thread *td, struct wait4_args *uap)
 
int sys_wait6 (struct thread *td, struct wait6_args *uap)
 
void proc_reap (struct thread *td, struct proc *p, int *status, int options)
 
static int proc_to_reap (struct thread *td, struct proc *p, idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *siginfo, int check_only)
 
int kern_wait (struct thread *td, pid_t pid, int *status, int options, struct rusage *rusage)
 
int kern_wait6 (struct thread *td, idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *siginfo)
 
void proc_reparent (struct proc *child, struct proc *parent)
 

Variables

void(* nlminfo_release_p )(struct proc *p)
 

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
static void clear_orphan ( struct proc *  p)
static

Definition at line 129 of file kern_exit.c.

References proctree_lock.

Referenced by exit1(), proc_reap(), and proc_reparent().

Here is the caller graph for this function:

int kern_wait ( struct thread *  td,
pid_t  pid,
int *  status,
int  options,
struct rusage *  rusage 
)

Definition at line 1081 of file kern_exit.c.

References kern_wait6().

Referenced by sys_wait4().

Here is the call graph for this function:

Here is the caller graph for this function:

int kern_wait6 ( struct thread *  td,
idtype_t  idtype,
id_t  id,
int *  status,
int  options,
struct __wrusage *  wrusage,
siginfo_t *  siginfo 
)

Definition at line 1122 of file kern_exit.c.

References proc_to_reap(), proctree_lock, and sigqueue_take().

Referenced by kern_wait(), and sys_wait6().

Here is the call graph for this function:

Here is the caller graph for this function:

struct proc* proc_realparent ( struct proc *  child)

Definition at line 103 of file kern_exit.c.

References initproc, parent, and proctree_lock.

Referenced by exit1(), inferior(), kern_ptrace(), and proc_reap().

Here is the caller graph for this function:

void proc_reap ( struct thread *  td,
struct proc *  p,
int *  status,
int  options 
)

Definition at line 800 of file kern_exit.c.

References allproc_lock, chgproccnt(), clear_orphan(), crfree(), leavepgrp(), nprocs, pargs_drop(), pksignal(), proc_realparent(), proc_reparent(), proc_zone, proctree_lock, racct_proc_exit(), racct_sub(), ruadd(), sigacts_free(), sigqueue_take(), thread_wait(), and wakeup().

Referenced by proc_to_reap().

Here is the call graph for this function:

Here is the caller graph for this function:

void proc_reparent ( struct proc *  child,
struct proc *  parent 
)

Definition at line 1306 of file kern_exit.c.

References clear_orphan(), parent, proctree_lock, and sigqueue_take().

Referenced by exit1(), fork_return(), kern_ptrace(), kproc_exit(), and proc_reap().

Here is the call graph for this function:

Here is the caller graph for this function:

static int proc_to_reap ( struct thread *  td,
struct proc *  p,
idtype_t  idtype,
id_t  id,
int *  status,
int  options,
struct __wrusage *  wrusage,
siginfo_t *  siginfo,
int  check_only 
)
static

Definition at line 930 of file kern_exit.c.

References calccru(), calcru(), p_canwait(), proc_reap(), and proctree_lock.

Referenced by kern_wait6().

Here is the call graph for this function:

Here is the caller graph for this function:

SDT_PROBE_DEFINE1 ( proc  ,
kernel  ,
exit  ,
"int"   
)
SDT_PROVIDER_DECLARE ( proc  )
int sys_abort2 ( struct thread *  td,
struct abort2_args uap 
)
void sys_sys_exit ( struct thread *  td,
struct sys_exit_args *  uap 
)

Definition at line 150 of file kern_exit.c.

References exit1().

Here is the call graph for this function:

int sys_wait4 ( struct thread *  td,
struct wait4_args *  uap 
)

Definition at line 739 of file kern_exit.c.

References kern_wait().

Here is the call graph for this function:

int sys_wait6 ( struct thread *  td,
struct wait6_args *  uap 
)

Definition at line 757 of file kern_exit.c.

References kern_wait6().

Here is the call graph for this function:

Variable Documentation

void(* nlminfo_release_p) (struct proc *p)

Definition at line 100 of file kern_exit.c.

Referenced by exit1().