Question about memcpy
valdis.kletnieks at vt.edu
valdis.kletnieks at vt.edu
Tue Jul 10 12:03:42 EDT 2018
On Tue, 10 Jul 2018 22:51:34 +0800, bing zhu said:
> Thank you ,I use this func for both kernel and user ,result are same.
> void *memcpy(void *dest, const void *src, size_t n)
> {
Might want to use 'void *my_memcpy(..)' instead, just in case the build
environment plays #define games with you and causes a different memcpy()
to get invoked instead.
[/usr/src/linux-next] egrep -r '#define\s*memcpy\(' include/ arch/*/include
arch/arm64/include/asm/string.h:#define memcpy(dst, src, len) __memcpy(dst, src, len)
arch/m68k/include/asm/string.h:#define memcpy(d, s, n) __builtin_memcpy(d, s, n)
arch/sparc/include/asm/string.h:#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
arch/x86/include/asm/string_64.h:#define memcpy(dst, src, len) \
arch/x86/include/asm/string_64.h:#define memcpy(dst, src, len) __memcpy(dst, src, len)
arch/x86/include/asm/string_32.h:#define memcpy(t, f, n) \
arch/x86/include/asm/string_32.h:#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
arch/x86/include/asm/string_32.h:#define memcpy(t, f, n) \
arch/xtensa/include/asm/string.h:#define memcpy(dst, src, len) __memcpy(dst, src, len)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180710/85541f24/attachment.sig>
More information about the Kernelnewbies
mailing list