mirror of https://github.com/YosysHQ/icestorm.git
Merge pull request #324 from thorpej/dev/pkgsrc-patch-NetBSD-1
Add NetBSD support
This commit is contained in:
commit
4fe71c12ea
|
|
@ -32,7 +32,7 @@
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
# include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -51,10 +51,14 @@ std::string proc_self_dirname()
|
|||
buflen--;
|
||||
return std::string(path, buflen);
|
||||
}
|
||||
#elif defined(__FreeBSD__)
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
std::string proc_self_dirname()
|
||||
{
|
||||
#ifdef __NetBSD__
|
||||
int mib[4] = {CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_PATHNAME};
|
||||
#else
|
||||
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
|
||||
#endif
|
||||
size_t buflen;
|
||||
char *buffer;
|
||||
std::string path;
|
||||
|
|
|
|||
Loading…
Reference in New Issue