diff options
author | David Carlier <devnexen@gmail.com> | 2021-03-19 09:31:27 +0000 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2021-03-20 15:29:56 +1100 |
commit | 1bacab8ab9a0bff3b7e43920610b03d5a98b3282 (patch) | |
tree | 873fc1811386c720c8a96893460ccdca8e14fbae /extra/mariabackup/xtrabackup.cc | |
parent | 8bdffb37507e70f66917b7db762f6b0f138f807a (diff) | |
download | mariadb-git-1bacab8ab9a0bff3b7e43920610b03d5a98b3282.tar.gz |
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.
Diffstat (limited to 'extra/mariabackup/xtrabackup.cc')
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index b7839dc4944..37791d9dca7 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -58,13 +58,17 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA #ifdef __linux__ # include <sys/prctl.h> -#include <sys/resource.h> +# include <sys/resource.h> #endif #ifdef __APPLE__ # include "libproc.h" #endif +#ifdef __FreeBSD__ +# include <sys/sysctl.h> +#endif + #include <btr0sea.h> #include <dict0priv.h> @@ -6718,6 +6722,11 @@ static int get_exepath(char *buf, size_t size, const char *argv0) buf[ret] = 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 return my_realpath(buf, argv0, 0); |