copystr(9): Move to deprecate [1/2]

Unlike the other copy*() functions, it does not serve to copy from one
address space to another or protect against potential faults. It's just
an older incarnation of the now-more-common strlcpy().

Reviewed by:	jhb
MFC after:	i² days
Differential Revision:	yes (see 2/2)
This commit is contained in:
Conrad Meyer 2020-05-11 22:48:00 +00:00
parent 86fd36c502
commit 294b75a880
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=360943

View File

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 15, 2017
.Dd May 11, 2020
.Dt COPY 9
.Os
.Sh NAME
@ -45,7 +45,7 @@
.Nm copyout_nofault ,
.Nm copystr ,
.Nm copyinstr
.Nd kernel copy functions
.Nd heterogenous address space copy functions
.Sh SYNOPSIS
.In sys/types.h
.In sys/systm.h
@ -57,18 +57,21 @@
.Fn copyout "const void *kaddr" "void *uaddr" "size_t len"
.Ft int
.Fn copyout_nofault "const void *kaddr" "void *uaddr" "size_t len"
.Ft int
.Ft int __deprecated
.Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done"
.Ft int
.Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done"
.Sh DESCRIPTION
The
.Nm
functions are designed to copy contiguous data from one address
functions are designed to copy contiguous data from one address space
to another.
All but
.Pp
.Fn copystr
copy data from user-space to kernel-space or vice-versa.
is deprecated and should be replaced with
.Xr strlcpy 9 .
It will be removed from
.Fx 13 .
.Pp
The
.Fn copyin