version 1.225, 2006/07/30 21:58:11 |
version 1.225.4.5, 2006/11/18 21:39:47 |
|
|
/* $NetBSD$ */ |
/* $NetBSD$ */ |
|
|
/*- |
/*- |
|
* Copyright (c) 2006 The NetBSD Foundation, Inc. |
|
* All rights reserved. |
|
* |
|
* This code is derived from software contributed to The NetBSD Foundation |
|
* by Andrew Doran. |
|
* |
|
* Redistribution and use in source and binary forms, with or without |
|
* modification, are permitted provided that the following conditions |
|
* are met: |
|
* 1. Redistributions of source code must retain the above copyright |
|
* notice, this list of conditions and the following disclaimer. |
|
* 2. Redistributions in binary form must reproduce the above copyright |
|
* notice, this list of conditions and the following disclaimer in the |
|
* documentation and/or other materials provided with the distribution. |
|
* 3. All advertising materials mentioning features or use of this software |
|
* must display the following acknowledgement: |
|
* This product includes software developed by the NetBSD |
|
* Foundation, Inc. and its contributors. |
|
* 4. Neither the name of The NetBSD Foundation nor the names of its |
|
* contributors may be used to endorse or promote products derived |
|
* from this software without specific prior written permission. |
|
* |
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
* POSSIBILITY OF SUCH DAMAGE. |
|
*/ |
|
|
|
/*- |
* Copyright (c) 1986, 1989, 1991, 1993 |
* Copyright (c) 1986, 1989, 1991, 1993 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
* (c) UNIX System Laboratories, Inc. |
* (c) UNIX System Laboratories, Inc. |
|
|
|
|
#include <machine/proc.h> /* Machine-dependent proc substruct */ |
#include <machine/proc.h> /* Machine-dependent proc substruct */ |
#include <sys/lock.h> |
#include <sys/lock.h> |
|
#include <sys/rwlock.h> |
|
#include <sys/mutex.h> |
|
#include <sys/condvar.h> |
#include <sys/lwp.h> |
#include <sys/lwp.h> |
#include <sys/queue.h> |
#include <sys/queue.h> |
#include <sys/callout.h> |
#include <sys/callout.h> |
#include <sys/signalvar.h> |
#include <sys/signalvar.h> |
#include <sys/siginfo.h> |
#include <sys/siginfo.h> |
#include <sys/event.h> |
#include <sys/event.h> |
|
#include <sys/specificdata.h> |
|
|
#ifndef _KERNEL |
#ifndef _KERNEL |
#include <sys/time.h> |
#include <sys/time.h> |
|
|
/* Signal sending function */ |
/* Signal sending function */ |
void (*e_sendsig)(const struct ksiginfo *, |
void (*e_sendsig)(const struct ksiginfo *, |
const sigset_t *); |
const sigset_t *); |
void (*e_trapsignal)(struct lwp *, const struct ksiginfo *); |
void (*e_trapsignal)(struct lwp *, struct ksiginfo *); |
int (*e_tracesig)(struct proc *, int); |
int (*e_tracesig)(struct proc *, int); |
char *e_sigcode; /* Start of sigcode */ |
char *e_sigcode; /* Start of sigcode */ |
char *e_esigcode; /* End of sigcode */ |
char *e_esigcode; /* End of sigcode */ |
|
|
* Field markings and the corresponding locks (not yet fully implemented, |
* Field markings and the corresponding locks (not yet fully implemented, |
* more a statement of intent): |
* more a statement of intent): |
* |
* |
* c: P_CRLOCK - credentials write lock |
* m: proclist_mutex |
* l: proclist_lock |
* l: proclist_lock |
* p: p->p_lock |
* s: p_smutex |
* s: sched_lock |
* p: p_mutex |
|
* r: p_rasmutex |
|
* x: proc_stop_mutex |
|
* (: unlocked, stable |
*/ |
*/ |
struct proc { |
struct proc { |
LIST_ENTRY(proc) p_list; /* l: List of all processes */ |
LIST_ENTRY(proc) p_list; /* l, m: List of all processes */ |
|
|
|
kmutex_t p_rasmutex; /* :: RAS mutex */ |
|
kmutex_t p_mutex; /* :: general mutex */ |
|
kmutex_t p_smutex; /* :: Mutex on scheduling state */ |
|
kcondvar_t p_refcv; /* p: reference count CV */ |
|
kcondvar_t p_waitcv; /* s: wait() CV on children */ |
|
int p_refcnt; /* p: ref count for procfs etc */ |
|
|
/* Substructures: */ |
/* Substructures: */ |
struct kauth_cred *p_cred; /* p, c: Master copy of credentials */ |
struct kauth_cred *p_cred; /* p: Master copy of credentials */ |
struct filedesc *p_fd; /* Ptr to open files structure */ |
struct filedesc *p_fd; /* Ptr to open files structure */ |
struct cwdinfo *p_cwdi; /* cdir/rdir/cmask info */ |
struct cwdinfo *p_cwdi; /* cdir/rdir/cmask info */ |
struct pstats *p_stats; /* Accounting/statistics (PROC ONLY) */ |
struct pstats *p_stats; /* Accounting/stats (PROC ONLY) */ |
struct plimit *p_limit; /* Process limits */ |
struct plimit *p_limit; /* Process limits */ |
struct vmspace *p_vmspace; /* Address space */ |
struct vmspace *p_vmspace; /* Address space */ |
struct sigacts *p_sigacts; /* Process sigactions (state is below)*/ |
struct sigacts *p_sigacts; /* Process sigactions */ |
|
|
void *p_ksems; /* p1003.1b semaphores */ |
specificdata_reference |
#define p_rlimit p_limit->pl_rlimit |
p_specdataref; /* subsystem proc-specific data */ |
|
|
int p_exitsig; /* signal to send to parent on exit */ |
int p_exitsig; /* l: signal to send to parent on exit */ |
int p_flag; /* P_* flags. */ |
int p_flag; /* p: P_* flags */ |
char p_stat; /* S* process status. */ |
int p_sflag; /* s: PS_* flags */ |
|
int p_slflag; /* s, l: PSL_* flags */ |
|
int p_lflag; /* l: PL_* flags */ |
|
char p_stat; /* s: S* process status. */ |
char p_pad1[3]; |
char p_pad1[3]; |
|
|
pid_t p_pid; /* Process identifier. */ |
pid_t p_pid; /* (: Process identifier. */ |
LIST_ENTRY(proc) p_pglist; /* l: List of processes in pgrp. */ |
LIST_ENTRY(proc) p_pglist; /* l: List of processes in pgrp. */ |
struct proc *p_pptr; /* l: Pointer to parent process. */ |
struct proc *p_pptr; /* l: Pointer to parent process. */ |
LIST_ENTRY(proc) p_sibling; /* l: List of sibling processes. */ |
LIST_ENTRY(proc) p_sibling; /* l: List of sibling processes. */ |
LIST_HEAD(, proc) p_children; /* l: Pointer to list of children. */ |
LIST_HEAD(, proc) p_children; /* l: Pointer to list of children. */ |
|
LIST_HEAD(, lwp) p_lwps; /* s: Pointer to list of LWPs. */ |
struct simplelock p_lock; /* Lock on proc state (p:) */ |
LIST_HEAD(, ras) p_raslist; /* r: Pointer to RAS queue */ |
|
|
/* XXX dsl: locking of LWP info is suspect in schedcpu and kpsignal2 */ |
|
LIST_HEAD(, lwp) p_lwps; /* p: Pointer to list of LWPs. */ |
|
|
|
LIST_HEAD(, ras) p_raslist; /* p: Pointer to RAS queue */ |
|
|
|
/* The following fields are all zeroed upon creation in fork. */ |
/* The following fields are all zeroed upon creation in fork. */ |
#define p_startzero p_nlwps |
#define p_startzero p_nlwps |
|
|
int p_nlwps; /* p: Number of LWPs */ |
int p_nlwps; /* s: Number of LWPs */ |
int p_nrlwps; /* s: Number of running LWPs */ |
int p_nzlwps; /* s: Number of zombie LWPs */ |
int p_nzlwps; /* p: Number of zombie LWPs */ |
int p_nrlwps; /* s: Number running/sleeping LWPs */ |
int p_nlwpid; /* p: Next LWP ID */ |
int p_nlwpwait; /* s: Number of LWPs in lwp_wait1() */ |
|
int p_nlwpid; /* s: Next LWP ID */ |
u_int p_nstopchild; /* l: Count of stopped/dead children */ |
u_int p_nstopchild; /* x: Count of stopped/dead children */ |
|
|
struct sadata *p_sa; /* Scheduler activation information */ |
struct sadata *p_sa; /* Scheduler activation infor */ |
|
|
/* scheduling */ |
/* scheduling */ |
fixpt_t p_estcpu; /* Time averaged value of p_cpticks XXX belongs in p_startcopy section */ |
fixpt_t p_estcpu; /* Time averaged value of p_cpticks XXX belongs in p_startcopy section */ |
fixpt_t p_estcpu_inherited; |
fixpt_t p_estcpu_inherited; |
unsigned int p_forktime; |
unsigned int p_forktime; |
int p_cpticks; /* Ticks of CPU time */ |
int p_cpticks; /* Ticks of CPU time */ |
fixpt_t p_pctcpu; /* %cpu for this process during p_swtime */ |
fixpt_t p_pctcpu; /* %cpu for this process during p_swtime */ |
|
|
struct proc *p_opptr; /* Save parent during ptrace. */ |
struct proc *p_opptr; /* l: save parent during ptrace. */ |
struct ptimers *p_timers; /* Timers: real, virtual, profiling */ |
struct ptimers *p_timers; /* Timers: real, virtual, profiling */ |
struct timeval p_rtime; /* Real time */ |
u_quad_t p_uticks; /* Statclock hits in user mode */ |
u_quad_t p_uticks; /* Statclock hits in user mode */ |
u_quad_t p_sticks; /* Statclock hits in system mode */ |
u_quad_t p_sticks; /* Statclock hits in system mode */ |
u_quad_t p_iticks; /* Statclock hits processing intr */ |
u_quad_t p_iticks; /* Statclock hits processing intr */ |
|
|
int p_traceflag; /* Kernel trace points */ |
int p_traceflag; /* Kernel trace points */ |
void *p_tracep; /* Trace private data */ |
void *p_tracep; /* Trace private data */ |
void *p_systrace; /* Back pointer to systrace */ |
void *p_systrace; /* Back pointer to systrace */ |
|
|
struct vnode *p_textvp; /* Vnode of executable */ |
struct vnode *p_textvp; /* Vnode of executable */ |
|
|
const struct emul *p_emul; /* Emulation information */ |
const struct emul *p_emul; /* Emulation information */ |
void *p_emuldata; /* Per-process emulation data, or NULL. |
void *p_emuldata; /* Per-process emulation data, or NULL. |
* Malloc type M_EMULDATA |
* Malloc type M_EMULDATA |
|
*/ |
*/ |
|
|
void (*p_userret)(struct lwp *, void *); |
void (*p_userret)(struct lwp *, void *); |
/* Function to call at userret(). */ |
/* Function to call at userret(). */ |
void *p_userret_arg; |
void *p_userret_arg; |
|
|
const struct execsw *p_execsw; /* Exec package information */ |
const struct execsw *p_execsw; /* Exec package information */ |
struct klist p_klist; /* Knotes attached to this process */ |
struct klist p_klist; /* Knotes attached to this process */ |
|
|
|
LIST_HEAD(, lwp) p_sigwaiters; /* s: LWPs waiting for signals */ |
|
sigstore_t p_sigstore; /* s: process-wide signal state */ |
|
|
|
|
/* |
/* |
* End area that is zeroed on creation |
* End area that is zeroed on creation |
|
|
/* |
/* |
* The following fields are all copied upon creation in fork. |
* The following fields are all copied upon creation in fork. |
*/ |
*/ |
#define p_startcopy p_sigctx.ps_startcopy |
#define p_startcopy p_sigctx |
|
|
struct sigctx p_sigctx; /* Signal state */ |
|
|
|
u_char p_nice; /* Process "nice" value */ |
struct sigctx p_sigctx; /* s: Shared signal state */ |
char p_comm[MAXCOMLEN+1]; /* basename of last exec file */ |
|
|
|
struct pgrp *p_pgrp; /* Pointer to process group */ |
u_char p_nice; /* s: Process "nice" value */ |
|
char p_comm[MAXCOMLEN+1]; |
struct ps_strings *p_psstr; /* address of process's ps_strings */ |
/* p: basename of last exec file */ |
size_t p_psargv; /* offset of ps_argvstr in above */ |
struct pgrp *p_pgrp; /* l: Pointer to process group */ |
size_t p_psnargv; /* offset of ps_nargvstr in above */ |
|
size_t p_psenv; /* offset of ps_envstr in above */ |
struct ps_strings *p_psstr; /* (: address of process's ps_strings */ |
size_t p_psnenv; /* offset of ps_nenvstr in above */ |
size_t p_psargv; /* (: offset of ps_argvstr in above */ |
|
size_t p_psnargv; /* (: offset of ps_nargvstr in above */ |
|
size_t p_psenv; /* (: offset of ps_envstr in above */ |
|
size_t p_psnenv; /* (: offset of ps_nenvstr in above */ |
|
|
/* |
/* |
* End area that is copied on creation |
* End area that is copied on creation |
*/ |
*/ |
#define p_endcopy p_xstat |
#define p_endcopy p_xstat |
|
|
u_short p_xstat; /* Exit status for wait; also stop signal */ |
u_short p_xstat; /* s: Exit status for wait; also stop signal */ |
u_short p_acflag; /* p: Acc. flags; see struct lwp also */ |
u_short p_acflag; /* p: Acc. flags; see struct lwp also */ |
struct rusage *p_ru; /* Exit information. XXX */ |
struct rusage *p_ru; /* Exit information. XXX */ |
|
|
struct mdproc p_md; /* Any machine-dependent fields */ |
struct mdproc p_md; /* Any machine-dependent fields */ |
}; |
}; |
|
|
|
#define p_rlimit p_limit->pl_rlimit |
#define p_session p_pgrp->pg_session |
#define p_session p_pgrp->pg_session |
#define p_pgid p_pgrp->pg_id |
#define p_pgid p_pgrp->pg_id |
|
#define p_sigpend p_sigstore.ss_pend |
|
|
/* |
/* |
* Status values. |
* Status values. |
* |
|
*/ |
*/ |
#define SIDL 1 /* Process being created by fork */ |
#define SIDL 1 /* Process being created by fork */ |
#define SACTIVE 2 /* Process is not stopped */ |
#define SACTIVE 2 /* Process is not stopped */ |
|
#define SDYING 3 /* About to die */ |
#define SSTOP 4 /* Process debugging or suspension */ |
#define SSTOP 4 /* Process debugging or suspension */ |
#define SZOMB 5 /* Awaiting collection by parent */ |
#define SZOMB 5 /* Awaiting collection by parent */ |
|
#define SDEAD 6 /* Almost a zombie */ |
|
|
#define P_ZOMBIE(p) ((p)->p_stat == SZOMB) |
#define P_ZOMBIE(p) ((p)->p_stat == SZOMB) |
|
|
/* These flags are kept in p_flag. */ |
/* |
|
* These flags are kept in p_flag and are protected by p_mutex. Access from |
|
* process context only. |
|
*/ |
#define P_ADVLOCK 0x00000001 /* Process may hold a POSIX advisory lock */ |
#define P_ADVLOCK 0x00000001 /* Process may hold a POSIX advisory lock */ |
#define P_CONTROLT 0x00000002 /* Has a controlling terminal */ |
|
#define P_INMEM /* 0x00000004 */ L_INMEM |
#define P_INMEM /* 0x00000004 */ L_INMEM |
#define P_NOCLDSTOP 0x00000008 /* No SIGCHLD when children stop */ |
|
#define P_PPWAIT 0x00000010 /* Parent is waiting for child exec/exit */ |
|
#define P_PROFIL 0x00000020 /* Has started profiling */ |
|
#define P_SELECT /* 0x00000040 */ L_SELECT |
#define P_SELECT /* 0x00000040 */ L_SELECT |
#define P_SINTR /* 0x00000080 */ L_SINTR |
#define P_SINTR /* 0x00000080 */ L_SINTR |
#define P_SUGID 0x00000100 /* Had set id privileges since last exec */ |
#define P_SUGID 0x00000100 /* Had set id privileges since last exec */ |
#define P_SYSTEM 0x00000200 /* System proc: no sigs, stats or swapping */ |
#define P_SYSTEM /* 0x00000200 */ L_SYSTEM |
#define P_SA /* 0x00000400 */ L_SA |
#define P_SA /* 0x00000400 */ L_SA /* XXXAD */ |
#define P_TRACED 0x00000800 /* Debugged process being traced */ |
|
#define P_WAITED 0x00001000 /* Debugging process has waited for child */ |
|
#define P_WEXIT 0x00002000 /* Working on exiting */ |
|
#define P_EXEC 0x00004000 /* Process called exec */ |
#define P_EXEC 0x00004000 /* Process called exec */ |
#define P_OWEUPC 0x00008000 /* Owe process an addupc() at next ast */ |
|
#define P_FSTRACE 0x00010000 /* Debugger process being traced by procfs */ |
|
#define P_NOCLDWAIT 0x00020000 /* No zombies if child dies */ |
#define P_NOCLDWAIT 0x00020000 /* No zombies if child dies */ |
#define P_32 0x00040000 /* 32-bit process (used on 64-bit kernels) */ |
#define P_32 0x00040000 /* 32-bit process (used on 64-bit kernels) */ |
#define P_CLDSIGIGN 0x00080000 /* Process is ignoring SIGCHLD */ |
#define P_CLDSIGIGN 0x00080000 /* Process is ignoring SIGCHLD */ |
#define P_INEXEC 0x00100000 /* Process is exec'ing and can't be traced */ |
|
#define P_SYSTRACE 0x00200000 /* Process system call tracing active */ |
#define P_SYSTRACE 0x00200000 /* Process system call tracing active */ |
#define P_CHTRACED 0x00400000 /* Child has been traced & reparented */ |
|
#define P_STOPFORK 0x00800000 /* Child will be stopped on fork(2) */ |
|
#define P_STOPEXEC 0x01000000 /* Will be stopped on exec(2) */ |
|
#define P_STOPEXIT 0x02000000 /* Will be stopped at process exit */ |
|
#define P_SYSCALL 0x04000000 /* process has PT_SYSCALL enabled */ |
|
#define P_PAXMPROTECT 0x08000000 /* Explicitly enable PaX MPROTECT */ |
#define P_PAXMPROTECT 0x08000000 /* Explicitly enable PaX MPROTECT */ |
#define P_PAXNOMPROTECT 0x10000000 /* Explicitly disable PaX MPROTECT */ |
#define P_PAXNOMPROTECT 0x10000000 /* Explicitly disable PaX MPROTECT */ |
#define P_CRLOCK 0x20000000 /* p_cred write lock */ |
|
#define P_UNUSED1 0x40000000 |
|
#define P_MARKER 0x80000000 /* Is a dummy marker process */ |
#define P_MARKER 0x80000000 /* Is a dummy marker process */ |
|
|
#define P_SHARED (L_INMEM|L_SELECT|L_SINTR|L_SA) |
#define P_SHARED (L_INMEM|L_SELECT|L_SINTR|L_SYSTEM|L_SA) |
|
|
|
/* |
|
* These flags are kept in p_sflag and are protected by p_smutex. Access from |
|
* process context or interrupt context. |
|
*/ |
|
#define PS_NOCLDSTOP 0x00000008 /* No SIGCHLD when children stop */ |
|
#define PS_PPWAIT 0x00000010 /* Parent is waiting for child exec/exit */ |
|
#define PS_PROFIL 0x00000020 /* Has started profiling */ |
|
#define PS_SA /* 0x00000400 */ L_SA |
|
#define PS_WEXIT 0x00002000 /* Working on exiting */ |
|
#define PS_STOPFORK 0x00800000 /* Child will be stopped on fork(2) */ |
|
#define PS_STOPEXEC 0x01000000 /* Will be stopped on exec(2) */ |
|
#define PS_STOPEXIT 0x02000000 /* Will be stopped at process exit */ |
|
#define PS_ORPHANPG 0x20000000 /* Member of an orphaned pgrp */ |
|
#define PS_NOSA 0x40000000 /* Do not enable SA */ |
|
|
|
/* |
|
* These flags are kept in p_sflag and are protected by the proclist_lock |
|
* and p_smutex. Access from process context or interrupt context. |
|
*/ |
|
#define PSL_TRACED 0x00000800 /* Debugged process being traced */ |
|
#define PSL_FSTRACE 0x00010000 /* Debugger process being traced by procfs */ |
|
#define PSL_CHTRACED 0x00400000 /* Child has been traced & reparented */ |
|
#define PSL_SYSCALL 0x04000000 /* process has PT_SYSCALL enabled */ |
|
|
|
/* |
|
* The final set are protected by the proclist_lock. Access |
|
* from process context only. |
|
*/ |
|
#define PL_WAITED 0x00001000 /* Debug proc has waited for child */ |
|
#define PL_CONTROLT 0x00000002 /* Has a controlling terminal */ |
|
|
/* |
/* |
* Macro to compute the exit signal to be delivered. |
* Macro to compute the exit signal to be delivered. |
*/ |
*/ |
#define P_EXITSIG(p) (((p)->p_flag & (P_TRACED|P_FSTRACE)) ? SIGCHLD : \ |
#define P_EXITSIG(p) \ |
p->p_exitsig) |
(((p)->p_slflag & (PSL_TRACED|PSL_FSTRACE)) ? SIGCHLD : p->p_exitsig) |
|
|
/* |
/* |
* MOVE TO ucred.h? |
* MOVE TO ucred.h? |
|
|
#define FORK_SHARESIGS 0x10 /* Share signal actions */ |
#define FORK_SHARESIGS 0x10 /* Share signal actions */ |
#define FORK_NOWAIT 0x20 /* Make init the parent of the child */ |
#define FORK_NOWAIT 0x20 /* Make init the parent of the child */ |
#define FORK_CLEANFILES 0x40 /* Start with a clean descriptor set */ |
#define FORK_CLEANFILES 0x40 /* Start with a clean descriptor set */ |
|
#define FORK_SYSTEM 0x80 /* Fork a kernel thread */ |
|
|
/* |
/* |
* Allow machine-dependent code to override curproc in <machine/cpu.h> for |
* Allow machine-dependent code to override curproc in <machine/cpu.h> for |
Line 427 extern struct proc proc0; /* Process sl |
|
Line 499 extern struct proc proc0; /* Process sl |
|
extern int nprocs, maxproc; /* Current and max number of procs */ |
extern int nprocs, maxproc; /* Current and max number of procs */ |
#define vmspace_kernel() (proc0.p_vmspace) |
#define vmspace_kernel() (proc0.p_vmspace) |
|
|
/* Process list lock; see kern_proc.c for locking protocol details */ |
/* Process list locks; see kern_proc.c for locking protocol details */ |
extern struct lock proclist_lock; |
extern krwlock_t proclist_lock; |
|
extern kmutex_t proclist_mutex; |
|
extern kmutex_t proc_stop_mutex; |
|
|
extern struct proclist allproc; /* List of all processes */ |
extern struct proclist allproc; /* List of all processes */ |
extern struct proclist zombproc; /* List of zombie processes */ |
extern struct proclist zombproc; /* List of zombie processes */ |
Line 459 struct pgrp *pg_find(pid_t, uint); /* Fi |
|
Line 533 struct pgrp *pg_find(pid_t, uint); /* Fi |
|
#define pgfind(pgid) pg_find((pgid), PFIND_UNLOCK) |
#define pgfind(pgid) pg_find((pgid), PFIND_UNLOCK) |
|
|
struct simplelock; |
struct simplelock; |
int enterpgrp(struct proc *, pid_t, int); |
int enterpgrp(struct proc *, pid_t, pid_t, int); |
|
void leavepgrp(struct proc *); |
void fixjobc(struct proc *, struct pgrp *, int); |
void fixjobc(struct proc *, struct pgrp *, int); |
int inferior(struct proc *, struct proc *); |
int inferior(struct proc *, struct proc *); |
int leavepgrp(struct proc *); |
|
void sessdelete(struct session *); |
void sessdelete(struct session *); |
void yield(void); |
void yield(void); |
struct lwp *chooselwp(void); |
|
void pgdelete(struct pgrp *); |
void pgdelete(struct pgrp *); |
void procinit(void); |
void procinit(void); |
void resetprocpriority(struct proc *); |
void resetprocpriority(struct proc *); |
void suspendsched(void); |
void suspendsched(void); |
int ltsleep(volatile const void *, int, const char *, int, |
int ltsleep(wchan_t, int, const char *, int, |
volatile struct simplelock *); |
volatile struct simplelock *); |
void wakeup(volatile const void *); |
int mtsleep(wchan_t, int, const char *, int, kmutex_t *); |
void wakeup_one(volatile const void *); |
void wakeup(wchan_t); |
|
void wakeup_one(wchan_t); |
void exit1(struct lwp *, int); |
void exit1(struct lwp *, int); |
int find_stopped_child(struct proc *, pid_t, int, struct proc **); |
int find_stopped_child(struct proc *, pid_t, int, struct proc **); |
struct proc *proc_alloc(void); |
struct proc *proc_alloc(void); |
void proc0_init(void); |
void proc0_init(void); |
void proc_free(struct proc *); |
void proc_free(struct proc *, struct rusage **); |
void proc_free_mem(struct proc *); |
void proc_free_mem(struct proc *); |
void exit_lwps(struct lwp *l); |
void exit_lwps(struct lwp *l); |
int fork1(struct lwp *, int, int, void *, size_t, |
int fork1(struct lwp *, int, int, void *, size_t, |
Line 504 void child_return(void *); |
|
Line 578 void child_return(void *); |
|
int proc_isunder(struct proc *, struct lwp *); |
int proc_isunder(struct proc *, struct lwp *); |
void proc_stop(struct proc *, int); |
void proc_stop(struct proc *, int); |
|
|
void proclist_lock_read(void); |
|
void proclist_unlock_read(void); |
|
int proclist_lock_write(void); |
|
void proclist_unlock_write(int); |
|
void p_sugid(struct proc *); |
void p_sugid(struct proc *); |
|
|
int proc_vmspace_getref(struct proc *, struct vmspace **); |
int proc_vmspace_getref(struct proc *, struct vmspace **); |
void proc_crmod_leave(struct proc *, kauth_cred_t, kauth_cred_t); |
void proc_crmod_leave(kauth_cred_t, kauth_cred_t); |
void proc_crmod_enter(struct proc *); |
void proc_crmod_enter(void); |
|
int proc_addref(struct proc *); |
|
void proc_delref(struct proc *); |
|
void proc_drainrefs(struct proc *); |
|
|
|
int proc_specific_key_create(specificdata_key_t *, specificdata_dtor_t); |
|
void proc_specific_key_delete(specificdata_key_t); |
|
void proc_initspecific(struct proc *); |
|
void proc_finispecific(struct proc *); |
|
void * proc_getspecific(struct proc *, specificdata_key_t); |
|
void proc_setspecific(struct proc *, specificdata_key_t, void *); |
|
|
int proclist_foreach_call(struct proclist *, |
int proclist_foreach_call(struct proclist *, |
int (*)(struct proc *, void *arg), void *); |
int (*)(struct proc *, void *arg), void *); |