summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index b661862..6914f02 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -37,13 +37,36 @@ extern "C" {
37#endif 37#endif
38 38
39#undef malloc 39#undef malloc
40#undef realloc
40 41
41__malloc(malloc (free, 1)) 42__malloc(malloc (free, 1))
43__alloc_size(1)
42_FORTIFY_FN(malloc) void *malloc(size_t __s) 44_FORTIFY_FN(malloc) void *malloc(size_t __s)
43{ 45{
44 return __orig_malloc(__s); 46 return __orig_malloc(__s);
45} 47}
46 48
49__alloc_size(2)
50_FORTIFY_FN(realloc) void *realloc(void *__p, size_t __s)
51{
52 return __orig_realloc(__p, __s);
53}
54
55__alloc_size(1, 2)
56_FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s)
57{
58 return __orig_calloc(__n, __s);
59}
60
61#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
62#undef reallocarray
63__alloc_size (2, 3)
64_FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s)
65{
66 return __orig_reallocarray(__p, __n, __s);
67}
68#endif
69
47/* FIXME clang */ 70/* FIXME clang */
48#if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__) 71#if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__)
49#undef realpath 72#undef realpath