]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_shared.c
netbsd build fix/update.
[xonotic/darkplaces.git] / sys_shared.c
index 39c9bf8bf4e1507d37a0d59b831e078dae5c63a9..c9f9c32fb1699fd1c59ebca5e2edb8d2b8b1af3f 100644 (file)
@@ -18,7 +18,7 @@
 #pragma comment(lib, "winmm.lib")
 #endif
 #else
-# ifdef __FreeBSD__
+# if defined(__FreeBSD__) || defined(__NetBSD__)
 #  include <sys/sysctl.h>
 # endif
 # include <unistd.h>
@@ -552,8 +552,12 @@ static const char *Sys_FindExecutableName(void)
 #else
        static char exenamebuf[MAX_OSPATH+1];
        ssize_t n = -1;
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 #if defined(__FreeBSD__)
        int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+#else
+       int mib[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME};
+#endif
        size_t exenamebuflen = sizeof(exenamebuf)-1;
        if (sysctl(mib, 4, exenamebuf, &exenamebuflen, NULL, 0) == 0)
        {