diff options
Diffstat (limited to 'kernel/yosys.cc')
-rw-r--r-- | kernel/yosys.cc | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/kernel/yosys.cc b/kernel/yosys.cc index aa5901271..49d644548 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -46,15 +46,10 @@ # include <unistd.h> # include <dirent.h> # include <sys/types.h> -# include <sys/wait.h> # include <sys/stat.h> # include <glob.h> #endif -#ifdef __FreeBSD__ -# include <sys/sysctl.h> -#endif - #include <limits.h> #include <errno.h> @@ -77,7 +72,7 @@ std::vector<void*> memhasher_store; void memhasher_on() { -#if defined(__linux__) || defined(__FreeBSD__) +#ifdef __linux__ memhasher_rng += time(NULL) << 16 ^ getpid(); #endif memhasher_store.resize(0x10000); @@ -672,26 +667,6 @@ std::string proc_self_dirname() buflen--; return std::string(path, buflen); } -#elif defined(__FreeBSD__) -std::string proc_self_dirname() -{ - int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; - size_t buflen; - char *buffer; - std::string path; - if (sysctl(mib, 4, NULL, &buflen, NULL, 0) != 0) - log_error("sysctl failed: %s\n", strerror(errno)); - buffer = (char*)malloc(buflen); - if (buffer == NULL) - log_error("malloc failed: %s\n", strerror(errno)); - if (sysctl(mib, 4, buffer, &buflen, NULL, 0) != 0) - log_error("sysctl failed: %s\n", strerror(errno)); - while (buflen > 0 && buffer[buflen-1] != '/') - buflen--; - path.assign(buffer, buflen); - free(buffer); - return path; -} #elif defined(__APPLE__) std::string proc_self_dirname() { |