Skip to content

Commit

Permalink
Common: implement GetExeDirectory on NetBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeich committed Nov 24, 2017
1 parent 87942dd commit 7a16cff
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Common/FileUtil.cpp
Expand Up @@ -42,9 +42,8 @@
#include <stdlib.h> #include <stdlib.h>
#endif #endif


#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
#include <sys/sysctl.h> // KERN_PROC_PATHNAME #include <sys/sysctl.h> // KERN_PROC_PATHNAME
#include <unistd.h> // getpid
#endif #endif


#if defined(__APPLE__) #if defined(__APPLE__)
Expand Down Expand Up @@ -767,9 +766,15 @@ const std::string &GetExeDirectory()
#elif defined(KERN_PROC_PATHNAME) #elif defined(KERN_PROC_PATHNAME)
int mib[4] = { int mib[4] = {
CTL_KERN, CTL_KERN,
#if defined(__NetBSD__)
KERN_PROC_ARGS,
-1,
KERN_PROC_PATHNAME,
#else
KERN_PROC, KERN_PROC,
KERN_PROC_PATHNAME, KERN_PROC_PATHNAME,
getpid() -1,
#endif
}; };
size_t sz = program_path_size; size_t sz = program_path_size;


Expand Down

0 comments on commit 7a16cff

Please sign in to comment.