patch-2.1.118 linux/include/asm-sparc/uaccess.h
Next file: linux/include/linux/file.h
Previous file: linux/include/asm-ppc/uaccess.h
Back to the patch index
Back to the overall index
- Lines: 16
- Date:
Mon Aug 24 12:29:35 1998
- Orig file:
v2.1.117/linux/include/asm-sparc/uaccess.h
- Orig date:
Thu Apr 23 20:21:38 1998
diff -u --recursive --new-file v2.1.117/linux/include/asm-sparc/uaccess.h linux/include/asm-sparc/uaccess.h
@@ -318,11 +318,14 @@
})
#define copy_from_user(to,from,n) ({ \
+void *__copy_to = (void *) (to); \
void *__copy_from = (void *) (from); \
__kernel_size_t __copy_size = (__kernel_size_t) (n); \
__kernel_size_t __copy_res; \
if(__copy_size && __access_ok((unsigned long)__copy_from, __copy_size)) { \
-__copy_res = __copy_user((void *) (to), __copy_from, __copy_size); \
+__copy_res = __copy_user(__copy_to, __copy_from, __copy_size); \
+if(__copy_res) \
+memset((char *)__copy_to + __copy_size - __copy_res, 0, __copy_res); \
} else __copy_res = __copy_size; \
__copy_res; })
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov