patch-2.1.120 linux/include/asm-i386/checksum.h
Next file: linux/include/asm-i386/processor.h
Previous file: linux/fs/umsdos/symlink.c
Back to the patch index
Back to the overall index
- Lines: 23
- Date:
Sun Aug 30 14:31:13 1998
- Orig file:
v2.1.119/linux/include/asm-i386/checksum.h
- Orig date:
Sat May 2 14:19:54 1998
diff -u --recursive --new-file v2.1.119/linux/include/asm-i386/checksum.h linux/include/asm-i386/checksum.h
@@ -195,4 +195,22 @@
return csum_fold(sum);
}
+/*
+ * Copy and checksum to user
+ */
+#define HAVE_CSUM_COPY_USER
+static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst,
+ int len, int sum, int *err_ptr)
+{
+ int *src_err_ptr=NULL;
+
+ if (verify_area(VERIFY_WRITE, dst, len) == 0)
+ return csum_partial_copy_generic(src, dst, len, sum, src_err_ptr, err_ptr);
+
+ if (len)
+ *err_ptr = -EFAULT;
+
+ return sum;
+}
+
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov