From owner-freebsd-arch Sun Mar 16 12:52:20 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0EF437B401 for ; Sun, 16 Mar 2003 12:52:19 -0800 (PST) Received: from goliath.cnchost.com (goliath.cnchost.com [207.155.252.47]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6266E43FB1 for ; Sun, 16 Mar 2003 12:52:19 -0800 (PST) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (adsl-209-204-185-216.sonic.net [209.204.185.216]) by goliath.cnchost.com id PAA05328; Sun, 16 Mar 2003 15:52:10 -0500 (EST) [ConcentricHost SMTP Relay 1.15] Message-ID: <200303162052.PAA05328@goliath.cnchost.com> To: Poul-Henning Kamp Cc: arch@FreeBSD.ORG Subject: Re: memcpy() with specified direction of copying ? In-reply-to: Your message of "Sun, 16 Mar 2003 21:36:52 +0100." <9357.1047847012@critter.freebsd.dk> Date: Sun, 16 Mar 2003 12:52:10 -0800 From: Bakul Shah Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > 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