From 022ef5e1e6755599eac84a92b8a3774b4d57b49d Mon Sep 17 00:00:00 2001
From: Aditya Kamath <Aditya.Kamath1@ibm.com>
Date: Tue, 3 Mar 2026 09:36:49 -0600
Subject: [PATCH v1 2/3] Define AIX specific recvmmsg and sendmmsg declarations

This patch to resolve the error below:
../gio/gsocket.c:5513:15: error: implicit declaration of function 'sendmmsg'; did you mean 'sendmsg'? [-Werror=implicit-function-declaration]
 5513 |         ret = sendmmsg (socket->priv->fd, msgvec + num_sent, num_messages - num_sent,
      |               ^~~~~~~~
      |               sendmsg
../gio/gsocket.c: In function 'g_socket_receive_messages_with_timeout':
../gio/gsocket.c:6038:15: error: implicit declaration of function 'recvmmsg'; did you mean 'recvmsg'? [-Werror=implicit-function-declaration]
 6038 |         ret = recvmmsg (socket->priv->fd,
      |               ^~~~~~~~
      |               recvmsg
cc1: some warnings being treated as errors
---
 gio/gsocket.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gio/gsocket.c b/gio/gsocket.c
index 0a2a523e2..1d5732661 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -58,6 +58,12 @@
 #include <sys/uio.h>
 #endif
 
+#ifdef _AIX
+#include  <sys/socketvar.h>
+extern int sendmmsg (int, struct mmsghdr *, unsigned int, int);
+extern int recvmmsg (int, struct mmsghdr *, unsigned int, int, struct timespec *);
+#endif
+
 #define GOBJECT_COMPILATION
 #include "gobject/gtype-private.h" /* For _PRELUDE type define */
 #undef GOBJECT_COMPILATION
-- 
2.51.2

