mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-25294 signal handler display coredump on mac
This commit is contained in:
parent
b771ab242b
commit
99945d77d7
1 changed files with 13 additions and 1 deletions
|
@ -30,6 +30,11 @@
|
|||
#define SIGNAL_FMT "signal %d"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
@ -51,7 +56,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;
|
||||
|
@ -77,6 +82,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);
|
||||
|
|
Loading…
Add table
Reference in a new issue