]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-tiger-sysctl-20060117
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Tue, 17 Jan 2006 16:08:20 +0000 (16:08 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 17 Jan 2006 16:08:20 +0000 (16:08 +0000)
FIXES 25327

implementation of sysctl for tiger

(cherry picked from commit ebf35c3f884b40616700b4b0b2462731cda290ae)

src/afs/DARWIN/osi_vfsops.c

index d6288b6dec26266ef05ba4b3b2f1423abf664d8f..a9bc7e3f7f16f7a67d9d6ef212a15449c3ba7d62 100644 (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);