diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-11-23 02:00:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-11-23 02:00:47 +0000 |
commit | 06615f62b17d7de6e12d2f5ec6b88cf30af08413 (patch) | |
tree | 8766f208847d4876a6db619aebbf54d53b76eb44 /kernel/sysctl.c | |
parent | fa9bdb574f4febb751848a685d9a9017e04e1d53 (diff) |
Merge with Linux 2.4.0-test10.
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index c320027fa..70da2a029 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1217,78 +1217,6 @@ int sysctl_jiffies(ctl_table *table, int *name, int nlen, return 1; } -int do_string ( - void *oldval, size_t *oldlenp, void *newval, size_t newlen, - int rdwr, char *data, size_t max) -{ - int l = strlen(data) + 1; - if (newval && !rdwr) - return -EPERM; - if (newval && newlen >= max) - return -EINVAL; - if (oldval) { - int old_l; - if(get_user(old_l, oldlenp)) - return -EFAULT; - if (l > old_l) - return -ENOMEM; - if(put_user(l, oldlenp) || copy_to_user(oldval, data, l)) - return -EFAULT; - } - if (newval) { - if(copy_from_user(data, newval, newlen)) - return -EFAULT; - data[newlen] = 0; - } - return 0; -} - -int do_int ( - void *oldval, size_t *oldlenp, void *newval, size_t newlen, - int rdwr, int *data) -{ - if (newval && !rdwr) - return -EPERM; - if (newval && newlen != sizeof(int)) - return -EINVAL; - if (oldval) { - int old_l; - if(get_user(old_l, oldlenp)) - return -EFAULT; - if (old_l < sizeof(int)) - return -ENOMEM; - if(put_user(sizeof(int), oldlenp)||copy_to_user(oldval, data, sizeof(int))) - return -EFAULT; - } - if (newval) - if(copy_from_user(data, newval, sizeof(int))) - return -EFAULT; - return 0; -} - -int do_struct ( - void *oldval, size_t *oldlenp, void *newval, size_t newlen, - int rdwr, void *data, size_t len) -{ - if (newval && !rdwr) - return -EPERM; - if (newval && newlen != len) - return -EINVAL; - if (oldval) { - int old_l; - if(get_user(old_l, oldlenp)) - return -EFAULT; - if (old_l < len) - return -ENOMEM; - if(put_user(len, oldlenp) || copy_to_user(oldval, data, len)) - return -EFAULT; - } - if (newval) - if(copy_from_user(data, newval, len)) - return -EFAULT; - return 0; -} - #else /* CONFIG_SYSCTL */ |