From 702e15e02335d4d15e8faddd45c9e9746e4d81a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Thu, 28 Feb 2019 09:32:19 +0100 Subject: erts: Stop using madvise(2) on Solaris inet_drv adds some arcane #defines to get SCTP working, which may end up disabling madvise(2) locally in that file, breaking the build in the process. This commit disables madvise(2) altogether on Solaris as it's far simpler than undoing the define dance in erl_mmap.h. --- erts/emulator/sys/common/erl_mmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/sys/common/erl_mmap.h b/erts/emulator/sys/common/erl_mmap.h index e1ff0fe80a..3085bf7e19 100644 --- a/erts/emulator/sys/common/erl_mmap.h +++ b/erts/emulator/sys/common/erl_mmap.h @@ -203,7 +203,7 @@ ERTS_GLB_INLINE void erts_mem_discard(void *p, UWord size); data[i] = pattern[i % sizeof(pattern)]; } } -#elif defined(HAVE_SYS_MMAN_H) +#elif defined(HAVE_SYS_MMAN_H) && !(defined(__sun) || defined(__sun__)) #include ERTS_GLB_INLINE void erts_mem_discard(void *ptr, UWord size) { -- cgit v1.2.3 From 4fe2bd4f66d1ae82c0d2842837edafe9e6febfc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Thu, 28 Feb 2019 11:44:36 +0100 Subject: erts: Fix erl_printf on Solaris flockfile(3c) and friends are hidden behind the __EXTENSIONS__ feature macro. --- erts/lib_src/common/erl_printf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erts/lib_src/common/erl_printf.c b/erts/lib_src/common/erl_printf.c index 259ba8c81d..86f5da1c40 100644 --- a/erts/lib_src/common/erl_printf.c +++ b/erts/lib_src/common/erl_printf.c @@ -27,6 +27,11 @@ #include "config.h" #endif +#if defined(__sun) || defined(__sun__) + /* For flockfile(3c), putc_unlocked(3c), etc */ + #define __EXTENSIONS__ +#endif + #include #include "erl_errno.h" #ifdef __WIN32__ -- cgit v1.2.3