Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_uio.c
Show First 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | again: | ||||
iov->iov_base = (char *)iov->iov_base + 1; | iov->iov_base = (char *)iov->iov_base + 1; | ||||
iov->iov_len--; | iov->iov_len--; | ||||
uio->uio_resid--; | uio->uio_resid--; | ||||
uio->uio_offset++; | uio->uio_offset++; | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
copyinfrom(const void * __restrict src, void * __restrict dst, size_t len, | |||||
int seg) | |||||
{ | |||||
int error = 0; | |||||
switch (seg) { | |||||
case UIO_USERSPACE: | |||||
error = copyin(src, dst, len); | |||||
break; | |||||
case UIO_SYSSPACE: | |||||
bcopy(src, dst, len); | |||||
break; | |||||
default: | |||||
panic("copyinfrom: bad seg %d\n", seg); | |||||
} | |||||
return (error); | |||||
} | |||||
int | |||||
copyinstrfrom(const void * __restrict src, void * __restrict dst, size_t len, | |||||
size_t * __restrict copied, int seg) | |||||
{ | |||||
int error = 0; | |||||
switch (seg) { | |||||
case UIO_USERSPACE: | |||||
error = copyinstr(src, dst, len, copied); | |||||
break; | |||||
case UIO_SYSSPACE: | |||||
error = copystr(src, dst, len, copied); | |||||
break; | |||||
default: | |||||
panic("copyinstrfrom: bad seg %d\n", seg); | |||||
} | |||||
return (error); | |||||
} | |||||
int | |||||
copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) | copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) | ||||
{ | { | ||||
u_int iovlen; | u_int iovlen; | ||||
*iov = NULL; | *iov = NULL; | ||||
if (iovcnt > UIO_MAXIOV) | if (iovcnt > UIO_MAXIOV) | ||||
return (error); | return (error); | ||||
iovlen = iovcnt * sizeof (struct iovec); | iovlen = iovcnt * sizeof (struct iovec); | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |