summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/eio.c b/eio.c
index 1dfc7a4..937c066 100644
--- a/eio.c
+++ b/eio.c
@@ -139,6 +139,11 @@
# define NAME_MAX 4096
#endif
+/* used for readlink etc. */
+#ifndef PATH_MAX
+# define PATH_MAX 4096
+#endif
+
/* buffer size for various temporary buffers */
#define EIO_BUFSIZE 65536
@@ -1610,8 +1615,8 @@ static void eio_execute (etp_worker *self, eio_req *req)
case EIO_SYMLINK: req->result = symlink (req->ptr1, req->ptr2); break;
case EIO_MKNOD: req->result = mknod (req->ptr1, (mode_t)req->int2, (dev_t)req->int3); break;
- case EIO_READLINK: ALLOC (NAME_MAX);
- req->result = readlink (req->ptr1, req->ptr2, NAME_MAX); break;
+ case EIO_READLINK: ALLOC (PATH_MAX);
+ req->result = readlink (req->ptr1, req->ptr2, PATH_MAX); break;
case EIO_SYNC: req->result = 0; sync (); break;
case EIO_FSYNC: req->result = fsync (req->int1); break;