mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-34340 mariadb-backup immediately dumps core on NetBSD
Provided implementation for my_get_exepath for NetBSD to avoid segfaults in execution of mariadb-backup.
This commit is contained in:
parent
f9f1d26f2a
commit
3a4bc9aa35
1 changed files with 7 additions and 0 deletions
|
@ -23,6 +23,9 @@
|
|||
#include <libproc.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <sys/sysctl.h>
|
||||
#elif defined(__NetBSD__)
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
/** Fill the buffer with the executable program name
|
||||
|
@ -51,6 +54,10 @@ int my_get_exepath(char *buf, size_t size, const char *argv0)
|
|||
if (sysctl(mib, 4, buf, &size, NULL, 0) == 0) {
|
||||
return 0;
|
||||
}
|
||||
#elif defined(__NetBSD__)
|
||||
int mib[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME };
|
||||
if (sysctl(mib, 4, buf, &size, NULL, 0) == 0)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
if (argv0)
|
||||
|
|
Loading…
Reference in a new issue