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.
This commit is contained in:
parent
8bdffb3750
commit
1bacab8ab9
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user