FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/capsicum.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/poll.h>
#include <sys/proc.h>
#include <sys/procdesc.h>
#include <sys/resourcevar.h>
#include <sys/stat.h>
#include <sys/sysproto.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/ucred.h>
#include <sys/user.h>
#include <security/audit/audit.h>
#include <vm/uma.h>
Go to the source code of this file.
Functions | |
__FBSDID ("$FreeBSD$") | |
FEATURE (process_descriptors, "Process Descriptors") | |
MALLOC_DEFINE (M_PROCDESC, "procdesc", "process descriptors") | |
int | procdesc_find (struct thread *td, int fd, cap_rights_t *rightsp, struct proc **p) |
pid_t | procdesc_pid (struct file *fp_procdesc) |
int | kern_pdgetpid (struct thread *td, int fd, cap_rights_t *rightsp, pid_t *pidp) |
int | sys_pdgetpid (struct thread *td, struct pdgetpid_args *uap) |
void | procdesc_new (struct proc *p, int flags) |
int | procdesc_falloc (struct thread *td, struct file **resultfp, int *resultfd, int flags, struct filecaps *fcaps) |
void | procdesc_finit (struct procdesc *pdp, struct file *fp) |
static void | procdesc_free (struct procdesc *pd) |
int | procdesc_exit (struct proc *p) |
void | procdesc_reap (struct proc *p) |
static int | procdesc_close (struct file *fp, struct thread *td) |
static int | procdesc_poll (struct file *fp, int events, struct ucred *active_cred, struct thread *td) |
static void | procdesc_kqops_detach (struct knote *kn) |
static int | procdesc_kqops_event (struct knote *kn, long hint) |
static int | procdesc_kqfilter (struct file *fp, struct knote *kn) |
static int | procdesc_stat (struct file *fp, struct stat *sb, struct ucred *active_cred) |
static int | procdesc_fill_kinfo (struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) |
Variables | |
static fo_poll_t | procdesc_poll |
static fo_kqfilter_t | procdesc_kqfilter |
static fo_stat_t | procdesc_stat |
static fo_close_t | procdesc_close |
static fo_fill_kinfo_t | procdesc_fill_kinfo |
static struct fileops | procdesc_ops |
static struct filterops | procdesc_kqops |
__FBSDID | ( | "$FreeBSD$" | ) |
FEATURE | ( | process_descriptors | , |
"Process Descriptors" | |||
) |
int kern_pdgetpid | ( | struct thread * | td, |
int | fd, | ||
cap_rights_t * | rightsp, | ||
pid_t * | pidp | ||
) |
Definition at line 171 of file sys_procdesc.c.
References fd, fget(), and procdesc_pid().
Referenced by sys_pdgetpid().
MALLOC_DEFINE | ( | M_PROCDESC | , |
"procdesc" | , | ||
"process descriptors" | |||
) |
|
static |
Definition at line 351 of file sys_procdesc.c.
References badfileops, kern_psignal(), proc_add_orphan(), proc_clear_orphan(), proc_reap(), proc_reparent(), procdesc_free(), and proctree_lock.
int procdesc_exit | ( | struct proc * | p | ) |
Definition at line 287 of file sys_procdesc.c.
References procdesc_free(), proctree_lock, and selwakeup().
Referenced by exit1().
int procdesc_falloc | ( | struct thread * | td, |
struct file ** | resultfp, | ||
int * | resultfd, | ||
int | flags, | ||
struct filecaps * | fcaps | ||
) |
Definition at line 237 of file sys_procdesc.c.
References falloc_caps(), and flags.
Referenced by fork1().
|
static |
Definition at line 550 of file sys_procdesc.c.
int procdesc_find | ( | struct thread * | td, |
int | fd, | ||
cap_rights_t * | rightsp, | ||
struct proc ** | p | ||
) |
Definition at line 124 of file sys_procdesc.c.
References fd, fget(), and proctree_lock.
Referenced by sys_pdkill().
void procdesc_finit | ( | struct procdesc * | pdp, |
struct file * | fp | ||
) |
Definition at line 253 of file sys_procdesc.c.
References finit(), and procdesc_ops.
Referenced by do_fork().
|
static |
Definition at line 260 of file sys_procdesc.c.
References free(), and knlist_destroy().
Referenced by procdesc_close(), procdesc_exit(), and procdesc_reap().
|
static |
Definition at line 494 of file sys_procdesc.c.
References knlist_add(), and procdesc_kqops.
|
static |
Definition at line 444 of file sys_procdesc.c.
References knlist_remove().
|
static |
Definition at line 453 of file sys_procdesc.c.
void procdesc_new | ( | struct proc * | p, |
int | flags | ||
) |
Definition at line 212 of file sys_procdesc.c.
References flags, knlist_init_mtx(), and malloc().
Referenced by do_fork().
pid_t procdesc_pid | ( | struct file * | fp_procdesc | ) |
Definition at line 156 of file sys_procdesc.c.
Referenced by kern_pdgetpid().
|
static |
Definition at line 424 of file sys_procdesc.c.
References selrecord().
void procdesc_reap | ( | struct proc * | p | ) |
Definition at line 331 of file sys_procdesc.c.
References procdesc_free(), and proctree_lock.
Referenced by proc_reap().
|
static |
Definition at line 511 of file sys_procdesc.c.
References getboottime(), proctree_lock, and timevaladd().
int sys_pdgetpid | ( | struct thread * | td, |
struct pdgetpid_args * | uap | ||
) |
Definition at line 193 of file sys_procdesc.c.
References cap_pdgetpid_rights, and kern_pdgetpid().
|
static |
Definition at line 100 of file sys_procdesc.c.
|
static |
Definition at line 101 of file sys_procdesc.c.
|
static |
Definition at line 98 of file sys_procdesc.c.
|
static |
Definition at line 487 of file sys_procdesc.c.
Referenced by procdesc_kqfilter().
|
static |
Definition at line 103 of file sys_procdesc.c.
Referenced by procdesc_finit().
|
static |
Definition at line 97 of file sys_procdesc.c.
|
static |
Definition at line 99 of file sys_procdesc.c.