Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/string/bcopy.3
Show All 25 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)bcopy.3 8.1 (Berkeley) 6/4/93 | .\" @(#)bcopy.3 8.1 (Berkeley) 6/4/93 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd August 13, 2015 | .Dd August 14, 2015 | ||||
.Dt BCOPY 3 | .Dt BCOPY 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm bcopy | .Nm bcopy | ||||
.Nd copy byte string | .Nd copy byte string | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
Show All 9 Lines | |||||
bytes from string | bytes from string | ||||
.Fa src | .Fa src | ||||
to string | to string | ||||
.Fa dst . | .Fa dst . | ||||
The two strings may overlap. | The two strings may overlap. | ||||
If | If | ||||
.Fa len | .Fa len | ||||
is zero, no bytes are copied. | is zero, no bytes are copied. | ||||
.Pp | |||||
This function is obsolete (marked as LEGACY in | |||||
POSIX.1-2001): please use | |||||
.Xr memmove 3 | |||||
in new programs. | |||||
Note that | |||||
.Fn bcopy | |||||
takes its src and dst arguments in the opposite | |||||
order from | |||||
.Xr memmove 3 . | |||||
POSIX.1-2008 removes the specification of | |||||
.Fn bcopy . | |||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr memccpy 3 , | .Xr memccpy 3 , | ||||
.Xr memcpy 3 , | .Xr memcpy 3 , | ||||
.Xr memmove 3 , | .Xr memmove 3 , | ||||
.Xr strcpy 3 , | .Xr strcpy 3 , | ||||
.Xr strncpy 3 | .Xr strncpy 3 | ||||
.Sh HISTORY | .Sh HISTORY | ||||
A | A | ||||
.Fn bcopy | .Fn bcopy | ||||
function appeared in | function appeared in | ||||
.Bx 4.2 . | .Bx 4.2 . | ||||
Its prototype existed previously in | Its prototype existed previously in | ||||
.In string.h | .In string.h | ||||
before it was moved to | before it was moved to | ||||
.In strings.h | .In strings.h | ||||
for | for | ||||
.St -p1003.1-2001 | .St -p1003.1-2001 | ||||
compliance. | compliance. | ||||
.Pp | |||||
The | |||||
.St -p1003.1-2008 | |||||
removes the specification of | |||||
.Fn bcopy | |||||
and it is marked as LEGACY in | |||||
.St -p1003.1-2004 . | |||||
New programs should use | |||||
.Xr memmove 3 . | |||||
If the input and output buffer do not overlap, then | |||||
.Xr memcpy 3 | |||||
is more efficient. | |||||
Note that | |||||
.Fn bcopy | |||||
takes | |||||
.Ar src | |||||
and | |||||
.Ar dst | |||||
in the opposite order from | |||||
.Fn memmove | |||||
and | |||||
.Fn memcpy . |