Checkpoint a hack to enable running i386 libc_r binaries on a 64 bit
kernel. I'm not happy with it yet - refinements are to come. This hack allows the kern.ps_strings and kern.usrstack sysctls to respond to a 32 bit request, such as those coming from emulated i386 binaries.
This commit is contained in:
parent
36e8826ffb
commit
df7c361e64
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125953
@ -102,20 +102,38 @@ static int
|
||||
sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
struct proc *p;
|
||||
int error;
|
||||
|
||||
p = curproc;
|
||||
return (SYSCTL_OUT(req, &p->p_sysent->sv_psstrings,
|
||||
sizeof(p->p_sysent->sv_psstrings)));
|
||||
#if defined(__amd64__) || defined(__ia64__)
|
||||
if (req->oldlen == sizeof(unsigned int)) {
|
||||
unsigned int val;
|
||||
val = (unsigned int)p->p_sysent->sv_psstrings;
|
||||
error = SYSCTL_OUT(req, &val, sizeof(val));
|
||||
} else
|
||||
#endif
|
||||
error = SYSCTL_OUT(req, &p->p_sysent->sv_psstrings,
|
||||
sizeof(p->p_sysent->sv_psstrings));
|
||||
return error;
|
||||
}
|
||||
|
||||
static int
|
||||
sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
struct proc *p;
|
||||
int error;
|
||||
|
||||
p = curproc;
|
||||
return (SYSCTL_OUT(req, &p->p_sysent->sv_usrstack,
|
||||
sizeof(p->p_sysent->sv_usrstack)));
|
||||
#if defined(__amd64__) || defined(__ia64__)
|
||||
if (req->oldlen == sizeof(unsigned int)) {
|
||||
unsigned int val;
|
||||
val = (unsigned int)p->p_sysent->sv_usrstack;
|
||||
error = SYSCTL_OUT(req, &val, sizeof(val));
|
||||
} else
|
||||
#endif
|
||||
error = SYSCTL_OUT(req, &p->p_sysent->sv_usrstack,
|
||||
sizeof(p->p_sysent->sv_usrstack));
|
||||
return error;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user