aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/Files.hsc
diff options
context:
space:
mode:
authorGravatar simonmar <unknown>2005-05-10 10:40:12 +0000
committerGravatar simonmar <unknown>2005-05-10 10:40:12 +0000
commitf626431239a7814a07cfde41ac7b4024db87d6fd (patch)
tree7e3475e98b565671ad6d9ba0cc133b1d8f07c027 /System/Posix/Files.hsc
parent25561ed4391e7e0d87fd0f33a7819b0f40f864c7 (diff)
[project @ 2005-05-10 10:40:12 by simonmar]
PATH_MAX fixes from Thomas Schwinge.
Diffstat (limited to 'System/Posix/Files.hsc')
-rw-r--r--System/Posix/Files.hsc6
1 files changed, 6 insertions, 0 deletions
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index e9a0477..3bdfe98 100644
--- a/System/Posix/Files.hsc
+++ b/System/Posix/Files.hsc
@@ -349,6 +349,12 @@ foreign import ccall unsafe "symlink"
-- ToDo: should really use SYMLINK_MAX, but not everyone supports it yet,
-- and it seems that the intention is that SYMLINK_MAX is no larger than
-- PATH_MAX.
+#if !defined(PATH_MAX)
+-- PATH_MAX is not defined on systems with unlimited path length.
+-- Ugly. Fix this.
+#define PATH_MAX 4096
+#endif
+
readSymbolicLink :: FilePath -> IO FilePath
readSymbolicLink file =
allocaArray0 (#const PATH_MAX) $ \buf -> do