Merge "Use __builtin_*_chk for bcopy/bzero."

This commit is contained in:
Dan Albert 2014-06-23 17:02:40 +00:00 committed by Gerrit Code Review
commit 559f3cb532

View File

@ -43,8 +43,16 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
#define bcopy(b1, b2, len) (void)(memmove((b2), (b1), (len)))
#define bzero(b, len) (void)(memset((b), '\0', (len)))
#if defined(__BIONIC_FORTIFY)
#define bcopy(b1, b2, len) \
(void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2)))
#define bzero(b, len) \
(void)(__builtin___memset_chk((b), '\0', (len), __bos0(b)))
#else
#define bcopy(b1, b2, len) (void)(__builtin_memmove((b2), (b1), (len)))
#define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
#endif
int ffs(int);
int strcasecmp(const char *, const char *);