File:  [Research Unix] / researchv10no / libc / gen / vaxmemmove.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#define CHUNK 65532	/* word boundary */

/* VAX memcpy is OK up to 65535-byte strings */

extern void *memcpy();

void *
memmove(vout, vin, n)
void *vout, *vin;
unsigned n;
{
	char *out, *in;
	register unsigned chunk;
	if(n <= CHUNK || vout < vin)
		return memcpy(vout, vin, n);
	chunk = n%CHUNK;
	out = (char*)vout + n;
	in = (char*)vin + n;
	while(memcpy(out-=chunk, in-=chunk, chunk) > vout)
		chunk = CHUNK;
	return vout;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.