STABLE14-tiger-sysctl-20060117

FIXES 25327

implementation of sysctl for tiger


(cherry picked from commit ebf35c3f884b40616700b4b0b2462731cda290ae)
This commit is contained in:
Chaskiel M Grundman 2006-01-17 16:08:20 +00:00 committed by Derrick Brashear
parent eb72bfe0b2
commit 39b8b95820

View File

@ -503,8 +503,23 @@ int afs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
switch (name[2]) {
case AFS_SC_DARWIN_ALL_REALMODES:
#ifdef AFS_DARWIN80_ENV
newlen;
/* XXX complicated */
if (oldp != USER_ADDR_NULL && oldlenp == NULL)
return (EFAULT);
if (oldp && *oldlenp < sizeof(u_int32_t))
return (ENOMEM);
if (newp && newlen != sizeof(u_int32_t))
return (EINVAL);
*oldlenp = sizeof(u_int32_t);
if (oldp) {
if ((error = copyout(&afs_darwin_realmodes,
oldp, sizeof(u_int32_t)))) {
return error;
}
}
if (newp)
return copyin(newp, &afs_darwin_realmodes,
sizeof(u_int32_t));
return 0;
#else
return sysctl_int(oldp, oldlenp, newp, newlen,
&afs_darwin_realmodes);