summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2010-08-31 22:38:00 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2010-08-31 22:38:00 +0000
commit4e7351d2ba60af43615ed63e6e43e74fc1e2d75d (patch)
tree942dadfe34bf74c067324fd90ca681ffe672e688 /llvm/lib/System/Unix
parent4b56d87290fa581e3944b3a6ad5a8adce08ee67f (diff)
downloadbcm5719-llvm-4e7351d2ba60af43615ed63e6e43e74fc1e2d75d.tar.gz
bcm5719-llvm-4e7351d2ba60af43615ed63e6e43e74fc1e2d75d.zip
Some fixes for NetBSD
llvm-svn: 112662
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r--llvm/lib/System/Unix/Path.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc
index 3d88311b4e7..44cb0081c50 100644
--- a/llvm/lib/System/Unix/Path.inc
+++ b/llvm/lib/System/Unix/Path.inc
@@ -282,7 +282,7 @@ Path::GetCurrentDirectory() {
return Path(pathname);
}
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined (__NetBSD__)
static int
test_dir(char buf[PATH_MAX], char ret[PATH_MAX],
const char *dir, const char *bin)
@@ -334,7 +334,7 @@ getprogpath(char ret[PATH_MAX], const char *bin)
free(pv);
return (NULL);
}
-#endif // __FreeBSD__
+#endif // __FreeBSD__ || __NetBSD__
/// GetMainExecutable - Return the path to the main executable, given the
/// value of argv[0] from program startup.
@@ -350,7 +350,7 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
if (realpath(exe_path, link_path))
return Path(std::string(link_path));
}
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined (__NetBSD__)
char exe_path[PATH_MAX];
if (getprogpath(exe_path, argv0) != NULL)
OpenPOWER on IntegriCloud