PERFORCE change 62719 for review
Peter Wemm
peter at FreeBSD.org
Tue Oct 5 16:22:26 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=62719
Change 62719 by peter at peter_daintree on 2004/10/05 23:21:54
hack hack. begin CTLTYPE_LONG translation WIP.
Affected files ...
.. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_misc.c#16 edit
Differences ...
==== //depot/projects/hammer/sys/compat/freebsd32/freebsd32_misc.c#16 (text+ko) ====
@@ -1198,18 +1198,32 @@
int
freebsd32_sysctl(struct thread *td, struct freebsd32_sysctl_args *uap)
{
- int error, name[CTL_MAXNAME];
+ int error, name[CTL_MAXNAME + 2];
+ u_char buf[256];
size_t j, oldlen;
if (uap->namelen > CTL_MAXNAME || uap->namelen < 2)
return (EINVAL);
- error = copyin(uap->name, &name, uap->namelen * sizeof(int));
+ name[0] = 0; /* Internal sysctl function */
+ name[1] = 4; /* This is magic */
+ error = copyin(uap->name, &name[2], uap->namelen * sizeof(int));
if (error)
return (error);
mtx_lock(&Giant);
+ j = sizeof(buf);
+ error = kernel_sysctl(td, name, uap->namelen + 2, buf, &j, 0, 0, &j);
+ if (error == 0 && j >= sizeof(u_int)) {
+ int kind = *(u_int *)buf;
+ if ((kind & CTLTYPE) == CTLTYPE_LONG ||
+ (kind & CTLTYPE) == CTLTYPE_ULONG) {
+ printf("sysctl LONG!\n");
+ /* do conversion */
+ }
+ }
+
if (uap->oldlenp)
oldlen = fuword32(uap->oldlenp);
else
More information about the p4-projects
mailing list