]> sourceware.org Git - valgrind.git/commitdiff
Darwin: add support for setting errno from alloc wrappers
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 2 Apr 2023 09:06:18 +0000 (11:06 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 2 Apr 2023 09:06:18 +0000 (11:06 +0200)
coregrind/m_replacemalloc/vg_replace_malloc.c

index 5977fa317b698437efa092173f822e1417249942..64d9b67c1eef8053a5dfce363e52cadad6a0951a 100644 (file)
@@ -234,6 +234,13 @@ extern int *___errno (void) __attribute__((weak));
       (*___errno ()) = VKI_ENOMEM;
 #define SET_ERRNO_EINVAL if (___errno)        \
       (*___errno ()) = VKI_EINVAL;
+#elif defined(VGO_darwin)
+extern int * __error(void) __attribute__((weak));
+#define SET_ERRNO_ENOMEM if (__error)        \
+      (*__error ()) = VKI_ENOMEM;
+#define SET_ERRNO_EINVAL if (__error)        \
+      (*__error ()) = VKI_EINVAL;
+
 #else
 #define SET_ERRNO_ENOMEM {}
 #define SET_ERRNO_EINVAL {}
This page took 0.030166 seconds and 5 git commands to generate.