Include new arbitrary limits if not already defined
Although GNU/Hurd supports unlimited path lengths only bounded by available memory, for now we can use an arbitrary limit on PATH_MAX that matches what POSIX requires. We don't have bandwidth to fix this properly right now. Author: Manolo de Medici <manolo.demedici@gmail.com> Signed-off-by: Damien Zammit <damien@zamaudio.com> Link: https://lore.kernel.org/r/20260208055858.2166524-2-damien@zamaudio.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Manolo de Medici committed
Feb 8, 2026 at 05:59 UTC
ff8d820da87e4a45caffef6ef212b7a6d74ec96d
1 file changed
+11
-4
include/qemu/osdep.h
+11
-4
@@ -384,6 +384,17 @@ void QEMU_ERROR("code path is reachable")
384
#define TIME_MAX TYPE_MAXIMUM(time_t)
385
#endif
386
387
+#ifndef PATH_MAX
388
+#define PATH_MAX 1024
389
+#endif
390
+
391
+/*
392
+ * Use the same value as Linux for now.
393
+ */
394
+#ifndef IOV_MAX
395
+#define IOV_MAX 1024
396
+#endif
397
+
398
/* Mac OSX has a <stdint.h> bug that incorrectly defines SIZE_MAX with
399
* the wrong type. Our replacement isn't usable in preprocessor
400
* expressions, but it is sufficient for our needs. */
@@ -661,10 +672,6 @@ struct iovec {
672
void *iov_base;
673
size_t iov_len;
674
};
664
-/*
665
- * Use the same value as Linux for now.
666
- */
667
-#define IOV_MAX 1024
675
676
ssize_t readv(int fd, const struct iovec *iov, int iov_cnt);
677
ssize_t writev(int fd, const struct iovec *iov, int iov_cnt);