From 81f614533d48dbaa77527ec0c16472adcdae48e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 7 Sep 2019 19:42:00 +0300 Subject: [PATCH] Define G_IOV_MAX to 512 on macOS/iOS For macOS/iOS, UIO_MAXIOV is documented in writev(2), but only declares it if defined(KERNEL) Inspired by a GStreamer MR by Jim Mason https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/277 --- gio/gioprivate.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gio/gioprivate.h b/gio/gioprivate.h index 2bc54e49b..608d912c0 100644 --- a/gio/gioprivate.h +++ b/gio/gioprivate.h @@ -43,6 +43,10 @@ void g_socket_connection_set_cached_remote_address (GSocketConnection *connectio #define G_IOV_MAX IOV_MAX #elif defined(UIO_MAXIOV) #define G_IOV_MAX UIO_MAXIOV +#elif defined(__APPLE__) +/* For macOS/iOS, UIO_MAXIOV is documented in writev(2), but + * only declares it if defined(KERNEL) */ +#define G_IOV_MAX 512 #else /* 16 is the minimum value required by POSIX */ #define G_IOV_MAX 16