Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173450866
D60025.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
975 B
Referenced Files
None
Subscribers
None
D60025.diff
View Options
diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c
--- a/sys/kern/subr_uio.c
+++ b/sys/kern/subr_uio.c
@@ -468,6 +468,24 @@
return (0);
}
+/*
+ * Update the lengths of a userspace iovec to match those in a struct uio's
+ * iovec (previously created by copyinuio).
+ */
+int
+updateiov(const struct uio *uiop, void *uiovp)
+{
+ int i, error;
+ struct iovec *iovp = uiovp;
+
+ for (i = 0; i < uiop->uio_iovcnt; i++) {
+ error = suword(&iovp[i].iov_len, uiop->uio_iov[i].iov_len);
+ if (error != 0)
+ return (EFAULT);
+ }
+ return (0);
+}
+
struct uio *
allocuio(u_int iovcnt)
{
diff --git a/sys/sys/uio.h b/sys/sys/uio.h
--- a/sys/sys/uio.h
+++ b/sys/sys/uio.h
@@ -99,6 +99,7 @@
int uiomove_nofault(void *cp, int n, struct uio *uio);
int uiomove_object(struct vm_object *obj, off_t obj_size, struct uio *uio);
int uiomove_step(void *cp, void *base, size_t cnt, struct uio *uio);
+int updateiov(const struct uio *uiop, void *iovp);
#else /* !_KERNEL */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 27, 1:05 AM (2 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39671426
Default Alt Text
D60025.diff (975 B)
Attached To
Mode
D60025: sys/uio: add updateiov()
Attached
Detach File
Event Timeline
Log In to Comment