DragonFlyBSD build fix.

This commit is contained in:
David Carlier 2020-10-10 14:29:28 +01:00
parent f536c9a82a
commit 915c680f52

View file

@ -33,7 +33,7 @@
#include <unistd.h> // readlink(), amongst others #include <unistd.h> // readlink(), amongst others
#endif #endif
#if defined(__FreeBSD__) || defined(__NetBSD__) #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
#include <sys/sysctl.h> // for sysctl() to get path to executable #include <sys/sysctl.h> // for sysctl() to get path to executable
#endif #endif
@ -93,11 +93,11 @@ static void SetExecutablePath(char* exePath)
exePath[len] = '\0'; exePath[len] = '\0';
} }
#elif defined(__FreeBSD__) || defined(__NetBSD__) #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
// the sysctl should also work when /proc/ is not mounted (which seems to // the sysctl should also work when /proc/ is not mounted (which seems to
// be common on FreeBSD), so use it.. // be common on FreeBSD), so use it..
#if defined(__FreeBSD__) #if defined(__FreeBSD__) || defined(__DragonFly__)
int name[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; int name[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
#else #else
int name[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME}; int name[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME};