Changeset View
Changeset View
Standalone View
Standalone View
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 3,648 Lines • ▼ Show 20 Lines | #ifdef illumos | ||||
* It is always safe to dereference one's own t_procp pointer: | * It is always safe to dereference one's own t_procp pointer: | ||||
* it always points to a valid, allocated proc structure. | * it always points to a valid, allocated proc structure. | ||||
* (This is true because threads don't clean up their own | * (This is true because threads don't clean up their own | ||||
* state -- they leave that task to whomever reaps them.) | * state -- they leave that task to whomever reaps them.) | ||||
*/ | */ | ||||
return (dtrace_dif_varstr( | return (dtrace_dif_varstr( | ||||
(uintptr_t)curthread->t_procp->p_zone->zone_name, | (uintptr_t)curthread->t_procp->p_zone->zone_name, | ||||
state, mstate)); | state, mstate)); | ||||
#elif defined(__FreeBSD__) | |||||
/* | |||||
* On FreeBSD, we introduce compatibility to zonename by falling through | |||||
* into jailname. | |||||
*/ | |||||
case DIF_VAR_JAILNAME: | |||||
if (!dtrace_priv_kernel(state)) | |||||
return (0); | |||||
return (dtrace_dif_varstr( | |||||
(uintptr_t)curthread->t_procp->p_ucred->cr_prison->pr_name, | |||||
state, mstate)); | |||||
case DIF_VAR_JID: | |||||
if (!dtrace_priv_kernel(state)) | |||||
return (0); | |||||
return ((uint64_t)curthread->t_procp->p_ucred->cr_prison->pr_id); | |||||
#else | #else | ||||
return (0); | return (0); | ||||
#endif | #endif | ||||
case DIF_VAR_UID: | case DIF_VAR_UID: | ||||
if (!dtrace_priv_proc(state)) | if (!dtrace_priv_proc(state)) | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 14,704 Lines • Show Last 20 Lines |