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)
Attachment:
pgp0QzUCMA9f4.pgp
Description: PGP signature
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies