_FORTIFY_SOURCE: add memset / bzero support
Add _FORTIFY_SOURCE support for the following functions: * memset * bzero Move the __BIONIC_FORTIFY_INLINE definition to cdefs.h so it can be used from multiple header files. Change-Id: Iead4d5e35de6ec97786d58ee12573f9b11135bb7
This commit is contained in:
@@ -51,6 +51,14 @@ char *index(const char *, int);
|
||||
char *rindex(const char *, int);
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#if defined(__BIONIC_FORTIFY_INLINE)
|
||||
__BIONIC_FORTIFY_INLINE
|
||||
void bzero (void *s, size_t n) {
|
||||
__builtin___memset_chk(s, '\0', n, __builtin_object_size (s, 0));
|
||||
}
|
||||
#endif /* defined(__BIONIC_FORTIFY_INLINE) */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !defined(_STRINGS_H_) */
|
||||
|
Reference in New Issue
Block a user