diff options
author | Sylvestre Ledru <sylvestre@debian.org> | 2012-04-11 15:35:36 +0000 |
---|---|---|
committer | Sylvestre Ledru <sylvestre@debian.org> | 2012-04-11 15:35:36 +0000 |
commit | 6fc30c26b7fa9e89c4e9ab99b7feab11389cc3f4 (patch) | |
tree | c9c0eb6e787e01990aabf2e15d388c01cf58769e /lib/Support/Unix/PathV2.inc | |
parent | 611afc0620aed7827b5fdf9072a1827952b684b6 (diff) |
Fix the build under Debian GNU/Hurd.
Thanks to Pino Toscano for the patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Unix/PathV2.inc')
-rw-r--r-- | lib/Support/Unix/PathV2.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc index c2d7df66d9..edb101efb0 100644 --- a/lib/Support/Unix/PathV2.inc +++ b/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) { |