summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/PathV2.inc
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre@debian.org>2012-04-11 15:35:36 +0000
committerSylvestre Ledru <sylvestre@debian.org>2012-04-11 15:35:36 +0000
commit14ada94682fd7857e81e8dc58a2b37c309879a04 (patch)
tree7410d7dff8ecc51ff55d085898e90f61f2f93664 /llvm/lib/Support/Unix/PathV2.inc
parent28397be05985863cf3915aa789e574f63204bb70 (diff)
downloadbcm5719-llvm-14ada94682fd7857e81e8dc58a2b37c309879a04.tar.gz
bcm5719-llvm-14ada94682fd7857e81e8dc58a2b37c309879a04.zip
Fix the build under Debian GNU/Hurd.
Thanks to Pino Toscano for the patch llvm-svn: 154500
Diffstat (limited to 'llvm/lib/Support/Unix/PathV2.inc')
-rw-r--r--llvm/lib/Support/Unix/PathV2.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/PathV2.inc b/llvm/lib/Support/Unix/PathV2.inc
index c2d7df66d9c..edb101efb0f 100644
--- a/llvm/lib/Support/Unix/PathV2.inc
+++ b/llvm/lib/Support/Unix/PathV2.inc
@@ -46,6 +46,11 @@
#include <limits.h>
#endif
+// For GNU Hurd
+#if defined(__GNU__) && !defined(PATH_MAX)
+# define PATH_MAX 4096
+#endif
+
using namespace llvm;
namespace {
@@ -96,7 +101,12 @@ namespace sys {
namespace fs {
error_code current_path(SmallVectorImpl<char> &result) {
+#ifdef MAXPATHLEN
result.reserve(MAXPATHLEN);
+#else
+// For GNU Hurd
+ result.reserve(1024);
+#endif
while (true) {
if (::getcwd(result.data(), result.capacity()) == 0) {
OpenPOWER on IntegriCloud