Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_descrip.c
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#include <sys/sx.h> | #include <sys/sx.h> | ||||
#include <sys/syscallsubr.h> | #include <sys/syscallsubr.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/sysproto.h> | #include <sys/sysproto.h> | ||||
#include <sys/unistd.h> | #include <sys/unistd.h> | ||||
#include <sys/user.h> | #include <sys/user.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#ifdef KTRACE | |||||
#include <sys/ktrace.h> | #include <sys/ktrace.h> | ||||
#endif | |||||
markj: Sort? | |||||
Done Inline ActionsUnfortunately no. ktrace.h is not self contained, the trace structures basically gather a lot of stuff from misc. syscalls declarations. And if some things like enum uio_rw can be handled by inclusion on sys/_uio.h, others e.g. sig_t cannot be handled reasonable except inclusion of signalvar.h before ktrace.h. So this header is outlier. kib: Unfortunately no. ktrace.h is not self contained, the trace structures basically gather a lot… | |||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <security/audit/audit.h> | #include <security/audit/audit.h> | ||||
#include <vm/uma.h> | #include <vm/uma.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <ddb/ddb.h> | #include <ddb/ddb.h> | ||||
▲ Show 20 Lines • Show All 4,264 Lines • ▼ Show 20 Lines | kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, | ||||
struct vnode *cttyvp, *textvp, *tracevp; | struct vnode *cttyvp, *textvp, *tracevp; | ||||
struct pwd *pwd; | struct pwd *pwd; | ||||
int error, i, lastfile; | int error, i, lastfile; | ||||
cap_rights_t rights; | cap_rights_t rights; | ||||
PROC_LOCK_ASSERT(p, MA_OWNED); | PROC_LOCK_ASSERT(p, MA_OWNED); | ||||
/* ktrace vnode */ | /* ktrace vnode */ | ||||
tracevp = p->p_tracevp; | tracevp = ktr_get_tracevp(p, true); | ||||
if (tracevp != NULL) | |||||
vrefact(tracevp); | |||||
/* text vnode */ | /* text vnode */ | ||||
textvp = p->p_textvp; | textvp = p->p_textvp; | ||||
if (textvp != NULL) | if (textvp != NULL) | ||||
vrefact(textvp); | vrefact(textvp); | ||||
/* Controlling tty. */ | /* Controlling tty. */ | ||||
cttyvp = NULL; | cttyvp = NULL; | ||||
if (p->p_pgrp != NULL && p->p_pgrp->pg_session != NULL) { | if (p->p_pgrp != NULL && p->p_pgrp->pg_session != NULL) { | ||||
cttyvp = p->p_pgrp->pg_session->s_ttyvp; | cttyvp = p->p_pgrp->pg_session->s_ttyvp; | ||||
Show All 23 Lines | kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, | ||||
efbuf->fdp = fdp; | efbuf->fdp = fdp; | ||||
efbuf->pdp = pdp; | efbuf->pdp = pdp; | ||||
PWDDESC_XLOCK(pdp); | PWDDESC_XLOCK(pdp); | ||||
pwd = pwd_hold_pwddesc(pdp); | pwd = pwd_hold_pwddesc(pdp); | ||||
if (pwd != NULL) { | if (pwd != NULL) { | ||||
/* working directory */ | /* working directory */ | ||||
if (pwd->pwd_cdir != NULL) { | if (pwd->pwd_cdir != NULL) { | ||||
vrefact(pwd->pwd_cdir); | vrefact(pwd->pwd_cdir); | ||||
export_vnode_to_sb(pwd->pwd_cdir, KF_FD_TYPE_CWD, FREAD, efbuf); | export_vnode_to_sb(pwd->pwd_cdir, KF_FD_TYPE_CWD, | ||||
FREAD, efbuf); | |||||
} | } | ||||
/* root directory */ | /* root directory */ | ||||
if (pwd->pwd_rdir != NULL) { | if (pwd->pwd_rdir != NULL) { | ||||
vrefact(pwd->pwd_rdir); | vrefact(pwd->pwd_rdir); | ||||
export_vnode_to_sb(pwd->pwd_rdir, KF_FD_TYPE_ROOT, FREAD, efbuf); | export_vnode_to_sb(pwd->pwd_rdir, KF_FD_TYPE_ROOT, | ||||
FREAD, efbuf); | |||||
} | } | ||||
/* jail directory */ | /* jail directory */ | ||||
if (pwd->pwd_jdir != NULL) { | if (pwd->pwd_jdir != NULL) { | ||||
vrefact(pwd->pwd_jdir); | vrefact(pwd->pwd_jdir); | ||||
export_vnode_to_sb(pwd->pwd_jdir, KF_FD_TYPE_JAIL, FREAD, efbuf); | export_vnode_to_sb(pwd->pwd_jdir, KF_FD_TYPE_JAIL, | ||||
FREAD, efbuf); | |||||
} | } | ||||
} | } | ||||
PWDDESC_XUNLOCK(pdp); | PWDDESC_XUNLOCK(pdp); | ||||
if (pwd != NULL) | if (pwd != NULL) | ||||
pwd_drop(pwd); | pwd_drop(pwd); | ||||
FILEDESC_SLOCK(fdp); | FILEDESC_SLOCK(fdp); | ||||
lastfile = fdlastfile(fdp); | lastfile = fdlastfile(fdp); | ||||
for (i = 0; refcount_load(&fdp->fd_refcnt) > 0 && i <= lastfile; i++) { | for (i = 0; refcount_load(&fdp->fd_refcnt) > 0 && i <= lastfile; i++) { | ||||
▲ Show 20 Lines • Show All 691 Lines • Show Last 20 Lines |
Sort?