Commit 1bacab8a authored by David Carlier's avatar David Carlier Committed by Daniel Black

mariabackup little FreeBSD update support.

In this platform, it s better not to rely on optional proc filesystem presence.
 Using native API to retrieve binary absolute path instead.
parent 8bdffb37
...@@ -58,13 +58,17 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA ...@@ -58,13 +58,17 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#ifdef __linux__ #ifdef __linux__
# include <sys/prctl.h> # include <sys/prctl.h>
#include <sys/resource.h> # include <sys/resource.h>
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
# include "libproc.h" # include "libproc.h"
#endif #endif
#ifdef __FreeBSD__
# include <sys/sysctl.h>
#endif
#include <btr0sea.h> #include <btr0sea.h>
#include <dict0priv.h> #include <dict0priv.h>
...@@ -6718,6 +6722,11 @@ static int get_exepath(char *buf, size_t size, const char *argv0) ...@@ -6718,6 +6722,11 @@ static int get_exepath(char *buf, size_t size, const char *argv0)
buf[ret] = 0; buf[ret] = 0;
return 0; return 0;
} }
#elif defined(__FreeBSD__)
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
if (sysctl(mib, 4, buf, &size, NULL, 0) == 0) {
return 0;
}
#endif #endif
return my_realpath(buf, argv0, 0); return my_realpath(buf, argv0, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment