2011-11-30 09:07:02 +08:00
|
|
|
//===-- asan_interceptors.h -------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of AddressSanitizer, an address sanity checker.
|
|
|
|
//
|
|
|
|
// ASan-private header for asan_interceptors.cc
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef ASAN_INTERCEPTORS_H
|
|
|
|
#define ASAN_INTERCEPTORS_H
|
|
|
|
|
|
|
|
#include "asan_internal.h"
|
2012-02-09 03:52:01 +08:00
|
|
|
#include "interception/interception.h"
|
2012-02-02 18:39:40 +08:00
|
|
|
|
2012-05-31 22:35:53 +08:00
|
|
|
DECLARE_REAL(int, memcmp, const void *a1, const void *a2, uptr size);
|
|
|
|
DECLARE_REAL(void*, memcpy, void *to, const void *from, uptr size);
|
|
|
|
DECLARE_REAL(void*, memset, void *block, int c, uptr size);
|
2012-02-02 18:39:40 +08:00
|
|
|
DECLARE_REAL(char*, strchr, const char *str, int c);
|
2012-05-31 22:35:53 +08:00
|
|
|
DECLARE_REAL(uptr, strlen, const char *s);
|
|
|
|
DECLARE_REAL(char*, strncpy, char *to, const char *from, uptr size);
|
|
|
|
DECLARE_REAL(uptr, strnlen, const char *s, uptr maxlen);
|
2012-02-17 01:00:45 +08:00
|
|
|
struct sigaction;
|
|
|
|
DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act,
|
|
|
|
struct sigaction *oldact);
|
2012-02-02 18:39:40 +08:00
|
|
|
|
|
|
|
namespace __asan {
|
2011-11-30 09:07:02 +08:00
|
|
|
|
|
|
|
// __asan::internal_X() is the implementation of X() for use in RTL.
|
2012-05-31 23:02:07 +08:00
|
|
|
s64 internal_atoll(const char *nptr);
|
2012-05-31 22:35:53 +08:00
|
|
|
uptr internal_strnlen(const char *s, uptr maxlen);
|
2012-02-15 03:33:04 +08:00
|
|
|
char* internal_strchr(const char *s, int c);
|
2012-05-31 22:35:53 +08:00
|
|
|
void* internal_memset(void *s, int c, uptr n);
|
|
|
|
int internal_memcmp(const void* s1, const void* s2, uptr n);
|
2012-01-10 06:20:49 +08:00
|
|
|
char *internal_strstr(const char *haystack, const char *needle);
|
2012-05-31 22:35:53 +08:00
|
|
|
char *internal_strncat(char *dst, const char *src, uptr n);
|
2012-02-18 00:15:09 +08:00
|
|
|
// Works only for base=10 and doesn't set errno.
|
2012-05-31 23:02:07 +08:00
|
|
|
s64 internal_simple_strtoll(const char *nptr, char **endptr, int base);
|
2012-01-10 06:20:49 +08:00
|
|
|
|
2011-11-30 09:07:02 +08:00
|
|
|
void InitializeAsanInterceptors();
|
|
|
|
|
2012-03-21 20:29:54 +08:00
|
|
|
#if defined(__APPLE__)
|
2012-03-21 20:42:00 +08:00
|
|
|
void InitializeMacInterceptors();
|
2012-03-21 20:29:54 +08:00
|
|
|
#endif // __APPLE__
|
|
|
|
|
2011-11-30 09:07:02 +08:00
|
|
|
} // namespace __asan
|
|
|
|
|
|
|
|
#endif // ASAN_INTERCEPTORS_H
|