Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 2003 12:52:10 -0800
From:      Bakul Shah <bakul@bitblocks.com>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        arch@FreeBSD.ORG
Subject:   Re: memcpy() with specified direction of copying ? 
Message-ID:  <200303162052.PAA05328@goliath.cnchost.com>
In-Reply-To: Your message of "Sun, 16 Mar 2003 21:36:52 %2B0100." <9357.1047847012@critter.freebsd.dk> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Is there any standard which has provided an api for mandating the
> direction of copying from a memcpy() like function ?
> 
> As I read our man-page, there is no way to know of memcpy() copies
> from the start and forward or from the end and backward through the
> two areas.

The direction is not even relevant for memcpy and if the
source and destination overlap, the behavior is undefined.
Use memmove() for overlapped src and dst, but if you want the
direction reversed for some other reason you're on your own.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303162052.PAA05328>