diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-31 11:05:21 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-31 11:05:21 +0300 |
commit | 5eae8c274244aaa98320dda3e686f264e8a447d6 (patch) | |
tree | d99f593c55e008af4df649ff456868724e7f2d32 /sql/signal_handler.cc | |
parent | bf310b4cfb5c275f8c555d469ef310bdd1219920 (diff) | |
parent | 8341f582b2fe864027954282f96fb84e560cae72 (diff) | |
download | mariadb-git-5eae8c274244aaa98320dda3e686f264e8a447d6.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'sql/signal_handler.cc')
-rw-r--r-- | sql/signal_handler.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 79bc32cbf19..2d3eaa609aa 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -31,6 +31,11 @@ #define SIGNAL_FMT "signal %d" #endif + +#ifdef __APPLE__ +#include <sys/sysctl.h> +#endif + #ifndef PATH_MAX #define PATH_MAX 4096 #endif @@ -49,7 +54,7 @@ extern const char *optimizer_switch_names[]; static inline void output_core_info() { /* proc is optional on some BSDs so it can't hurt to look */ -#ifdef HAVE_READLINK +#if defined(HAVE_READLINK) && !defined(__APPLE__) char buff[PATH_MAX]; ssize_t len; int fd; @@ -80,6 +85,13 @@ static inline void output_core_info() my_close(fd, MYF(0)); } #endif +#elif defined(__APPLE__) + char buff[PATH_MAX]; + size_t len = sizeof(buff); + if (sysctlbyname("kern.corefile", buff, &len, NULL, 0) == 0) + { + my_safe_printf_stderr("Core pattern: %.*s\n", (int) len, buff); + } #else char buff[80]; my_getwd(buff, sizeof(buff), 0); |