int
copyin(const void *uaddr, void *kaddr, size_t len)
int
copyout(const void *kaddr, void *uaddr, size_t len)
int
copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done)
int
copyinstr(const void *uaddr, void *kaddr, size_t len, size_t *done)
int
copyoutstr(const void *kaddr, void *uaddr, size_t len, size_t *done)
int
copyin_proc(struct proc *p, const void *uaddr, void *kaddr, size_t len)
int
copyout_proc(struct proc *p, const void *kaddr, void *uaddr, size_t len)
int
ioctl_copyin(int ioctlflags, const void *src, void *dst, size_t len)
int
ioctl_copyout(int ioctlflags, const void *src, void *dst, size_t len)
)
copy data from user-space to kernel-space or vice-versa.
The copy routines provide the following functionality:
)len
bytes of data from the user-space address
uaddr
in the current process to the kernel-space address
kaddr.
)len
bytes of data from the kernel-space address
kaddr
to the user-space address
uaddr
in the current process.
)len
bytes long, from kernel-space address
kfaddr
to kernel-space address
kdaddr.
If the
done
argument is non-NULL,
the number of bytes actually copied, including the terminating
NUL, is returned in
*done.
)len
bytes long, from user-space address
uaddr
in the current process to kernel-space address
kaddr.
If the
done
argument is non-NULL,
the number of bytes actually copied, including the terminating
NUL, is returned in
*done.
)len
bytes long, from kernel-space address
kaddr
to user-space address
uaddr
in the current process.
If the
done
argument is non-NULL,
the number of bytes actually copied, including the terminating
NUL, is returned in
*done.
)),
except it operates on the address space of the process
p.
)),
except it operates on the address space of the process
p.
)),
except it operates on kernel adresses when the
FKIOCTL
flag is passed in
ioctlflags
from the ioctl call.
)),
except it operates on kernel adresses when the
FKIOCTL
flag is passed in
ioctlflags
from the ioctl call.
EFAULT
if a bad address is encountered.
In addition, the
copystr(),
copyinstr(),
and
copyoutstr()
functions return
ENAMETOOLONG
if the string is longer than
len
bytes.