patch-2.1.123 linux/net/core/iovec.c
Next file: linux/net/ipv4/tcp.c
Previous file: linux/mm/swap_state.c
Back to the patch index
Back to the overall index
- Lines: 31
- Date:
Mon Sep 21 14:19:00 1998
- Orig file:
v2.1.122/linux/net/core/iovec.c
- Orig date:
Sat Sep 5 16:46:42 1998
diff -u --recursive --new-file v2.1.122/linux/net/core/iovec.c linux/net/core/iovec.c
@@ -95,6 +95,30 @@
}
/*
+ * In kernel copy to iovec. Returns -EFAULT on error.
+ *
+ * Note: this modifies the original iovec.
+ */
+
+void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len)
+{
+ while(len>0)
+ {
+ if(iov->iov_len)
+ {
+ int copy = min(iov->iov_len, len);
+ memcpy(iov->iov_base, kdata, copy);
+ kdata+=copy;
+ len-=copy;
+ iov->iov_len-=copy;
+ iov->iov_base+=copy;
+ }
+ iov++;
+ }
+}
+
+
+/*
* Copy iovec to kernel. Returns -EFAULT on error.
*
* Note: this modifies the original iovec.
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov