Skip to content

Commit 1bacab8

Browse files
devnexengrooverdan
authored andcommitted
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.
1 parent 8bdffb3 commit 1bacab8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
5858

5959
#ifdef __linux__
6060
# include <sys/prctl.h>
61-
#include <sys/resource.h>
61+
# include <sys/resource.h>
6262
#endif
6363

6464
#ifdef __APPLE__
6565
# include "libproc.h"
6666
#endif
6767

68+
#ifdef __FreeBSD__
69+
# include <sys/sysctl.h>
70+
#endif
71+
6872

6973
#include <btr0sea.h>
7074
#include <dict0priv.h>
@@ -6718,6 +6722,11 @@ static int get_exepath(char *buf, size_t size, const char *argv0)
67186722
buf[ret] = 0;
67196723
return 0;
67206724
}
6725+
#elif defined(__FreeBSD__)
6726+
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
6727+
if (sysctl(mib, 4, buf, &size, NULL, 0) == 0) {
6728+
return 0;
6729+
}
67216730
#endif
67226731

67236732
return my_realpath(buf, argv0, 0);

0 commit comments

Comments
 (0)